espruino/BangleApps

[fontext] the colon : character is not handled well

Closed this issue · 5 comments

Hello,
with this app:
https://github.com/espruino/BangleApps/tree/master/apps/fontext

téléchargement (2)
The text of this test is:

Test:comma
Test : comma

the colon character seems to be so thin that it actually collides into the next letter.

Edit: just realized the name of the character is colon, sorry about that

You can see it with the left parenthesis in the subject as well. I've seen it for some other special character, maybe it was the exclamation mark.

same for the apostrophe '

@gfwilliams could there be something up with the generation of font.pbf?

There's almost certainly an issue. The code that handles generating the font is at https://github.com/espruino/BangleApps/blob/master/bin/font_creator.js and it uses https://github.com/espruino/EspruinoWebTools/blob/master/fontconverter.js which does the heavy lifting.

The font itself is the GNU Unifont from https://unifoundry.com/unifont/index.html which comes as a bitmap.

However the bitmap itself provides no information on font spacing, so we basically just use the bounding box of the character. It's possible we use the width of the bounding box without taking into account the offset of that bounding box?

There is a bunch more stuff to the GNU Unifont than just the bitmap, so it's possible you can find the character spacings to use from some other source?

Should be fixed now with b734d70