openpencil/tests/engine/text
Danila Poyarkov a2fc235131
fix(text): render variable font styles at their named instances (#773)
* fix(text): render variable font styles at their named instances

Installed variable fonts such as SF Pro list every named instance, but
font-kit loads each one at the default weight, so the desktop loader
rejected Medium and Bold and the canvas fell back to a substitute. Even
when a variable face was loaded, CanvasKit drew it at its default axes:
Medium rendered as Regular and Bold as a synthetic bold.

The desktop loader now falls back to a variable face whose wght axis
covers the requested weight. The renderer applies the coordinates of the
named instance matching the style, or the clamped weight when none
matches, beneath any explicit font variations on the text.

* fix(text): validate variable font tables and leave loading to the host

Check name-table records and string ranges, the fvar header size, and
axis and instance record sizes, so a malformed font falls back to the
style weight instead of throwing while text is shaped.

Drop the desktop loader's variable-face fallback; system font discovery
moves to fontique, which lists variable faces with their weight axes.
2026-09-26 11:25:01 +04:00
..
derived-text chore: format codebase 2026-05-24 12:15:29 +03:00
fonts fix(text): render variable font styles at their named instances (#773) 2026-09-26 11:25:01 +04:00
opentype test(engine): organize clipboard and vector coverage 2026-05-16 13:18:38 +03:00
style-runs chore: format codebase 2026-05-24 12:15:29 +03:00
coverage.test.ts feat(text): deepen typography controls 2026-07-17 22:40:52 +03:00
edit-undo.test.ts test: update structured instance override coverage 2026-09-01 11:57:36 +03:00
editor.test.ts fix(text): align editing overlays with vertical text (#543) 2026-08-17 19:32:40 +03:00
resolver.test.ts fix(fonts): explain PingFang substitution and draw its CJK text (#781) 2026-09-26 11:14:30 +04:00
rtl-auto-layout-input.test.ts feat(editor): add configurable snapping and guides 2026-08-18 19:11:48 +03:00
style-runs.test.ts