Diacritic Positioning on Base Glyphs in FontForge
Handling diacritic positioning relative to base characters in
FontForge is primarily accomplished through OpenType Mark-to-Base
(mark) positioning features using anchor points, or through
the assembly of precomposed glyphs. This guide covers how to configure
OpenType anchor classes, place anchor points on both base characters and
diacritical marks, fine-tune their alignment, and generate precomposed
accented glyphs for broader legacy software compatibility.
1. Create a Mark-to-Base Lookup
To dynamically place diacritics above or below base characters, you must first define an OpenType GPOS (Glyph Positioning) feature.
- Open your font project in FontForge.
- Go to Element > Font Info.
- Select Lookups from the left-hand menu, then choose the GPOS tab.
- Click Add Lookup.
- Set the Type dropdown to Mark to Base Positioning.
- Under the feature list, select or enter
mark(Mark Positioning). Click OK. - With the new lookup selected, click Add Subtable.
- Name the subtable and click OK. FontForge will then open the Anchor Control window.
2. Define an Anchor Class
Inside the Anchor Control setup, you define the reference points that link base glyphs to mark glyphs.
- In the subtable dialog, click New Anchor Class.
- Name the anchor class based on its placement (for example,
topfor accents above letters, orbottomfor accents below letters). - Ensure the lookup subtable is saved and close the Font Info window.
3. Add Anchor Points to Base Glyphs
Once the class is established, you need to mark where diacritics
should attach to your base characters (such as a,
e, n).
- Double-click a base glyph to open the Glyph Outline window.
- Go to Point > Add Anchor.
- Select the anchor class you created (e.g.,
top). - Set the Type to Base Glyph.
- Click OK. A point marked with the anchor name will appear in the glyph canvas.
- Drag the anchor point to the exact location where you want the diacritic to center or attach (typically centered horizontally above the glyph's x-height or cap-height).
4. Add Anchor Points to Mark Glyphs
You must mirror this process on the diacritic glyphs (such as
acute, grave, tilde, or
cedilla) so FontForge knows which point on the accent
aligns with the base anchor.
- Open the diacritic glyph in the Glyph Outline window.
- Go to Point > Add Anchor.
- Select the corresponding anchor class (e.g.,
top). - Set the Type to Mark Glyph.
- Position the anchor point on the accent where it should meet the base anchor point (for a top accent, this is usually at the bottom-center of the mark).
5. Preview and Fine-Tune Alignment
To verify that the accents align properly across different base characters:
- Open the Metrics window by navigating to Metrics > New Metrics Window.
- Type a base glyph followed by a combining diacritic (e.g.,
efollowed by UnicodeU+0301for a combining acute accent). - Verify that the mark attaches correctly to the base glyph.
- If adjustments are needed, go back to the subtable in Font Info > Lookups > GPOS, select the subtable, and click Edit Subtable to access the visual Anchor Control matrix, where you can nudge anchor offsets for specific glyph pairs.
6. Alternative: Building Precomposed Glyphs
If your font needs to support environments that do not fully
implement OpenType GPOS positioning, build precomposed Unicode
characters (such as é - U+00E9):
- Ensure the base glyph (
e) and the standalone mark (acute) exist in your font. - If anchors are already placed, select the target precomposed slot
(e.g.,
eacute). - Navigate to Element > Build
> Build Accented Glyph (or press
Ctrl + Shift + A). - FontForge will automatically insert references to the base and mark glyphs and position the accent according to the anchor coordinates you defined.