-
It's a bit slow, so would be better off implemented in C.
such code would be doable in InlineC https://www.espruino.com/InlineC well except calling getPixel/setPixel but g.buffer is flat array that could be used directly.
Or in this case try just to put "compiled" there to
process
, see https://www.espruino.com/Compilation
Also check hints there, you may put g.getPixel,g.setPixel to local variables as it is called in loop.
While developing my current Bangle app, I needed to use a larger font. In my case, the built-in 6x15 font, scaled x2. As expected, it looked a bit rough. I wondered if there was some way to automatically smooth things out without generating a 12x30 font and I came up with the proof-of-concept program below.
In short, it adds extra pixels in black squares that have two adjacent white squares forming a 'corner'.
It draws some sample text three times: the top is the base x1 scale text. Next is the xN native scaled-up rendering. The last is my smoothed scaled-up xN rendering, using the x1 render as the source.
Tapping on the screen will cycle through the 7-bit ASCII characters. When all the characters are cycled, the scale increases by 1 and the characters start again.
It's a bit slow, so would be better off implemented in C.
Do what you like with it. I think it could reduce the need for large fonts.