Bitfont

View project on GitHub

Built as an alternative to Minecraft’s crude text rendering implementation, Bitfont seeks to bring an advanced typesetting engine as well as a vastly improved character set to Minecraft. Bitfont is designed to be front-end independent, meaning Bitfont handles positioning each character, and each rendering implementation (be it LWJGL in Minecraft or JImGui in the Bitfont editor) simply draws those characters onto the screen.

Minecraft’s native text layout is crude to say the least. It consists of stringing together sprites from a fixed 8×8 pixel grid, one after the other, doing some basic text wrapping, and calling it a day. Minecraft’s font also only covers the Latin alphabet, and common punctuation, along with a few miscellaneous other symbols, anything else falls back on Unifont, which then gets rendered at half scale, leading to major artifacting at non-even scales and being simply unreadable at 1x scale.

To fix these issues I had to do two things: First, I had to make a render engine that was smarter than just “chain together quads”, and then I had to expand Minecraft’s font so it wouldn’t rely so heavily on Unifont. After a long time working on it and even more researching, I created a prototype layout engine with support for variable glyph sizes and positions (no more stringing quads end to end), basic kerning, and combining characters. Along the way as I researched type design I expanded Minecraft’s default font to support over 1,400 glyphs, chosen by using this site to find the most-spoken languages with characters I thought I could pull off, in addition to some that are just useful, such as arrows, box-drawing characters, and shapes.

After finding documentation relating to Apple’s typesetter, I’ve started to rewrite and expand Bitfont’s prototype typesetter to be more robust, extensible, and much more powerful. Some notable features are simplified pagination, the ability to easily place objects in the text layout and have the text wrap around them.

Beyond a typesetter and font, one of the long-term goals of the project is to create a reasonably generic (rich) text editor that implements platform-appropriate text controls, meaning it should behave like a native text control on both macOS and Windows (and Linux, as much as possible).