Country Geofont
Tue 10 May 2022For no good reason, I started looking into fonts yesterday, and stumbled upon FontForge. It's pretty neat, complete with a nice GUI for crafting character glyphs to your heart's content, and a Python scripting environment which you can use to automate the process.
[Minimal research follows, so take my wording with a grain of salt] Each glyph is a set of points and splined contours, which you can draw using a glyph pen. As a geographically inclined person, my first instinct was to create a font in which each character glyph represents a geographic feature, in this case, countries.
I used Natural Earth 1:110M Admin 0 - Countries. You can see the script I used here.
There are instructions for Python scripting here, however I could not work out how to actually install or interact with the Python module using those docs. I installed the GUI from here, which may or may not install the Python bindings. I also installed the Homebrew formula, which seems to enable the fontforge
command.
My method for creating the font was:
- Install third party Python modules to the script directory (e.g.
pip install -t . shapely numpy
) - Write the script.
- Create a new, empty
sfd
font in the FontForge GUI. - Execute the script:
$ fontforge -script geo_font.py
. - Bask in the glory of the new font.
I saved the sfd
font to ttc
within FontForge GUI and was able to install on my Mac. It behaves like any other font:
The entire font sheet looks like this:
That's it! Get in touch with me on Twitter if you want to talk more about geographic fonts!