Expand description
Font matching, and the platform’s own typeface for a family.
select_face is the one matcher — CSS Fonts Module Level 4 §5.1
“Localized name matching” and §5.2 “Matching font styles” over a list of
face descriptions — and needs no font database, so it is compiled
unconditionally. Behind the system-fonts feature, system_face runs
it over the system font database, loaded once per process, and returns
the chosen face’s bytes; on macOS the system UI font is found by its file
through Core Text, because no font database files it under the name the
platform documents. system_face substitutes no family; substitute_family,
behind the same feature, names the family the platform draws in place of
one it has no face of — on Linux and the other fontconfig platforms,
fontconfig’s best match, which system_face then finds by name.
Structs§
- Face
Traits - What
select_faceknows about one candidate face. - System
Face - A face
system_facechose: its bytes, and what fontdb records for it.
Functions§
- is_
macos_ system_ mono_ family - Whether
familynames the macOS system monospaced font: caselessly equal to “SF Mono”, the name the platform facts give+monospacedSystemFontOfSize:weight:(docs/platform-facts.md:65) and the macOS presets state. The font’s family name is.AppleSystemUIFontMonospaced, as macOS 26 reports it (docs/evidence/os-probe/2026-10-11-run-38129819806/os-probe-macos-26/probe.toml:162); whether “SF Mono” is a family name a font database holds stays open there. A pure predicate, on every platform, with no font database: the gpui connector asks it to map the family to that face, as it mapsis_macos_system_ui_family’s. - is_
macos_ system_ ui_ family - Whether
familynames the macOS system UI font: caselessly equal to “SF Pro”, the name the platform documents for it (docs/platform-facts.md:63-71) andmacos-montereystates. A pure predicate, on every platform, with no font database:system_face’s macOS branch asks it beside its Core Text family comparison, and the gpui connector asks it alone to map the family to gpui’s own alias. - select_
face - The index in
facesof the face CSS Fonts Module Level 4 selects forfamily,weightandstyle, orNonewhere no face recordsfamily. - substitute_
family - The family the platform draws in place of
family, orNonewhere the platform has that family, gives no answer, or its fallback is not implemented here. - substitute_
family_ cached substitute_family’s answer forfamily, asked of the platform once per family and kept for the process, so a caller may ask every frame.- system_
face - The system’s own face for
family,weightandstyle, orNone.