3
7400
166d

I'm creating a bitmap font right now and wanted to automatically generate a image with some text so I can track my progress how it looks. gnome-font-viewer displays it fine, but it'd nothing compared to some real text. Well, how hard can it be?

First attempt: Use ImageMagick to create an image and draw some text. I found a forum post in the ImageMagick forums from 2017 claiming incorrect rendering of BDF fonts, which was promised to be fixed. Yet convert does exactly nothing besides saying “couldn't read font”.

Looking around, there is exactly one tool for the job I'm looking to get done: pbmtext. It works, but doesn't support Unicode. Egh.

Maybe I could write a short script to do it, then? Python's Pillow can import Bitmap fonts (cairo can't). Halfway done I notice it can't deal with anything outside of the character range 0..256.

Using FreeFont directly is out of the question as that seems to be equally much work as creating the font in the first place. I briefly tried SDL, but the font formats it understands are limited.

So how about converting the font then, you ask? Everyone seems to be only concerned about the other way (like OTF to BDF). I tried loading the font into FontForge and exporting an OTF or TTF but couldn't get anything out of it that ImageMagick recognizes as a font.

It seems fucking impossible to render text to an image with an Unicode BDF font in some automated way.

To add insult to injury, my searches containing “bdf” are always interpreted as with “pdf”. I'm not even a Franconian, I can distinguish B and P!

Comments
  • 3
    No idea about any solution, but as far as the search queries go, try "bdf" -pdf 🙂
  • 0
    otf fonts are as far as I know vector based. Old TrueType (ttf) fonts used bitmap. But generally speaking bitmap fonts are not common anymore today.
    So you may want to use inkscape or Adobe Illustrator to draw the letters. And use some Font programm to create the font.

    Proffesional type designers use www.fontlab.com but that software costs $450

    The newest font tech is variable fonts which only uses one font file and is stylized by css. https://monotype.com/resources/...

    Also brand new are SVG Fonts othewise also kown as Color Fonts which can get quite wild because the behavior of the font is programmable and can contain multiple colors per character.
    https://creativemarket.com/blog/...
  • 1
    @Condor: "bdf" alone seemed to help (at least with DDG, Google seems to remove more and more features in that regard) but it's still annoying when you instantly forget about it again and only notice it with the next search.
  • 1
    @heyheni: I actually want a bitmap font, so that's completely fine. FontForge offered something when exporting which sounded like generating a vector outline automatically. I didn't want to spend much time on this, though, so I didn't look to closely into it.
Your Job Suck?
Get a Better Job
Add Comment