pebble-dev / RebbleOS

open source operating system for low-power smartwatches
Other
355 stars 38 forks source link

Build a better font cache #36

Open jwise opened 6 years ago

jwise commented 6 years ago

"Build me a font cache, splendid and graceful, make it better by design..."

Currently the font cache has system-global state that allocates in the app heap. Unsurprisingly, this is the end of the world when apps load and unload. I have a "halfass font cache" branch that moves this to the system heap, but realistically, we need the font cache to live in the App structure, and for fonts to live in app memory. Also, sucking the entire font into memory is unlikely to be a sustainable solution, so it's probably better to just suck in font metadata, and pull in characters into a smaller cache pool -- effectively, building a cache character-by-character.