Re: [EE] Software to create a font from a bitmap
"Harold Hallikainen" <[email protected]> Mon, 4 May 2026 10:07:58 -0700
| Newsgroups | gmane.comp.hardware.microcontrollers.pic |
|---|---|
| Message-ID | <[email protected]> |
On Mon, May 4, 2026 7:52 am, Isaac Marino Bavaresco wrote: > Dear All, > > > I just=C2=A0published on GitHub a program that I use to create fonts for = my > embedded equipments, together with some code to use those fonts in a > microcontroller. > > The URL is: <https://github.com/Ibavaresco/EmbeddedFonts/tree/main> > > > As most know, graphical color displays usually don't know how to draw > text, all that they know are pixels. Creating text on the screen is > responsibility of the firmware running on the MCU. > > Usually designers provide only a single fixed-width font, because that > is a laborious part of the development. > > Years ago I designed a new equipment with a TFT LCD based on the HX8357 > controller. That LCD offered a good resolution (320x240) with 16-bit > colors, and I wanted to create a nice U.I., so I created routines to deal > with variable-width characters and needed a good way to create the font > bitmaps. > > This program takes a monochromatic Windows bitmap file with a very > particular text content/layout, extracts all the character shapes (code > page WINDOWS-1252 a.k.a. "ANSI") and create a C source file with the data > to be used by my LCD routines. > > The software can provide the "seed" text file that is to be converted > into a bitmap to be extracted. > > This software makes easy to use several different fonts, with different > typefaces, sizes and effects. It all depends on the=C2=A0available > program=C2=A0memory, of course. Very nice! I've been using Unifont for at least 15 years. It does 8x16 and 16x16 glyphs. If I am only using ASCII, it fits inside the microcontroller flash (typically PIC32). If using 16 bit character encoding (using UTF-8), I put it in an external 1 MB flash. The PIC code then indexes into the external flash, reads the bitmap, and sends it to the display. I did a little bit of study of font files for vertical text. Font files are complicated! I never did figure out how to find the vertical origin and the advance height for vertical text... Harold https://w6iwi.org -- = Not sent from an iPhone. -- = http://www.piclist.com/techref/piclist PIC/SX FAQ & list archive View/change your membership options at https://mailman.mit.edu/mailman/listinfo/piclist