Glyph Classes
A glyph class gives a reusable name to a set of glyphs in feature code. It can shorten a rule, describe its surrounding context, or provide one side of a positionally matched substitution. Those uses require different kinds of care about membership and order.
Classes as Substitution Inputs
A FEA glyph class has an @-prefixed name. For example:
@Lowercase = [a b c];
@SmallCaps = [a.sc b.sc c.sc];
When used in a class-to-class single substitution, the first member of one class maps to the first member of the other, the second to the second, and so on. Equal counts are necessary, but the order must also express the intended correspondence.
FontLab can supply FEA classes from four sources:
| Source | Authoring role |
|---|---|
| OpenType classes | Explicit ordered glyph lists shared by the font. |
| Kerning classes | Master-related groups used for kerning, also available to feature code when included. |
| Tags | User-assigned memberships converted to name-sorted glyph lists. |
| Virtual tags | Generated memberships based on glyph properties. |
OpenType classes preserve your explicit member order. Tag-derived lists use glyph-name ordering. That can help align base names and suffixed names, but it is not an automatic proof of correspondence. A missing alternate shifts later pairings, and unrelated names can sort into positions that look plausible but are wrong.
For a contextual test, only membership may matter: “the preceding glyph belongs to this set.” For a class-to-class replacement, position matters too. Inspect the classes according to the rule that uses them.
These classes are not GDEF glyph-definition roles. An @MarksToTest authoring class does not assign its members the GDEF Mark role; that role is separate font data.
Building OpenType Classes
Open Window > Panels > Classes and choose the OpenType class type. Create a class with the class-list + control, give it a clear name, and add the intended glyphs. Keep its purpose in the name, such as LowercaseForSmallCaps, rather than using a name whose meaning changes from rule to rule.

The class filter separates OpenType classes from left and right kerning classes, tags, and virtual tags.
Select the intended glyphs in the Font window and use the class’s member-add control to add them. Remove a selected member with the member-removal control; removing it from a class is different from deleting the glyph from the font.
The panel offers Preview, Table, and List views. Use Preview to inspect the drawings, Table to compare corresponding positions across classes, and List to review exact names and reorder members. A visual overlap does not replace checking the list order used by the feature.
Build a corresponding pair
- Create an OpenType class containing the source glyphs in a deliberate order.
- Create the replacement class in the same design order.
- Compare member counts and each corresponding pair.
- Compile the rule that uses them and test every pair, including the first and last entries.
- Recheck after adding or deleting a glyph from either class.
Use Select glyphs to select class members in the Font window. The reverse selection control finds classes or tags containing the glyphs already selected there. These provide useful checks when a rule unexpectedly affects an extra glyph.
Transfer and consolidate classes
The panel's copy/paste and Copy Classes From workflows can transfer definitions between open fonts. Review same-name conflicts: replacing a class, appending members, and creating another name have different effects on dependent rules.
OpenType classes are font-level, so changing the current master does not create another independent OpenType-class list. Master-to-master copying is particularly relevant to the kerning classes taught in Preparations; do not duplicate shared substitution classes merely to make them appear in another master.
Use Import Classes… and Export Classes… for file exchange. The FontLab classes JSON format carries richer current data, while legacy class formats have narrower scope. Inspect imported names, memberships, order, and missing glyph references before compiling.
To consolidate several sets, select their glyphs, add that union to the intended destination class, and review its order. Remove obsolete class definitions only after updating the feature references that use them. A merged membership set may be suitable for context testing but unsuitable as one half of a positionally matched substitution.
Virtual Tags and Including Classes
The Features panel's Include Classes submenu controls which panel data is exposed to the compiler. The usual defaults include OpenType classes and Tags, while Kerning and Virtual Tags require explicit inclusion for this use. Check the actual settings in the project rather than depending on a remembered default.
The kern-generation workflow has its own use of kerning classes. Turning off their general inclusion does not mean that class kerning disappears from generated kerning data.
Useful virtual sets include:
| Group | Examples |
|---|---|
| Content | @ALL, @blank, @noblank |
| Construction | @auto, @composite, @noncomposite, @references |
| Variation status | @match, @nomatch |
| Script | @latn, @cyrl and other available script sets |
| Case/style | @uc, @lc, @sc |
@ALL excludes .notdef. Content-based blank/nonblank sets describe glyph content, not Unicode word-breaking rules; their contextual use is developed in Contextual Substitution. Case and script sets also need inspection for alternates, unusual names, and unencoded glyphs. Treat them as generated starting points, not unquestionable classifications of every design.
Included classes can be available to compilation without appearing as handwritten PREFIX definitions. Import Classes and Tags can materialize the selected kinds of definitions in source. Avoid creating a second manual definition of an already supplied name accidentally.
Same-named memberships can be combined during class collection, including data from tags and virtual tags. Do not rely on a manually named class automatically suppressing every generated set with that name. Duplicate-class warnings deserve attention: a spelling collision can change the set a rule sees. Prefer distinct names and inspect the effective class instead of relying on collision behavior to organize a project.
You can also drag glyph cells into the Features editor. A normal drop inserts names; Alt-drop inserts a bracketed inline class. Use the editor's go-to-glyph/class command (Cmd+L on macOS) to inspect a named set. Custom and virtual tags are the grouping mechanism introduced in Tagging Glyphs.
After changes to glyph properties, update the relevant generated data and recompile. If you have materialized classes into an autofea block, update that block too. A stale text snapshot is not the same as a current property-based membership.