How do I pick the right size when using a pixel font like Tiny5 Mono on a small display?

Nov 09, 2026 Last reply: 1 week ago 3 Replies

First reply

Ben_Cobalt

Yeah, ignore the pt stuff when you're generating the BDF. The 6 pt tip is just about keeping the math clean at 96 dpi, where 6 pt works out to exactly 8 px. So the pixel heights you want are 8, 16, 24 and so on. When your converter asks for size, feed it the pixel number…

Read the full reply

Been messing around with one of those tiny SPI screens on a breadboard, driving it from an ESP32, and I found this new monospaced pixel font that looks perfect for the little system readout I want to build. Problem is I keep second guessing myself on sizing. The docs say to use sizes in steps of 6 pt for sharp pixels, but when I generate the BDF file for u8g2 it only cares about pixel height, not points. So does that mean I just pick a bitmap height that matches, like 8 px, and ignore the pt stuff entirely? Also a bit lost on the variable axes. Weight, width, all that. Once it's converted down to a bitmap for the microcontroller, do those even matter anymore, or do I need to bake in a specific style before converting? Feels like I'm overcomplicating it but I'd rather ask than burn an afternoon guessing.


Yeah, ignore the pt stuff when you're generating the BDF. The 6 pt tip is just about keeping the math clean at 96 dpi, where 6 pt works out to exactly 8 px. So the pixel heights you want are 8, 16, 24 and so on. When your converter asks for size, feed it the pixel number directly. With this font sitting in a 6x9 cell, the 8 px size is the natural one for a small readout, and anything that isn't a multiple of 8 will get you uneven rounding and muddy pixels. I burned an afternoon on exactly that with a 7 px attempt once before it clicked.

For the variable axes, you're right that they can't follow you onto the microcontroller. A BDF file is just a frozen set of bitmaps, so whatever style you instantiate before conversion is what you're stuck with. That's actually fine for your use case. Decide the look first, like Weight for boldness, or set the Width axis if you want square pixels on your screen, render the static instance, then convert that. There's no live tweaking after the fact, and honestly on a tiny SPI panel you wouldn't want it anyway, the RAM and cycles aren't there. One practical note from doing similar stuff on an ESP32: check what the converter does with the box-drawing glyphs. If they fill the whole cell with no gaps, frames around your readout sections can come straight from the font instead of you drawing lines with drawHLine and friends. Saves a bunch of fiddly code. Same trick works for block elements if you want bar-graph style CPU or memory meters.

Also worth sanity-checking the advance width on a couple of strings before you commit. Monospaced fonts make column layouts dead easy, but if the cell width doesn't divide nicely into your screen resolution you'll end up with an awkward margin on the right side. Better to find that out in a test sketch than after you've wired the whole layout.

One more thing about baking the instance before conversion: after you pick your weight and width, check the actual rendered bitmap against the cell at two or three diferent strings, because some glyph sets have a little breathing room above the cap height that shifts your vertical baseline depending on the style you froze. I ran into that on a similar project where the bold instance looked fine on 'A' but sat a pixel low on lowercase, and it only showed up once the whole readout was on screen. Cheap to catch early with a test sketch.

Skeptic here: disagree with the earlier claim that anything not a multiple of 8 gives you muddy pixels. The 6x9 cell is the real constraint, so what matters is whether your pixel height divides into the cell with room for ascenders and descenders, not whether it's a round multiple of 8. I ran a 7 px cut on a similar panel and it looked fine, just tighter line spacing. The pt-to-px math is a convenience, not a rule the font enforces. Also on the variable axes, one thing the replies skipped: some converters let you name the instance file, so bake two versions, normal and bold, and keep both in flash. Costs a few KB and saves a reflash when you change your mind about the look.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required