Font Combining


When creating a Rockbox theme, you’ll often have a font you’re set on using that doesn’t support many languages. It’s not difficult however to go about adding support for other languages to these fonts by combining them with one that does. This guide goes over how to do that for vector and bitmap fonts, while also showing you how to convert them for use with Rockbox.


A desktop running fontforge.

Combining Two Fonts using Fontforge

There’s more than a few different apps for combining and modifying fonts, I know glyphs is quite popular especially with professionals, however this guide is around my own setup which is Linux focused. Fontforge is the best tool in this space for Linux, and it’s perfectly equipped for our needs combining fonts. There’s a few minor differences between working with bitmap fonts and vector fonts, so I’ve divided them into their own sections below.

Combining .otf and .ttf Fonts

Firstly, you’re going to need a font to add to your base font. I created a fork of NotoSans called MicroNotoSans designed to provide maximum language coverage with minimum size. It’s modular so you can choose which languages you need if you want to save even more space.


Combining .bdf Fonts

Again, you’re going to want a font to combine with your base font. I don’t have any Font recommendations, but Rob Hageman’s bitmap font hoard might be of use.



Making Rockbox Fonts

Rockbox uses it’s own, custom font format for it’s interface. Therefore it’s necessary to convert our fonts for use in themes. This process is slightly different for colour and monochrome models, the former allowing anti-aliasing and the latter using exclusively bitmaps fonts. For the moment I’ve focused on the non-bitmap conversion process.

Getting convttf

If you don’t already have the convttf tool, then you’ll need to build it from the source using the following guide.


Convert OTF or TTF files with convttf

Convttf is used via the command line, and I find it useful to move the executable into the directory of fonts I’m working with. The executable can be used like the following.

/convttf -p 16 -c 1 fontfile.ttf

Notes


Converting bdf files with convbdf

Convbdf is specifically for working with bitmap fonts. Again, I recommend keeping it in your /bin folder if you’re on Linux and will use it more than once. There’s a lot less control here (though you don’t really need it) Most of the times you can simply use it like this:

/convbdf -f 16-fontfile.bdf

Notes