0

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

1 Answer 1

0

Disregard this as I am very, very stupid and was replacing the wrong label font in the ^CWA command. If anyone stumbles upon this - this works.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.