From a3c3b8530c927b198749e5468c669bc873d11f05 Mon Sep 17 00:00:00 2001 From: Gert Pellin Date: Thu, 15 Oct 2026 15:30:59 +0200 Subject: [PATCH 1/2] Text: a variable font's named instances are styles of its family (#1563) The font scan read only whether a face has an fvar table, so a variable family offered one style (its default instance), fontStyle = "Black" picked that face with synthetic bold, and an instance's PostScript name (Figtree-Black, what After Effects scripts use) found no face at all. The scan now reads the named instances (style, axis values, PostScript name, or the one Adobe Technical Note #5902 derives). They are styles of the family in text.fonts and the font menus, a style, PostScript name or full name selects the instance, and layout uses its axis values as the base variations; axes set on the text still win. --- crates/engine/src/tests_text_edit.rs | 60 +++++++ crates/text/src/fonts.rs | 139 ++++++++++++++-- crates/text/src/layout.rs | 44 ++++++ crates/text/src/sfnt.rs | 193 ++++++++++++++++++++++- crates/text/src/variable.rs | 10 +- crates/ui-egui/src/panels/text_panels.rs | 7 +- 6 files changed, 435 insertions(+), 18 deletions(-) diff --git a/crates/engine/src/tests_text_edit.rs b/crates/engine/src/tests_text_edit.rs index 3e41688d2..243a9c676 100644 --- a/crates/engine/src/tests_text_edit.rs +++ b/crates/engine/src/tests_text_edit.rs @@ -317,6 +317,66 @@ fn fonts_filter_variable_families() { assert!(menu.iter().any(|r| r.family == "Inter" && !r.variable)); } +/// A variable font of `name` and `fvar` only: one `wght` axis 100..900 (default 300, style +/// `Light`) and the named `instances` (style, `wght`), each with a PostScript name +/// `-