Closed sago35 closed 1 year ago
The egregious use of RAM for fonts was the primary reason I abandoned TinyGo for my e-paper clock. I had plenty of flash, but almost no RAM. The Arduino libraries solved this problem (although I was forced to switch to C++).
Hi @timboldt
Sometimes LLVM will store data in ROM without using a const font, But even in that case, the build time is very long, as described in #22.
The method described in this issue has the following advantages:
I'll try to make a PR somewhere this week.
This looks like the perfect answer to the main issues I had with fonts: long build times, and excess RAM usage.
For example, fonts created with tinyfontgen-ttf are created in const. So I believe that we have completed the support.
The current dev branch code has font data in RAM. This makes it very RAM intensive.
This issue shows how to put the font data in const, which will be done in the future. It will also allow you to put it in spi flash afterwards.
I plan to put out a PR once I get my code together. The PR will replace all existing fonts.
before:
after: