tchapi / Adafruit-GFX-Font-Customiser

A little utility to customise pixel fonts for the Adafruit GFX library
https://tchapi.github.io/Adafruit-GFX-Font-Customiser/
MIT License
90 stars 47 forks source link

Add checkboxes to selectively disable glyphs #15

Closed mengstr closed 4 years ago

mengstr commented 4 years ago

I only needed digits, space, dot and minus for a project as was getting a bit short on available code space in the MCU, so I added the possibility to selectively disable (null out) the unused characters to save some space. For my desired characters I set the range to 0x20..0x39 and disabled the characters I didn't need in the range, resulting in a gain of about 600 bytes compared to just extracting the range from the full charset.

The disabled characters simply points to the same location in the bitmap as the previous character and gets its bitmap width and height set to 0. So there still are entries for the disabled characters in the GFXglyph-struct, but no data in the bitmap for them - this keeps the characters in their correct places in the ASCII table.

tchapi commented 4 years ago

This is really great ! I'll add some comment in the exported file in a later commit and maybe add some explanation text in the page.

Thanks a lot !