Understanding Anchor Positioning in FontForge
Anchor positioning in FontForge is an OpenType feature mechanism used to define precise, dynamic alignment points between multiple glyphs, most commonly for attaching diacritical marks, stacking multiple accents, and connecting cursive scripts. Instead of relying on manual kerning or pre-composed composite glyphs, anchor positioning relies on X and Y coordinate pairs defined within FontForge’s Glyph Positioning (GPOS) lookups. This article outlines the primary uses of anchor positioning in FontForge, the OpenType features it powers, and how it streamlines font development.
Mark-to-Base Attachment
(mark)
The most common use of anchor positioning is Mark-to-Base
positioning, driven by the mark OpenType feature. In
multi-lingual type design, designing pre-composed glyphs for every
possible character-and-accent combination is inefficient and often
incomplete.
With mark-to-base anchors:
- The base glyph (such as an "a" or an Arabic consonant) is assigned a base anchor point.
- The diacritic (such as an acute accent or umlaut) is assigned a corresponding mark anchor point.
- When the text engine renders the glyphs, it aligns the mark's anchor precisely over the base's anchor, regardless of variable character widths or italic slants.
Mark-to-Mark Attachment
(mkmk)
Certain writing systems—such as Vietnamese, Arabic, Hebrew, and Thai—require multiple accents to stack vertically or align relative to one another rather than directly to the base glyph.
Anchor positioning handles this through the mkmk
OpenType feature. A diacritic receives both an input anchor (to connect
to the glyph beneath it) and an output anchor (to accept another mark on
top of it). FontForge uses these anchor classes to calculate precise
vertical and horizontal stacking without accidental collisions.
Cursive Attachment
(curs)
In cursive typefaces and continuous scripts like Arabic, Urdu, or
connected Latin scripts, adjacent glyphs must join seamlessly across
varying baseline shifts. The cursive attachment (curs)
feature relies on two anchor types defined in FontForge:
- Entry anchors: Positioned on the right or left edge where an incoming stroke attaches.
- Exit anchors: Positioned where the current glyph flows into the next character.
The rendering engine aligns the exit anchor of a preceding glyph directly to the entry anchor of the succeeding glyph, adjusting vertical offsets automatically to ensure smooth connections across continuous words.
Anchor Classes in FontForge
FontForge organizes anchor functionality through Anchor
Classes. Located within the font settings under GPOS Lookups,
an anchor class allows type designers to assign a shared label (such as
Top, Bottom, or Entry) across
multiple glyphs. Once an anchor class is applied:
- FontForge assigns the relative coordinate points inside the glyph editing window.
- The software automatically compiles these coordinates into standard OpenType GPOS tables upon font generation.
- Designers can visually test the positioning directly in FontForge’s Metrics View to verify that marks and joins align across different weights and styles.