Fonts and inheritance
Loading interactive example…Open in new tab ↗
Choose a drawing default to compare the four bundled Google Fonts. The card titles, card bodies and connector label inherit the default. The standalone caption explicitly uses IBM Plex Mono, so changing the default preserves it.
DrawingConfiguration.supportedFonts supplies one catalog to all text inspectors. defaultFontFamily applies to runs without an explicit family. Changing this host configuration does not rewrite the document's runs or add a document undo entry. The host must load the fonts; a catalog entry alone does not download a font. This example uses font assets already bundled with the examples app.
See Configuration and Text.
Source
dart
const exampleFonts = [
DiagramFontFamily(family: 'IBM Plex Sans', label: 'Sans serif'),
DiagramFontFamily(family: 'IBM Plex Serif', label: 'Serif'),
DiagramFontFamily(family: 'IBM Plex Mono', label: 'Monospace'),
DiagramFontFamily(family: 'Shantell Sans', label: 'Handwritten'),
];