Glyph Construction is a language for describing how glyph shapes are constructed. It makes it possible to create new glyphs by adding multiple glyphs as components, with options for positioning each component in relation to the base glyph and to any other component.

The Glyph Construction syntax is simple and human-readable, and yet very powerful.

Glyph Construction is also an open-source Python library for parsing Glyph Construction recipes and building glyphs. It is embedded in RoboFont 3 and ready to use in your scripts. RoboFont 1 users can install it separately.

Glyph Construction extension

Glyph Construction is also available as an extension and can be installed in RoboFont 3 via Mechanic 2. The extension includes the library and the Glyph Builder interface for previewing and building glyphs using the Glyph Construction language.

RoboFont 1 users can download and install the extension manually.

Creating new glyphs with Glyph Builder

Once the Glyph Construction extension is installed, you can open the Glyph Builder from the Extensions > Glyph Construction menu:

The Glyph Builder’s interface includes the following components:

Toolbar

The toolbar at the top of the window contains icons for triggering actions:

option description
Save Save all rules as a .glyphConstruction file.
Open Open an existing .glyphConstruction file.
Update Update the contents of the Preview and Analysis columns.
Analyse Show/hide the Analysis column.
Build Glyphs Build all described glyphs in the current font.
Build Build only the selected glyph.
Rules
The left column contains a simple text editor where glyph construction rules are written, one per line. See the included documentation for an overview and examples of the Glyph Construction syntax.
Preview

The middle column shows a preview for every glyph defined in the first column.

The glyph display is provided by same MultiLineView component used by the Space Center, and supports zooming in/out with ⌘ +/- keys or with the mouse.

Individual glyphs can be selected with a click. See Preview selected (below).

Analysis
The right column displays useful information about all glyphs defined in the first column: missing glyphs, existing glyphs, existing glyphs with missing components, and existing glyphs with different components.
Preview selected

Displays a preview of the glyph which is currently selected in the Preview area.

If the glyph already exists in the font, its current shape is displayed in the background, in red.

Status bar
The status bar at the bottom of the window shows some information about the selected glyph: glyph name, width, left & right margins, component names, unicode, mark color, and note.

Glyph Construction examples

Accented glyphs

The example below shows a real-world application of Glyph Construction syntax for adding accented glyphs to an existing font.

aacute = a + acute@center,top | 00E1
abreve = a + breve@center,top | 0103
acircumflex = a + circumflex@center,top | 00E2
adieresis = a + dieresis@center,top | 00E4
aeacute = ae + acute@center,top | 01FD
agrave = a + grave@center,top | 00E0
amacron = a + macron@center,top | 0101
aogonek = a + ogonek@ogonek,origin | 0105
aring = a + ring@center,top | 00E5
aringacute = a + ring@center,top + acute@center,top | 01FB
atilde = a + tilde@center,top | 00E3

See the examples folder included the repository for the complete list of glyph construction rules for accented glyphs.

Modular glyphs

The following example shows a more experimental use of Glyph Construction, for creating modular shapes. It demonstrates the construction of a new glyph o out of multiple copies of a pixel glyph.

o = pixel + pixel@center,top + pixel@center,top + pixel@center,top + pixel@right,top + pixel@right,center + pixel@right,bottom + pixel@center,bottom + pixel@center,bottom + pixel@center,bottom + pixel@left,bottom + pixel@left,center

In order to try out this example, create a font containing only one glyph named pixel, and draw a simple shape inside it:

f = NewFont()
f.newGlyph('pixel')
pen = f['pixel'].getPen()
pen.moveTo((0, 0))
pen.lineTo((0, 100))
pen.lineTo((100, 100))
pen.lineTo((100, 0))
pen.closePath()
Last edited on 12/03/2019