Skip to content

Scripting FontLab

A year at a small type studio, told one script at a time.

This book teaches you to write Python scripts for FontLab 9. You do not need to know Python. You do not need to know much about FontLab, or about how fonts work inside. The book explains all three as it goes, in plain English.

You learn by doing small jobs. Each chapter starts with a chore that a type designer meets in a normal week: count the glyphs, find the empty ones, copy the spacing from one letter to twenty others, build the accented letters, check the kerning, export the family. You write a short script that does the chore. By the end of the chapter the script works and you keep it.

The studio in this book

The chapters follow Halfmoon Type, a studio of three people, through a year of work on one typeface. The studio and its people are invented. I made them up so the chores have a setting and a deadline. FontLab, Python and everything the scripts do are real.

On your screen, the studio's typeface is played by GG Plum, a free font you can open and change without risk. Chapter 1 shows you where to get it.

How the book is built

There are seven parts with twenty chapters each.

  1. First words. You run your first line of Python and learn to ask a font questions.
  2. A toolbox. You collect your own functions and learn to change a font safely.
  3. Shapes. Contours, nodes, drawing, components, anchors and accented letters.
  4. Space. Sidebearings, widths and kerning.
  5. Words. Glyph names, Unicode, OpenType features and Font Info.
  6. Families. Masters, interpolation, export, proofs and checks.
  7. Tools. Windows, panels, menus, packages and sharing your work.

Read the parts in order the first time. Later chapters use the scripts you wrote in earlier ones.

This book is being written

Chapters appear in the menu as they are finished. A chapter that is not in the menu does not exist yet.