is enough that the code will run without using up any RAM for a font that isn't used. It's worth noting that the Graphics.prototype.setFontArchitect function will only ever use maybe 5 JS variables regardless of the size of its contents (because it's stored in flash), so even 7 of them won't use up all your memory.
I would however ask the question: does your app really need 7 optional fonts? Will anyone actually use them all, or is it better to just have a single, good, well-tested font?
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Hi - yes, what you suggest would work fine and shouldn't use too much memory.
However even just doing:
is enough that the code will run without using up any RAM for a font that isn't used. It's worth noting that the
Graphics.prototype.setFontArchitect
function will only ever use maybe 5 JS variables regardless of the size of its contents (because it's stored in flash), so even 7 of them won't use up all your memory.I would however ask the question: does your app really need 7 optional fonts? Will anyone actually use them all, or is it better to just have a single, good, well-tested font?