How to Use GPOS Lookup Tables in FontForge

This article provides a concise overview of OpenType Glyph Positioning (GPOS) lookup tables and explains how to create, configure, and apply them using FontForge. You will learn the fundamental purpose of GPOS within font engineering, the distinction between lookups and subtables, and step-by-step instructions for implementing pair positioning (kerning) and mark-to-base positioning in your font projects.


What Is a GPOS Lookup Table?

The GPOS (Glyph Positioning) table is an OpenType layout table that defines precise spacing, shifting, and alignment between glyphs without altering their identities. Unlike the GSUB (Glyph Substitution) table, which replaces glyphs (such as creating ligatures), GPOS adjusts horizontal and vertical coordinates dynamically.

A GPOS table is organized into a hierarchy:

  1. Features: User-facing behaviors or language requirements defined by four-character tags (e.g., kern for kerning, mark for diacritic placement).
  2. Lookups: Individual processing units linked to a feature that define how positioning should be calculated.
  3. Subtables: Specific datasets within a lookup containing glyph pairs, anchor points, or positioning offsets.

Common GPOS lookup types include:

  • Single Adjustment: Modifies the advance width or placement of an individual glyph.
  • Pair Adjustment: Adjusts the distance between two specific glyphs (the foundation of kerning).
  • Mark-to-Base: Aligns combining marks (such as accents) onto base glyphs using coordinated anchor points.
  • Cursive Attachment: Connects adjacent glyphs seamlessly in connected scripts like Arabic.

Step-by-Step: Creating a GPOS Kerning Lookup in FontForge

Pair kerning is the most common use of GPOS in FontForge. Follow these steps to implement a horizontal kerning lookup:

1. Open the Lookups Window

  1. Open your font project in FontForge.
  2. Go to Element > Font Info from the top menu.
  3. In the sidebar, select Lookups, then click the GPOS tab at the top.

2. Add a New Lookup

  1. Click the Add Lookup button on the right side.
  2. In the Type dropdown, select Pair Position (kerning).
  3. Under Feature, select or type kern (Horizontal Kerning).
  4. Set the script and language systems (typically latn with default language, or select specific scripts as needed).
  5. Leave the lookup name as generated, or assign a descriptive name. Click OK.

3. Add a Subtable

  1. Select the newly created lookup row.
  2. Click Add Subtable.
  3. Choose whether to kern by individual pairs (manual pairs) or by classes (grouping visually similar glyphs like O, C, G, Q to save file size).
  4. Name the subtable and click OK.

4. Define Kerning Values

  • If using Classes: Define your left-hand and right-hand glyph classes, then input kerning values in the matrix view.
  • If using Individual Pairs: Use Metrics > New Metrics Window from the main FontForge interface. Type your target character pairs (e.g., AV, To), drag the spacing manually between them, or enter a numeric kerning offset in the kerning field. FontForge automatically updates your GPOS subtable.

Implementing Mark-to-Base Positioning

To anchor accents dynamically over letters:

  1. Navigate to Element > Font Info > Lookups > GPOS.
  2. Click Add Lookup and choose Mark to Base Position as the Type.
  3. Assign the mark feature tag, select your target script, and click OK.
  4. Select the lookup and click Add Subtable.
  5. Define anchor classes (e.g., top for accents placed above letters).
  6. Open your base glyphs (such as e) and mark glyphs (such as acutecomb), then go to Point > Add Anchor to assign coordinates where the mark and base should attach.

Validating and Generating

Once your GPOS lookups are configured:

  1. Preview your rules directly in FontForge using Metrics > New Metrics Window.
  2. Toggle OpenType features on and off within the Metrics window via the Features menu to ensure your GPOS tables behave correctly.
  3. Generate your font via File > Generate Fonts, ensuring you export as an OpenType format (OTF or TTF) to retain the compiled GPOS binary data.