render/fonts library

Classes

FontAxisRange
One variation axis of a bundled variable font: [min, max], default.

Enums

BundledFont
Fonts a theme may use. id is the stable string stored in a ThemeSpec's TypeSpec; family is the pubspec family name (null = platform default).

Constants

bundledFontAssets → const Map<String, String>
Asset paths of the bundled fonts, keyed by pubspec family name. Mirrors this package's pubspec.yaml fonts:; widget tests load them with a FontLoader (see the README).
bundledFontLicenses → const Map<String, String>
Licence files of the bundled fonts, keyed by pubspec family name.
devanagariFontFamily → const String
Noto Sans Devanagari (variable wght 100–900, Devanagari-only subset; assets/fonts/README.md): the bundled fallback that renders Hindi amount words at the same size and weight as the Latin text around them, instead of the platform's lighter Devanagari face. Not a theme font: it is only ever a scriptFallbackFonts entry.
fontPackagePrefix → const String
Fonts declared in a package's pubspec are registered under packages/<package>/<family>; every family name here carries it, so apps get the fonts with no fonts: section of their own.
scriptFallbackFonts → const List<String>
fontFamilyFallback for every display, amount, history, settings and key-label style: what the theme fonts lack (Devanagari, the scientific symbols) resolves to bundled faces before the platform's. Weight follows the style's wght variation / fontWeight.
symbolsFontFamily → const String
CalseeSymbols (m7-design D14; assets/fonts/README.md): the glyphs the theme fonts lack, from Noto Sans, Noto Sans Mono and Noto Sans Thai, variable in wght 100–900. It has every super- and subscript (U+2070–209F, ¹ ² ³), ʸ ˣ, √ ∛ ∞ π µ μ and the Currency Symbols block (₹ ₨ ₩ ₽ ₺ ₫ ₦ ₱ ₪ …) plus ฿, and nothing else: no digits, letters or spaces. Not a theme font: it is a scriptFallbackFonts entry, and key labels draw their super- and subscript runs in it (symbolRunStyle).
symbolsFontWeight → const FontAxisRange
CalseeSymbols' wght axis (its only axis).
tabularFigures → const List<FontFeature>
tnum only.

Functions

cssFontWeight(int css) → FontWeight
css (clamped to 100–900) as a FontWeight: exact on Flutter 3.38+, which has arbitrary weights (variable wght); the nearest of FontWeight.values on older Flutter. FontWeight(int) doesn't exist there, but FontWeight.lerp does, and is exact where weights are.
isSymbolRunRune(int rune) → bool
Whether rune is a super- or subscript that labels draw in CalseeSymbols as a run (symbolRuns): ² ³ ¹ (U+00B2, B3, B9), ʸ (U+02B8), ˣ (U+02E3) and U+2070–209F. Fallback is chosen glyph by glyph, so sin⁻¹ would otherwise mix a fallback ⁻ with the family's own ¹, and x² would not match a fallback xʸ beside it.
nearestFontWeight(double weight) → FontWeight
The FontWeight closest to a CSS weight (clamped to 100–900).
symbolRuns(String text) → List<({bool symbols, String text})>
text cut into its runs of isSymbolRunRune characters and the text between them, in order: sin then ⁻¹ (symbols) for sin⁻¹. Empty for an empty text.
symbolRunStyle(TextStyle style) → TextStyle
The style of a symbol run inside a span styled style: CalseeSymbols at style's weight (its wght variation, else its fontWeight); size, colour and the rest are inherited from the span.
withScriptFallback(TextStyle style) → TextStyle
style with scriptFallbackFonts (kept when it already names some).