peterhinch / micropython-font-to-py

A Python 3 utility to convert fonts to Python source capable of being frozen as bytecode
MIT License
368 stars 67 forks source link

big font file size #36

Closed varna9000 closed 2 years ago

varna9000 commented 2 years ago

Hi Peter, I've been using this tool for more than year and my biggest concern is the size of the output font file. I'm generating mainly Cyrillic fonts and I've noticed two things - the bigger the font size, the bigger the .py file. Also, if I generate same amount of chars latin letters and same font size, the .py file is smaller. Does the char number in utf-8 table somehow influence .py file size ( the higher the char number, the bigger the file size)? I've experimented with small and capital letters. Adding capitals to the font actually generates smaller files size, than the small letters, since the capitals have smaller char number in utf-8 table.

Experiencing the above, eats up a lot of esp8266 memory, even if I compile it to .mpy

peterhinch commented 2 years ago

The solution is to use frozen bytecode, which is better than compiling to MPY. Fonts then use Flash space but almost zero RAM.

varna9000 commented 2 years ago

Thanks, Peter. I'll try this even with the other external modules I'm using in the project.