recantha / picopicorder

The Picorder project, redux, on a Raspberry Pi Pico
8 stars 1 forks source link

You could get better speed with binary font #4

Closed dglaude closed 3 years ago

dglaude commented 3 years ago

There is a new way and better format to deal with font. It require to convert to PCF font. It might take less memory, less space, make less fragmentation of the memory, maybe be faster to display. It can be as simple as to convert your file and load the new file...

https://learn.adafruit.com/custom-fonts-for-pyportal-circuitpython-display/convert-to-pcf

recantha commented 3 years ago

Is a .bdf not a binary font, then? I assumed the b was for binary... Doh!

dglaude commented 3 years ago

Maybe it is bitmap font and not binary font. Also I don't see any B in PCF acronym, so much for TLA!

There is also a way to "preload" the character you plan to use with load_glyphs. It is supposed to cost memory and increase speed... I guess.

recantha commented 3 years ago

Interesting! The PCF is FOUR TIMES the size of the bdf. However, it is a lot quicker to render. I've also put load_glyphs in, and that's sped it up, too! Think I'll keep it in there! Thank you! :-)