Drawing bitmap fonts

My 8-bit machine is dumping its output to the console at the moment. This isn't much of a problem for the type of person who believes using a command line debugger is a marvelous experience, but I'm not targeting such mythical creatures with this project, so I'll need to do some proper text rendering.

I say proper, but that's a lot of work and I'm just building a prototype here. No need to make this complicated: I'll just use a bitmap font.

Pixel by pixel

The first thing I need when rendering a bitmap font is a bitmap font and me being me, I decide to draw my own. It's time consuming, but it's also pretty fun. You should try it. No really, those characters aren't images; they're pixel editors. Go ahead, draw uppercase, draw lowercase, draw numbers, draw symbols.

Scaling up

Not so bad, is it? The only downside is that the result is tiny. An obvious solution is to create larger characters, but surprisingly, that makes drawing them much harder.

Anti-aliasing

My results always look either too bold or too thin. They're also pretty chunky, but that's pixels for you. It's called aliasing and it's what you get when you deal with pixels that can only be black or white. But by using shades of grey, you can make lines look smoother. This is called anti-aliasing and it takes some practice.

The easy way out

Good grief, that's a lot of work! Turns out anti-aliasing by hand isn't easy. Not that I mind, but this was supposed to be the shortcut to text rendering. Maybe I'd better take a shortcut to the shortcut. I'll just use an existing font and let my bitmap editor draw the characters at the desired size.

It took a while to align all the characters to the grid, but I do have a full set of anti-aliased characters now. When I say full set, I'm clearly ignoring accented characters and ligatures and Greek and Cyrillic and Chinese and Korean and well, basically any language but English, but I only need to draw registers and memory contents, and I don't expect a high demand for localizing hexadecimal values, so this should be fine.

Next time

So, I spent a little more time on this than necessary. At least I can put text on the screen now. Except that I can't. I have a font, but no way to render it yet. I guess this is going to take a little while longer.