Is there a way to add or replace the font used in draw_string to one that is more contemporary and less blocky and distorted when scaled?
This is a major todo. We need to add support for true type font. There’s a PR open for this but it needs a lot of work to be ready.
+1 request for true type fonts. What are your thoughts on when you could be adding this?
Maybe March or sooner, we’ll probably need it for some demo work coming up.
Checking in to see how things are progressing on true type fonts…
Getting the IDE updates done to support ROMFS and running custom models, then more post processing support and examples for models, followed by camera image quality tuning are priorities, improving the font will come afterwards.
Bumping this up again to see how things are coming along with the true type font.
@ajacobs - Given the list of current items on my plate this will not be tackled until next year. However, we have a gameplan for how to do it: imlib/truetype: add truetype font support. by xue-singtown · Pull Request #2188 · openmv/openmv · GitHub
In the meantime, is there a way to draw bitmapped alphanumeric characters from preloaded font files on the SD card. It would be slower, but that would be ok for UI functions when not capturing/processing images.
Yes, use draw image. It can directly draw images using a file path at an x/y location. Then, pass the alpha lookup table argument to map different grayscale levels to different alpha values. You can also apply a color lookup table too in order to color the text. Your pre-rendered font images would then just need to be grayscale 0-255 images of the text. You’d build the alpha table to count 0-255 to match the grayscale images such that an alpha of 255 means that the character pixel is completely drawn versus the background.