Fix Newsreader serif resolution by matching its real family name

The bundled Newsreader.ttf is the 16pt optical-size cut: its TrueType
name-id 1 reads "Newsreader 16pt", and "Newsreader" only appears in
name-id 16. GPUI/cosmic-text matches by name-id 1, so every
.font_family(SERIF_FAMILY) call site (hero headline, settings titles,
plugin pages, recap) was silently falling back to the default sans.
Setting SERIF_FAMILY to "Newsreader 16pt" pins the right font.
This commit is contained in:
2026-05-10 00:45:54 -04:00
parent 2352d4658d
commit 5287fccdec
@@ -9,7 +9,13 @@ const NEWSREADER_ITALIC: &[u8] =
const GEIST_REGULAR: &[u8] =
include_bytes!("../../../assets/fonts/Geist-Regular.ttf");
pub(crate) const SERIF_FAMILY: &str = "Newsreader";
/// The bundled Newsreader.ttf is the 16pt optical-size cut. GPUI's text
/// system matches by the font's TrueType name-id 1, which is
/// "Newsreader 16pt" for this file (the unqualified "Newsreader" only
/// appears in name-id 16). Using the wrong string silently falls back
/// to the default sans, so headings would render in Geist instead of
/// the design's display serif.
pub(crate) const SERIF_FAMILY: &str = "Newsreader 16pt";
pub(crate) const SANS_FAMILY: &str = "Geist";
/// Register every bundled UI font with GPUI's text system.