FontForge Arabic and Devanagari Shaping Tables
FontForge can generate the OpenType shaping tables required for complex text layouts such as Arabic and Devanagari. By utilizing FontForge’s OpenType layout tools, type designers can build the necessary Glyph Substitution (GSUB) and Glyph Positioning (GPOS) tables to correctly render connected cursive letters, ligatures, conjuncts, and mark-to-base attachments. While the software provides native interfaces to configure these tables, the workflow differs between Arabic and Devanagari due to the inherent structural requirements of each script.
Understanding Complex Script Shaping
Digital rendering of complex scripts relies on an external shaping
engine (such as HarfBuzz) reading the instructions compiled inside the
font's OpenType tables. The font does not perform the shaping itself;
instead, it provides the shaping tables that tell the rendering engine
how to substitute isolated characters with contextual forms and position
diacritics or marks. FontForge compiles these instructions directly into
standard TrueType (.ttf) or OpenType (.otf)
output files.
Arabic Shaping in FontForge
FontForge provides built-in support for basic and advanced Arabic typography:
- Positional Forms: FontForge can automate the
creation of lookup tables for the four primary positional features:
Initial (
init), Medial (medi), Final (fina), and Isolated (isol). Standard Arabic glyph naming conventions allow FontForge to detect and map these positional variants automatically. - Ligatures: Mandatory ligatures, such as Lam-Alef,
and aesthetic ligatures are handled via the Standard Ligatures
(
liga) and Discretionary Ligatures (dlig) lookup features. - Mark Attachment: Diacritics (Harakat) are
positioned using Mark-to-Base (
mark) and Mark-to-Mark (mkmk) lookups, which can be defined visually using FontForge's anchor point interface. - Cursive Attachment: FontForge supports the
cursfeature, allowing designers to set entry and exit anchors on cursive glyphs so they connect seamlessly at varying vertical alignments.
Devanagari Shaping in FontForge
Devanagari belongs to the Indic family of scripts, which relies on a strict shaping model to handle consonant conjuncts, half-forms, reordering of pre-base vowels (such as I-matra), and syllable composition.
Unlike basic Arabic glyph mapping, FontForge does not offer a single "one-click" automatic generator for the entire Devanagari shaping pipeline. However, it provides full structural support for the necessary OpenType Indic tags:
- GSUB Features: You can define substitutions for
Nukta forms (
nukt), Akhand ligatures (akhn), Reph forms (rphf), Rakar forms (rkrf), Below-base forms (blwf), Half-forms (half), Above-base substitutions (abvs), and Post-base substitutions (psts). - GPOS Features: FontForge handles the precise attachment of vowel signs and nasalization marks through standard mark positioning tables.
Because the Indic shaping engine handles glyph reordering, the tables
within FontForge must accurately reflect the targeted OpenType
specification (such as the deva or dev2 script
tags).
Recommended Workflow: Adobe Feature Files (.fea)
While FontForge has a graphic interface for lookups via Element > Font Info > Lookups, managing intricate contextual substitutions for Devanagari and complex Arabic scripts directly within the user interface can be tedious and prone to human error.
The most efficient method to generate shaping tables in FontForge is
using Adobe OpenType Feature File (.fea) syntax:
- Write or generate your shaping rules, feature tags, and lookup
hierarchies in a separate
.featext file. - In FontForge, navigate to File > Merge Feature
Info... and select the
.feafile. - FontForge imports these rules into its internal database and compiles them into valid OpenType tables upon font generation.
FontForge is fully capable of producing production-ready Arabic and Devanagari fonts, provided the designer supplies the required glyph variants and appropriately defined OpenType lookup tables.