i have problem printing greek characters to a Zebra GC420 desktop printer. My code is:
$printarr[] = '^XA^CWZ,E:TT0003M_.FNT^FS^XZ^XA^FWN^FO70,50^A0,30,25^FH^FD'.labels_utf8_parse($name).'^FS^FO70,90^BY2^B3,,100^FD' . $node->field_o['und'][0]['value'] . '^FS^XZ';
What am i doing wrong? Instead of greek letters i get crosses. The strange part is that in another area of the code,the below code prints correctly greek characters:
$toprint = '^XA^CWZ,E:TT0003M_.FNT^FS^XZ^XA^FWR';
What should i do, how should i proceed to see what is the problem and how could i solve it?
You need to set the character encoding to UTF-8 using ^CI28
. Put it near the top of the format, for example, after the ^XA^FWN
.
this is one aspect. How can i ensure that the printer has loaded the custom fonts, so as to display greek characters? 'The ZPL built-in fonts don't support many non-Latin characters, so you may need to use a custom font (uploaded to the printer via the ~DU command, for example)' Is there a way i could do this via zpl code?
You can use
^XA^HWE:TT0003M_.FNT^XZ
to query the printer for the font directory listing. See the^HW
command in the ZPL reference for the format of the returned string.