how to use of unicode fonts in Verifone VX675

818 Views Asked by At

I have a problem to write Arabic text on VeriFone vx675 pay pose model. i trying this codes line:

int ret=set_font("Tahoma.ttf");
if (ret!=0)
{
    printf("con : %d, err: %s\n",ret,strerror(errno));
}
display_at(0,0,"سلام", NO_CLEAR);

but device show an error as

Invalid Argument

could anyone say to me how i should to resolve this problem. or how i can write Unicode Arabic text in Vx675 Model.

Thanks in Advance

1

There are 1 best solutions below

2
On

Disclaimer: I have not worked with the Vx675 before, nor have I tried to use an Arabic font, but I think this will work...

You can't use .ttf fonts on the VeriFone terminals. Instead, you need to use VeriFone's "Font Generation Tool" to convert a .ttf to either a .vft or .fon file.

  1. Start "Font Generation Tool". If you installed the DTK, then it should be in your start menu under "VeriFone"
  2. Go to the "Font" menu item and select "Convert Font".
  3. Select "Windows Unicode Font"
  4. Select "Arabic" as the "Custom Unicode Fonts" choice. Set whatever other styles you want.
  5. Click through the rest of the wizard and save the font file somewhere.
  6. Download that new font file to your terminal with the rest of your program (this is typically the step I forget to do on my first run)
  7. When you do your "display_at" function, I'm noting that you are using the Arabic character(s) directly. I have no experience with this as to whether or not it will work, but one thing you can try if it isn't working is to use printf with numerical offsets. I don't think you'll want to do that in the long-run, but it can help you get started:

    printf("%c%c%c%c%c%c%c%c", 0, 1, 2, 3, 4, 5, 6, 7);