Update to font_to_py for tiny fonts

Discuss development of drivers for external hardware and components, such as LCD screens, sensors, motor drivers, etc.
Target audience: Users and developers of drivers.
Post Reply
User avatar
Posts: 4935
Joined: Fri Jul 18, 2014 8:01 am
Location: UK

Update to font_to_py for tiny fonts

Post by pythoncoder » Sat Feb 06, 2021 2:47 pm

Thanks to ideas from @enigmaniac the font_to_py utility now supports bdf and pcf files.

The original concept of this utility was a means of converting scalable ttf and otf files to bitmaps in a format providing fast access with minimal RAM consumption. This works well at relatively large sizes. As the output size reduces programmatic scaling becomes visually poorer. The best tiny fonts are hand-crafted for a single, fixed size and distributed as bitmaps; these may be fixed or variable pitch.

Various bitmapped file formats exist, but bdf and pcf files are widely available. The utility now accepts these formats. Data is converted to Python source, preserving the font bitmap as the designer intended. The Python font format is unchanged, enabling these fonts to be used interchangeably with ones created from scalable formats.
Peter Hinch

Post Reply