I don't get how it would be smaller than indexed bitmaps though?
It's not just variable width, but variable height too since virtually no characters fill the whole area.
Maybe add Bangle.selectFont(size)
A new function is a great idea! And then we can provide a polyfill for older firmwares.
I was a bit concerned about having to polyfill setFont and it hurting performance.
Potentially we could just have g.setFontSize(...) instead. To get a selected font you could always do g.setFontSize(...).getFont()
setFontMono(bool)
That's a good thought - and not too hard to do. I had been wondering about how to do monospaced fonts nicely...
I guess there's a question about whether we try and have setFontSize/whatever it's called be smart enough that you could say g.setFontSize({text: ..., width: 170, height:100, min:14, wrap:true}) and it'd try and find a font that would display the given text in the area. It might be good for messages...
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.
It's not just variable width, but variable height too since virtually no characters fill the whole area.
A new function is a great idea! And then we can provide a polyfill for older firmwares.
I was a bit concerned about having to polyfill
setFont
and it hurting performance.Potentially we could just have
g.setFontSize(...)
instead. To get a selected font you could always dog.setFontSize(...).getFont()
That's a good thought - and not too hard to do. I had been wondering about how to do monospaced fonts nicely...
I guess there's a question about whether we try and have
setFontSize
/whatever it's called be smart enough that you could sayg.setFontSize({text: ..., width: 170, height:100, min:14, wrap:true})
and it'd try and find a font that would display the given text in the area. It might be good for messages...