我希望在一行中反转文本,另一行显示正常,而在verifone vx520中没有反转。我使用inverse_toggle()函数但这个函数反转整个页面而不是一行。我怎样才能反转一条线而另一条线显示为正常?
这是我的代码:
int display = open(DEV_CONSOLE, 0);
inverse_toggle();
write(display,"first line to inverse\n",22); //i want to inverse just this line
write(display,"second line shown normally\n",27);//i want to show this line normally
答案 0 :(得分:1)
我从未玩过inverse_toggle
或setinverse
,但我注意到你没有将其切换回来。试试这个:
int display = open(DEV_CONSOLE, 0);
inverse_toggle();
write(display,"first line to inverse\n",22);
inverse_toggle(); // new line
write(display,"second line shown normally\n",27);
要获得更多控制权,请使用setinverse
。另外,请查看display_at
。我认为你会发现它比write
int display = open(DEV_CONSOLE, 0);
setinverse(1); // explicitly turn inverse on
display_at(1, // x
1, // y
"first line to inverse", // no /n needed since we are specifying x and y
NO_CLEAR); //defined in ACLCONIO.H. Other options are CLR_LINE and CLR_EOL
setinverse(0); // explicitly turn inverse off
display_at(1, 2, display,"second line shown normally", NO_CLEAR);
如果这不起作用,您可以随时使用字体工具来制作新字体(尽管这会更有效)。