Search code examples
zplzpl-ii

Printing superscript / subscript to zebra printer using ZPL


I'm trying to find a solution to print superscript using ZPL.

Example, if I have this string of ZPL:

string ZPLString =
    "^XA" +
    "^FO50,50" +
    "^A0N50,50" +
    "^FDHello, World!^FS" +
    "^XZ";

sendToZebraPrinter(ZPLString);

Since there aren't any superscript characters, I could send this to my printer without issue. But if I wanted to use this string:

string ZPLString =
    "^XA" +
    "^FO50,50" +
    "^A0N50,50" +
    "^FDe = mc²^FS" +
    "^XZ";

sendToZebraPrinter(ZPLString);

The superscript won't print natively. I think I need to access an international character set or something but I'm not sure how to do this, especially if I only need it for the one character. Do I need to change my entire character set, or do some sort of "replace" on it?

Note, we are generating ZPL code manually and shooting it directly at the printers (unfortunately this is our system), bypassing any drivers or 3rd party dev components of any kind.


Solution

  • Try using ^CI13 to select code page 850, then use _fd in your string for the superscripted 2. The underscore is used to designate a hex character.