Eli Heuer’s Blog


Fontmake Basics: Compile Fonts from Sources

Fontmake is a command line tool for compiling font files. This post is intended as a simple beginner's guide to using the software.

First, make a new venv, this is where you will install Fontmake, where you put the venv is up to you, anywhere works. Make a new venv with the command: python3 -m venv type-tools. Then start the venv with: source type-tools/bin/activate, you can deactivate the venv at anytime with: deactivate.

Next, we want to clone the repo and install it in editable mode. This will allow us to make changes to Fontmake as we work. Find a directory to keep the repo, something like ~/Type/Tools/, then use git clone to get the latest master branch from GitHub. Enter the following commands:

git clone https://github.com/googlei18n/fontmake.git
cd fontmake
pip install -e .
pip list

pip list should give you all the dependencies installed with pip, plus fontmake installed in editable mode, something like this:

booleanOperations (0.8.0)
compreffor (0.4.6)
cu2qu (1.5.0)
defcon (0.5.1)
fontmake (1.5.0.dev0, .../Type/Tools/fontmake/Lib)
fontMath (0.4.4)
fonttools (3.26.0)
glyphsLib (2.3.0)
MutatorMath (2.1.0)
pip (9.0.1)
pkg-resources (0.0.0)
pyclipper (1.1.0)
setuptools (32.3.1)
ufo2ft (1.1.0)
ufoLib (2.1.1)

Fontmake should be all set up and ready to use now.

Now we need a font repo to try it on. I'm using github.com/eliheuer/woodbine.git, but use any source file you want.

Navigate to the directory with the .glyphs or .ufo source file. The most basic use of fontmake will look something like this:

fontmake -u Woodbine-Regular.ufo

This will output two directories in your current working directory, probably named master_otf and master_ttf, each containing an output font file. If we want to just output one format, we can just enter fontmake as a command and we will see the -o option allows us to specify an output format. For example, try outputing just a .ttf file:

fontmake -u Woodbine-Regular.ufo -o ttf

This will output a directory called master_ttf in the same directory as the source file.

That's it for basic use, I will add some more advanced use cases soon.


Contact


Tags


Source Code


Licensing

Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-ShareAlike 4.0 International (CC_BY-SA 4.0) license.

Except where otherwise noted, all source code on this blog is licensed under the GPLv3 License.

© 2018


Feeds

Atom

Tux

This site was built with free software.