Closed tchapi closed 3 years ago
@tchapi
Wow, what a beautiful solution! Much better than my hacky PR! It works form me, and I love that the "Last glyph to export" is automatically updated. Thanks!
Some suggestions / questions:
xAdvance
is set to 4 and yOffset
to 1, and this is also exported. Is this by design or a problem in the export logic? If it's by design I would suggest adding the disabled characters with xAdvance = 0
and yOffset = 0
.GFXfont.first
and GFXfont.last
are uint16_t
.newCharCode < 32
). In the Adafruit_GFX::write()
method, this is NOT checked. If it would be possible to enter the keycode directly (in addition to the character?) one could use all characters from 1 to 255 (excluding \0
which has special meaning in C(++), \r
(which is ignored in Adafruit_GFX::write()
and \n
(which gets special treatment in Adafruit_GFX::write()
).Again, thanks a lot for your work. I thought I would do some small, a bit hacky drive-by commit for a corner use case and did not expect to see this properly implemented! :-)
Your suggestions are great ! I've updated a few things — can you have a look ?
Thanks a lot, that was quick!
I noticed some more things:
0x30
('0'), and added character 0x20
(' '). Since in the export the order of the table is used this leads to incorrect order of the characters in the export. This was probably already present before these new changes, but I didn't catch it then.,{ 259, 0, 0, 0, 0, 0 } // '
'
,{ 260, 0, 0, 0, 0, 0 } // ''
,{ 261, 0, 0, 0, 0, 0 } // ''
,{ 262, 0, 0, 0, 0, 0 } // '
'
xAdvance
, xOffset
and yOffset
values are still exported. Since the bitmap data is not present in the export anyways it might make sense to set these values to 0 as well? This would prevent inserting empty pixels when a disabled character is used by accident.Just a thought, and clearly out of scope: How far away from not having a "customizer" but an "editor" where you can create new fonts is this project after these changes? Maybe it's only a dialog to enter font name and first character which initializes the data structures?
Please have a look at https://github.com/tchapi/Adafruit-GFX-Font-Customiser/pull/18, i added some fixes for the problems I described above.
This is fantastic. Thanks so much for your help on this !
Thank you for providing this very useful tool! If I find the time I might add some button to create a new, empty font. What do you think about that? Would you be interested in including this feature? With this, this tool would be a full editor which could also be used to create new fonts.
I'm all for it. I think we might need to revamp the JS a bit then, it may become a bit cumbersome otherwise.
PS: I added your handle to https://github.com/tchapi/Adafruit-GFX-Font-Customiser as a contributor. Tell me if you wish to remove this
Thanks for the merge and for adding me as a contributor! :-)
This PR allows the addition of characters at the start or at the end of the set, automatically adding the interval characters in between so the glyphs table is contiguous