So I've been raking my brain on this for a while now : I'm trying to upload a custom font to a ZPL printer using the ~DU command in python, but can't get the encoding right.
This is what I'm currently doing:
font = f.read()
byte_data = binascii.hexlify(font)
fontString = str(byte_data)
stringSize = len(byte_data)
I then modify currently existing ZPL to add the ~DU command as such :
ZPL = ZPL + '~DUR:FONT.FNT,' + str(stringSize) + ',' + fontString
ZPL = ZPL + '^CWA,R:FONT.FNT'
I've seen people do the same thing here: Using ttf font in Labelary api via c# so I'm wondering if I didn't screw up my python equivalent. Any help would be greatly appreciated