Commit Graph
7 Commits
Author SHA1 Message Date
Dylan M. Taylor ca8043cbba text: bound layout and variable font metadata (#2193)
* text: bound layout and variable font metadata

* text: address review (intern once, f64 prefix sums, bounded item search, name fallback, consistent variation fallback)
2026-10-23 08:55:07 -04:00
Gert Pellin a3c3b8530c 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.
2026-10-15 15:30:59 +02:00
FeiLiuEM 66df1696ac Text: the variable-font test fails when nothing moves instead of skipping
The test picked the first axis that moves an advance and skipped when none did, so a variation path
that broke completely - every axis measuring the same - took the skip and hid exactly the regression
the check is there for. Only a face with no axis carrying a range skips now.

When no ranged axis moves the advance (a monospaced family holds its advances on purpose), the
outline must still move along `wght`, or, on a face without one, along the first axis that carries a
range; a path that moves neither fails with a message that says so.

Verified on Linux with Google Sans Code and Bahnschrift installed:
- the normal path passes (the MONO axis is the one that moves the advance),
- forcing the branch where no axis moves the advance passes, so a legitimate monospaced face does
  not fail,
- forcing that branch and freezing the outline area fails with "wght 300..800: neither the advances
  nor the outlines move, so variation support looks broken".
`cargo fmt --all --check` and `cargo clippy -p effectcraft-text --all-targets -- -D warnings` clean.
2026-10-09 23:01:54 +08:00
FeiLiuEM 55ba002acf Text: the variable-font test picks an axis that moves the advance
`style_variations_change_advances_and_outlines` picked `wdth`, else `wght`, else the first axis
with a range, and then asserted that the advance moves. That assumes the chosen axis changes
advances, which a monospaced family does not: Google Sans Code - the first variable face on a
machine where it is installed, and the one this check met on Linux - moves its outlines along
`wght` but keeps its advances fixed by design, so the test failed with "wght 300..800: advances
780 vs 780" while `measure` and the font were both right.

The test now tries the axes in order and uses the first one whose advance actually moves (Google
Sans Code answers on its own MONO axis, Bahnschrift on `wdth`), and skips with a message on a
machine whose variable faces never move an advance - the same shape as the "no variable font
installed" skip next to it. The outline assertion keeps its teeth: the axis is picked for moving
the advance, but whether the outline follows it is still checked.

On Linux with Google Sans Code and Bahnschrift installed: `cargo test -p effectcraft-text`
reported 43 passed / 1 failed before and 44 passed after. `cargo fmt --all --check` and
`cargo clippy -p effectcraft-text --all-targets -- -D warnings` are clean.
2026-10-09 20:21:05 +08:00
Brandon ThomasandClaude Opus 5.5 c3532df7ef M13.12: Variable Font Axes animators change advances (text re-spaced)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 09:34:15 -04:00
Brandon ThomasandClaude Opus 5.5 f89af341a6 M13.6: variable font axes in the character style
CharStyle/TextDoc variations (layer.setText variations), shaped with harfrust instances so
advances follow HVAR/gvar, outlines drawn at the design-space position, animator deltas relative
to the style's values, Character panel Variable Font Axes fields (character.axis.<tag>).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 07:36:53 -04:00
Brandon ThomasandClaude Opus 5.5 7537eea85c M13.5: Animate Text > Variable Font Axes
Text: text.animatorFontAxes (replaces the stub) lists the layer font's
variation axes (skrifa) or adds an animator property that offsets one axis
(weighted by the selectors, from the axis default); the renderer redraws each
character's outline at its design-space position (cached per location). The
Timeline's Animate: menu lists the font's axes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 00:24:05 -04:00