Version 1, Update 138
Variable fonts
The Plugin API now supports variable fonts. Reading FontName on a variable font includes variationSettings with every OpenType axis the family defines. Pass those values when setting a font to override specific axes; omitted axes keep the named instance's defaults.
You can omit style when loading or applying a font. loadFontAsync({ family }) loads every style of the family. Setting a font without style lets Figma pick the named instance that best matches variationSettings.
New types
FontVariationSettings: Axis values keyed by 4-character OpenType tag, for example{ wght: 550, slnt: -10 }.FontNameInput: A font to apply wherestyleis optional. Reads always return a fully populatedFontName.
New methods
figma.getFontFamilyVariationAxes(family): Returns the axis tags a variable font family exposes, ornullfor a static family.
Updated types
FontName: Added optionalvariationSettings. Present when reading a variable font; omitted for static fonts.
Updated properties and methods
fontName: IncludesvariationSettingswhen reading a variable font. AcceptsFontNameInputwhen writing.loadFontAsync(): AcceptsFontNameInput. Omittingstyleloads every style of the family.setRangeFontName(): AcceptsFontNameInput, includingvariationSettingsand an omittedstyle.