Closed petrbrouzda closed 3 years ago
Oh ! It seems like the width calculation is off for the glyph columns
I'll look into that, good catch
The calculation is based on the max xAdvance
figure found in the font. Is there any reason that this font only has a max of 4
pixels for that property ?
You can see the xAdvance
here on this glyph: it's the second vertical red line. In a conventional font, it indicates how subsequent characters overlap:
So basically if you use this font as-is and use two characters on a line, they will totally overlap (except for 4 pixels) which doesn't seem right.
While I think I should take into account the actual max width of a glyph instead in this tool, I think the xAdvance
for the characters of this font is not correctly set up.
What do you think ?
Yes, xAdvance is set incorrectly. I didn't care about the xAdvance, because I'm using this font as iconset only - so I print only one character at a time, never more than one. Mea culpa. So I'm able to easily solve the problem by manualy editing xAdvance of one character - no fix from you is needed. Thank you.
Still I think that the width should be calculated better. I have made a fix in a37d9d4, tell me if that still works well for you !
Works correctly now - even on a font with bad xAdvance. Thank you.
When I extract font with big characters (attached), the UI is rendered incorrectly and font can't be edited. Chrome, Windows 10
Font file: IconsFont2.h.txt