openTypeFeatures
OpenType features that have been explicitly enabled or disabled.
Supported on:
Signature
openTypeFeatures: { readonly [feature in OpenTypeFeature]: boolean} | figma.mixed [readonly]
Remarks
The Details tab in the Type settings panel shows all the OpenType features that are available for the current font.
This property gives you a map of four-character OpenType features to booleans indicating whether the features are explicitly enabled or disabled. For example, if the map contains { CALT: false }
, then the "Contextual alternates" feature is disabled.
This map only contains features that diverge from their default values. Some OpenType features are enabled by default and some are disabled by default. For example CLIG
and LIGA
are on by default, whereas LNUM
and TNUM
are disabled by default.
Here are some useful resources for learning about OpenType features:
- An ode to OpenType [Figma blog]
- OpenType feature tags [Microsoft]
- OpenType font features guide [MDN]
- OpenType Features in CSS [Sparanoid]
// For a node that uses the Inter font with
// "Contextual alternates" disabled (shows -> instead of ➔):
// { CALT: false }
console.log(figma.currentPage.selection[0].openTypeFeatures)