My gut feeling is that if you do fillPoly and we assume a 50% clamping value, the exact same pixels should be filled around the edge as if you draw lines between all the points. At the moment that's definitely not happening - and even the slightly broken hacks I tried so far really improve font rendering.
I reckon when I fix that, the fonts could still look better than they do - and at that point it'd be great if you could look at what needs changing on the actual vector fonts themselves. You could actually do that already by taking the code from http://forum.espruino.com/conversations/321462/#14260812 and just drawing lines (which work) rather than fillPoly which doesn't.
In terms of the clamping value - I'd love to be able to tweak that, but right now everything works without any antialiasing. I guess to do the clamping properly we'd need to have an antialiased renderer and then do the clamping as the final stage (effectively doing a normal render and then a threshold).
Antialiased rendering would be amazing (especially for when people connect displays that can actually handle grayscale), but unfortunately it seems I'm incapable of creating algorithms for drawing aliased polygons properly so I don't have much faith in my ability to make them antialiased :)
If someone wanted to contribute code for antialiased polys, lines and circles that would be absolutely amazing though ;)
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.
My gut feeling is that if you do
fillPoly
and we assume a 50% clamping value, the exact same pixels should be filled around the edge as if you draw lines between all the points. At the moment that's definitely not happening - and even the slightly broken hacks I tried so far really improve font rendering.I reckon when I fix that, the fonts could still look better than they do - and at that point it'd be great if you could look at what needs changing on the actual vector fonts themselves. You could actually do that already by taking the code from http://forum.espruino.com/conversations/321462/#14260812 and just drawing lines (which work) rather than
fillPoly
which doesn't.In terms of the clamping value - I'd love to be able to tweak that, but right now everything works without any antialiasing. I guess to do the clamping properly we'd need to have an antialiased renderer and then do the clamping as the final stage (effectively doing a normal render and then a threshold).
Antialiased rendering would be amazing (especially for when people connect displays that can actually handle grayscale), but unfortunately it seems I'm incapable of creating algorithms for drawing aliased polygons properly so I don't have much faith in my ability to make them antialiased :)
If someone wanted to contribute code for antialiased polys, lines and circles that would be absolutely amazing though ;)