Skip to content

API reference / Common / Engine types / TextFont

Type Alias: TextFont ​

ts
type TextFont = 
  | {
  named: {
     name: string;
     pitchFamily?: number;
     charset?: number;
  };
}
  | {
  theme: {
     collection: ThemeFontRef;
     script: ScriptCategory;
  };
};

A span's typeface reference — a concrete face name or a theme font slot.

The four per-script slots on TextCharacterProperties (font_latin / font_east_asian / font_complex / font_symbol) each hold one of these. A theme ref (a:latin@typeface="+mn-lt") names the minor (body) or major (heading) font of the theme's a:fontScheme, and which script's face of that collection. A plain String would drop the ref, pinning the resolved name at import — keeping Theme lets a document re-resolve when its theme changes.