# Calculating height of a scalable font when only given width

When giving font 0 a width but no height, the height should be calculated based on the standard font matrix. For font 0, that would be h:15 w:12. So for width of 65, the height should be calculated to be 81 based on that ratio, but when printing A0N,81,65 it prints way bigger than it does with just the width specified. How is the height calculated based on that font matrix exactly? In my case, we are getting a zpl string from a client and doing some calculations on it. Unfortunately, only the width is ever supplied.

Anonymous (not verified)
If the h or w value is not

If the h or w value is not specified in ^A0N, h, w command, the height or width will be calculated based on its corresponding h or w specified by the last ^CF command. Please see page 39 on ZPL Programming Guide. If  ^CF command was not explicitly used, then the default of h and w in ^CF at power up are 9 and 5 respectively, as described on page 128 on ZPL Programming Guide. Hope this helps.

Vote:
Vote up!
Vote down!

Points: 0

You voted ‘up’

Tre Calhoun

That's what I had thought, but when printing it out, it looks like it just copies that other value over. No CF is ever explicitly used. So when printing   ^A0N,10,    ^A0N,10,10   and   ^a0N,,10   , they all look the same.  But only with this one font. Trying the same with the A font and it appears to follow it's standard font matrix with the larger height calculated off of the given width. So, with font A with those same values, they are all different sizes, but with font 0, they are all the same. I'm just wondering why this one font is different (because its scalable?) and if it is printer dependent. I can follow the rule of "h is missing so copy w to it" but only if it will work that way with all printers.

Vote:
Vote up!
Vote down!

Points: 0

You voted ‘up’

Anonymous (not verified)

Your observation on scalable fonts is correct. I’ve also tried ^A0N,60, , ^A0N, ,60 and ^A0N,60,60. They produce the same size. It means if one of the two parameters for scalable font size is not given, the font engine assumes it is proportional, so it’d be the same as saying:

^A0N,50,^FD == ^A0N,50,50^FD

^A0N,,30^FD == ^A0N,30,30^FD

This is not printer dependent.

Vote:
Vote up!
Vote down!

Points: 0

You voted ‘up’

Tre Calhoun
Great! Thank you very much

Great! Thank you very much for the help and clarification.

Vote:
Vote up!
Vote down!

Points: 0

You voted ‘up’