Commit Graph
81 Commits
Author SHA1 Message Date
vangel76andClaude Sonnet 5.5 99caf83c62 Merge upstream/main into rfx-text
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-29 20:31:32 +01:00
Dylan M. Taylor 7c74960c6f Refactor text for strict Clippy checks 2026-10-28 06:09:20 +00:00
vangel76andClaude Sonnet 5.5 2078b492d9 Merge upstream/main into rfx-text
text/layout: upstream split paragraph() into Para/place_line helpers and moved the tests to
layout/tests.rs. The branch's changes are re-applied there: the resolved paragraph direction
is passed to margins_for/avail_for/align_for (RTL point text with Justify sits flush right),
first_ascent/plausible_first and ParaLine.first/style_first (box first baseline is the d
height, vertical text keeps the ascent), and the Justify All last-line cost in
optimal_breaks. The branch's seven new layout tests moved to layout/tests.rs.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-27 17:06:38 +01:00
aiongg b7b75ed37a style: cargo fmt on the moved files 2026-10-26 21:54:30 +00:00
aiongg 7204aeaa69 refactor(text): move src/layout.rs tests to src/layout/tests.rs 2026-10-26 21:49:11 +00:00
aiongg 2e76b5f8b2 refactor(text): move src/fonts.rs tests to src/fonts/tests.rs 2026-10-26 21:49:11 +00:00
Dylan M. Taylor c618429252 Sonar: reduce cognitive complexity in footage reload, edit delete and text layout 2026-10-26 16:01:49 -04:00
vangel76andClaude Opus 5.5 236e8c87ae Merge main into rfx-text
Conflict in crates/text/src/layout.rs (paragraph direction at the top of
paragraph()), against the closure-to-method-path cleanup (4e9fa51f): kept this
branch's direction resolved once from BidiInfo.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 15:30:09 +01:00
vangel76andClaude Opus 5.5 ba2023ac94 Text: indents follow the resolved paragraph direction too
Review (CodeRabbit on #1875): with the direction unset, Hebrew text resolved to
right-to-left took its start indent on the left. The paragraph direction is now
resolved once from BidiInfo before the margin and alignment helpers, so both use
it. Regression test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 15:05:42 +01:00
vangel76andClaude Opus 5.5 2aecd57c28 Text: justified RTL point text follows the resolved direction; only the first line decides the vertical baseline
Review (CodeRabbit on #1875): with the paragraph direction unset, a right-to-left
paragraph resolved by BidiInfo was still aligned as left-to-right justified point
text, so it stayed left instead of flush right. eff_align now takes the resolved
direction. The box-text first baseline used the font ascent whenever any run of
the text was vertical; it now looks only at the runs of the first line.
Two regression tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-26 11:23:49 +01:00
Dylan M. Taylor e821feeec4 Merge pull request #2274 from storytold/sonar/rust-s4325-s1612
sonar: method paths instead of closures (rust:S1612)
2026-10-25 16:36:06 -04:00
skylar taylor-barrick dec327b98a egui037: Preserve text ownership across unrelated history changes 2026-10-25 13:03:14 +01:00
Dylan M. TaylorandClaude Sonnet 5.5 4e9fa51f12 sonar: method paths instead of closures (rust:S1612)
Poison recovery, OsStr::to_str and char predicates only; S4325 casts are
f64 to f32 and stay.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-24 08:17:16 +00:00
aiongg fefe4b8a91 Merge #1843: i18n: Georgian (ka) interface language (@devius) 2026-10-23 21:45:52 +00:00
aiongg a32048db4d Batch fix: fonts: read the CJK locale only for scripts with usual families (#1907)
fallback_for read the locale (and the environment) on every call, including
the layout hot path; it is computed lazily, only for a character of a script
with usual families.
2026-10-23 21:31:57 +00:00
aiongg 966f9d9894 Merge #1322: ui: the interface prefers the platform's UI faces, rendered text keeps the print ones (@FeiLiuEM) 2026-10-23 21:19:10 +00:00
aiongg fe0215a074 Merge #1907: fix(text): isolate CJK fallback language and cache entries (@TimotheusG) 2026-10-23 21:18:45 +00:00
aiongg 0173abde8c CI: dev-profile gate, one test binary per crate, nextest, line tables only (#2235)
* Dev profile: line tables only for workspace crates, no debug info for dependencies

* xtask ci: dev-profile gate, nextest, tests without examples, wasm --keep-going

* One integration-test binary per crate

* xtask ci: run effectcraft-gpu's shared-device tests in one cargo test process

* xtask ci: run every stage and report all failures

* xtask ci: name the stage type (clippy type_complexity)

* xtask ci: run every test pass and report all failures

* cargo fmt
2026-10-23 12:59:51 -04:00
vangel76andClaude Opus 5.5 eb1726fbb0 Merge main into rfx-text
Conflict in crates/text/src/layout.rs (line metrics): main's partition_point
slice from #2193 plus this branch's first-baseline maximum. rustfmt applied to
main's paragraph() signature.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 18:05:14 +02:00
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
TimotheusG d6afa87641 fix(text): isolate CJK fallback language and cache entries (#1141) 2026-10-19 15:30:35 -04:00
vangel76andClaude Opus 5.5 daedbd5ca1 Review: short "d" falls back to the font ascent; tracking unit comment; Lottie hunk out
- first_ascent: a "d" shorter than 0.3 x the font ascent (a symbol or icon font) no
  longer puts box text's first baseline almost at the box top; the font ascent is used,
  as before the "d" rule (CodeRabbit on #1875). Test:
  a_short_d_falls_back_to_the_font_ascent.
- CharXf::track_before / track_after are pixels, not 1/1000 em (CodeRabbit).
- The Lottie export of style-run tracking is back to what it was: the pixel conversion
  was not checked against a player, so it is left for a separate, verified change.
- The Subtract clamp in Mode::combine is intended for every animator property: the
  selectors combine into one selection per character for the whole animator, as in
  After Effects; the read-back observed it through Tracking (now said in the code).
- Per-character 3D rotation notes that #1876 adds Mat4::rotation_xyz for the same order.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 19:10:21 +02:00
vangel76andClaude Opus 5.5 8ea876914d Text animators: Tracking Amount in pixels, Subtract selectors stop at 0, as After Effects
A text animator's Tracking Amount is in pixels in After Effects 2026, not in
1/1000 em like the Character panel's tracking: Amount 30 on every character
adds 30 px between neighbours (half before, half after each) at 80 px and at
40 px. And a Subtract range selector over characters the first selector
leaves out keeps them at 0 instead of selecting them negatively. With both,
the EXPORTER's t8 layer D (Tracking 30 on characters 2-4 by index, Subtract
over the last 20 %) puts every glyph where AE does (it ended 88 px short,
1553 vs 1641; now 1641).

The "Tracking In" text preset animates 40 -> 0 px (was 400 -> 0 thousandths
of an em, about the same at 100 px text); Lottie export writes a style run's
tracking (1/1000 em) as pixels for its tracking animator, which Lottie
players add in pixels.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 16:41:15 +02:00
vangel76andClaude Opus 5.5 83b134cdc8 Text: right-to-left point text with a justified paragraph sits flush right, as After Effects
After Effects 2026 lays out right-to-left point text whose paragraph carries a
justified code (justify last left / centre / right, justify all) flush at
its start, the right, like right-aligned text (EXPORTER read-back t7: point
rows with codes 3-6 at -152..-8 from the anchor). EffectCraft placed it by
the last-line side (left / centre / left). Left-to-right point text and box
text are unchanged; AE's slightly wider right-to-left box wrapping (1-2 px
narrower word gaps) stays open.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 16:41:15 +02:00
vangel76andClaude Opus 5.5 8bc57bc7ad Text: Justify All balances the lines with the every-line composer, as After Effects
With Justify All After Effects stretches the paragraph's last line too, and
its every-line composer breaks the paragraph so that line is not a lone
word: a 400 px box that the other justifications break into 6 / 6 / 1 words
breaks 4 / 4 / 4 (AE 2026, EXPORTER read-back t6). EffectCraft's composer
left the last line's slack out of its cost, so "twelve" stood alone on a
stretched line; it now counts that slack for Justify All and every word
starts within 1 px of AE's (what remains in that box is the known box-text
baseline offset). Other justifications and the single-line composer are
unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 16:41:03 +02:00
vangel76andClaude Opus 5.5 a7255f7608 Text: box text's first baseline is the height of "d" below the box top, as After Effects
After Effects puts the first baseline of paragraph (box) text the height of the
font's lowercase "d" (in whole thousandths of an em) below the box top, at the
text's nominal size; superscript keeps the line there and only raises its glyphs.
EffectCraft used the font ascent of the drawn size plus the superscript rise.
Measured in AE 2026 (case 818, box at y -200): Times New Roman 100 px -130.50
(EffectCraft -110.9), 50 px -165.25, superscript -163.80 (EffectCraft drew it
15.8 px lower), Arial 100 px -128.40, superscript -161.70; now within 0.15 px.
517 (four wrapped lines, Times New Roman superscript): the line bands now land
on AE's rows exactly (336-388, 434-486, 532-584, 643-682; were 16 px lower).

A face without a "d" outline, and vertical type (not measured), keep the font
ascent. The paragraph-box test now
expects the caret (full ascent) to start a little above the box.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-19 16:41:03 +02:00
Davit MatchakhelidzeandClaude Opus 5.5 dd29665939 text: the Georgian fallback test goes through fallback_for
system_fallback is the scan-order search; fallback_for is where the Georgian
families are preferred, so the test asks it for Mkhedruli in Inter.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YMTAbGNRxnMEzRvYnQGphF
2026-10-19 18:16:21 +04:00
Davit MatchakhelidzeandClaude Opus 5.5 5a069af3fd Merge i18n-improvements (main merged)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YMTAbGNRxnMEzRvYnQGphF
2026-10-19 02:58:18 +04:00
Davit MatchakhelidzeandClaude Opus 5.5 6c6b54a182 Georgian interface text draws from an installed font
Georgian joins the installed-font fallback like Thai, Hebrew and the Indic scripts:
Sylfaen on Windows, SF Georgian on macOS, Noto Sans Georgian or DejaVu Sans on Linux.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YMTAbGNRxnMEzRvYnQGphF
2026-10-18 19:54:25 +04:00
FeiLiuEM 2fbcc6b59a ui: the interface prefers the platform's UI faces, rendered text keeps the print ones
Windows ships a UI variant of its Japanese and Chinese families (`Meiryo`/`Meiryo UI`, `Yu
Gothic`/`Yu Gothic UI`, `MS Gothic`/`MS UI Gothic`, `Microsoft YaHei`/`Microsoft YaHei UI`,
`Microsoft JhengHei`/`Microsoft JhengHei UI`) whose kana and kanji are drawn for the screen, and its
own link table for `Segoe UI` picks the UI one for everything it draws. The interface should ask for
it - but the same lists feed `fonts::fallback_for`, which shapes composed frames, so reordering them
would change how existing projects render. The two orders are therefore separate: this leaves
`crates/text/src/fonts.rs` exactly as it is and gives the interface its own candidate list in
`install_script_fallbacks`, which falls back to the shared choice when the platform has no UI variant,
none is installed, or it does not cover the probe.

`PMingLiU` is in the interface list for its proportional spacing, not as a sibling of `MingLiU`: it is
MingLiU's proportional relative.

The rendered order is pinned by a test now: the Japanese list keeps `Yu Gothic` ahead of `Yu Gothic
UI`, and no UI name appears in the lists a document renders with. `the_interface_asks_for_the_
platforms_ui_faces` pins the interface list and checks that every other script the install probes has
none, so a script that draws correctly in any face keeps the shared order.

Review fixes: the locale is mapped once (the call passes the language, the helper maps it), the new
test sits after the #394 test it had split from its doc comment, and the fonts.rs test asserts instead
of panicking inside a closure. Rebased on current main; #1395 has not landed yet, so there is nothing
to rebase after it.
2026-10-18 22:28:56 +08:00
Brandon ThomasandClaude Opus 5.5 f3f24ef189 Land batch: fix clippy lints and the #1424 test after #1413 changed layer_menu
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 09:42:33 -04:00
Brandon Thomas 7c99ba6eeb Merge pull request #1696
# Conflicts:
#	contributors/people.toml
2026-10-18 09:36:05 -04:00
Brandon Thomas 4d61409662 Merge pull request #1672 2026-10-18 09:35:34 -04:00
Brandon Thomas 65d955c32a Merge pull request #1572 2026-10-18 09:35:34 -04:00
NetterSilverandClaude Haiku 5.5 1ad17f608b Resolve Microsoft font names to installed metric-compatible fonts
Fixes #1677

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-16 23:50:29 +02:00
Marco Arnulfo 9d56675da9 Text: drag a Range Selector's Start and End in the Composition viewer (#1011) 2026-10-16 18:45:11 +02:00
Gert Pellin c4dcefb65b Text: a variable face's own style needs no instance axis values (#1563)
The face's own style (Figtree's Light) is its default instance, so it
resolves without axis values and lays out as before, on the static path.
docs/agents.md says how named instances are selected.
2026-10-15 18:45:54 +02: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
IanHollow 7a9c2a8c40 Fonts: honor Fontconfig configuration search paths
Assisted-by: GPT-6
Signed-off-by: IanHollow <72767437+IanHollow@users.noreply.github.com>
2026-10-14 22:44:19 -07:00
Brandon Thomas 6be321153c Merge pull request #1126 from dotCooCoo/fix/script-fallback-loaded-faces 2026-10-13 04:29:00 -04:00
Brandon Thomas ec86cdb584 Merge pull request #1015 from FeiLiuEM/font/chinese-script-families 2026-10-13 04:29:00 -04:00
dotCooCoo 91e46af99c Text: fallback tries a script's usual families before faces loaded earlier
fallback_for tried every face that was already loaded before the usual
families of the character's script. Which faces are loaded depends on
every earlier lookup. On macOS, /Library/Fonts/Arial Unicode.ttf makes
Arial Unicode MS the first face in the scan, and it covers every script
that has usual families except Sinhala. The variable font search loads
it, and so does a fallback for a character that it covers and the
bundled faces and the usual families lack, such as the Simplified
Chinese 们. After that, Hebrew, Arabic, Indic, Thai and CJK text in a
Latin family fell back to Arial Unicode MS instead of Tahoma, Kohinoor
Devanagari, Tamil Sangam MN, Hiragino Sans or Apple SD Gothic Neo. In
the effectcraft-text unit tests,
other_scripts_fall_back_to_a_plain_system_family and
cjk_falls_back_to_a_system_family failed in 7 of 100 runs on a Mac, and
in 24 of 100 while other builds were running, depending on which faces
the other tests had loaded.

The usual families now come right after the bundled faces. family_faces
lists the installed faces of the script's families in the order they
are tried, each in the preferred face's style. The list is cached per
script and preferred face, and adding faces or changing the CJK locale
clears it. Faces that are already loaded come next, then the per-block
cache of the search over every installed font, then the search itself,
as before. A search result made for another character of the block (an
Armenian character next to Hebrew, Lao next to Thai, or a character
that no face covers) is no longer used for a character that a usual
family covers.

tests/script_fallback.rs runs in a test binary of its own. It records
the fallback for eight characters of those scripts, looks up U+0590,
Armenian and Lao and runs the variable font search, and checks that the
eight get the same faces again. It also checks that U+08A4, which on
macOS only faces outside the Arabic list cover, keeps its face after a
lookup of U+0870, which no face covers.
2026-10-12 12:14:33 -07:00
Moein Saharkhiz a27f9f54b9 #1063: render carriage-return text as separate paragraphs 2026-10-12 14:47:58 -04:00
FeiLiuEM 35124cc924 text: the Traditional list drops a Simplified face and adds the macOS Traditional ones
WenQuanYi Micro Hei is a Simplified-oriented face, so keeping it in the Traditional list - even as a
last resort - could still draw Simplified forms, which is the one thing the split is for. Heiti TC
and Hiragino Sans CNS are the macOS Traditional faces the family's own lists use (photocraft's
`CjkScript::TraditionalChinese`). Dropping the entry does not lose the face: the generic scan behind
the script lists still finds it when nothing Traditional is installed.

The test now walks the `FallbackScript::Han` arm as well, so a list wired to the wrong script fails
it, and it refuses a WenQuanYi entry in the Traditional list.
2026-10-12 21:57:49 +08:00
FeiLiuEM dc1b048f8a text: the Chinese fallback families follow the script the locale asks for
The Han fallback list carried a Simplified and a Traditional face for every platform (Microsoft YaHei
next to Microsoft JhengHei, PingFang SC next to PingFang TC), Simplified first. The fallback search
keeps the first family whose face covers the character, and the two scripts share their code points -
only the glyph forms differ - so a zh-hant interface was drawn with Simplified forms, and a
Traditional face could not win on a machine that also had a Simplified one.

The list is now two, picked by the script the locale in force asks for: Hant, or a Taiwan, Hong Kong
or Macao region. A bare zh stays Simplified, as the interface's own locale mapping resolves it.
`asks_traditional_chinese` normalises case and separators, and `chinese_families_for` is pure, so the
choice is testable without installed fonts. The Han order and the Japanese and Korean lists are
untouched.

Verified: cargo fmt --all --check clean, cargo clippy -p effectcraft-text --all-targets -- -D warnings
clean, cargo test -p effectcraft-text 54 tests pass.
2026-10-12 20:49:02 +08:00
Brandon Thomas efa023f693 Merge pull request #876 from vangel76/fix-874-linux-font-dirs
#874: scan Flatpak host, XDG and fontconfig font folders on Linux
2026-10-12 04:20:39 -04:00
Brandon Thomas c72e47b7dc Merge pull request #761 from vangel76/gap-variable-font-filter
#741: font menu filters to variable fonts
2026-10-12 03:03:28 -04:00
Brandon Thomas dff86891d0 Merge pull request #399 from FeiLiuEM/test/variable-font-axis
Text: the variable-font test picks an axis that moves the advance
2026-10-12 03:02:38 -04:00
vangel76andClaude Opus 5.5 b58197ff82 #874: scan Flatpak host, XDG and fontconfig font folders on Linux
Problem: on Linux the font list only scanned /usr/share/fonts,
/usr/local/share/fonts, ~/.local/share/fonts and ~/.fonts. The ArtCraft
Launcher installs EffectCraft as a Flatpak, where those folders hold only
the runtime's fonts and the host's fonts live under /run/host, so installed
fonts were missing (25 families instead of 320 on the reporter's setup).
$XDG_DATA_HOME/fonts, $XDG_DATA_DIRS/*/fonts and fontconfig <dir> entries
were never scanned either.

Fix: a new font_dirs module lists the usual folders, the Flatpak host
folders (/run/host/fonts, local-fonts, user-fonts), the XDG data folders
and the <dir>/<remap-dir> entries of the fontconfig configuration
(FONTCONFIG_FILE or /etc/fonts/fonts.conf, /usr/local/etc/fonts/fonts.conf,
and ~/.config/fontconfig), following <include>s with prefix="xdg",
"relative" and ~ expansion. It uses a small tag scanner (no new dependency),
bounds the include depth, the number and size of files read, and reads each
file once. Folders are deduplicated before the walk, and the walk depth
goes from 4 to 8. docs/agents.md lists the folders and how to grant the
Flatpak an extra one.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 18:21:20 +02:00
vangel76andClaude Opus 5.5 7afe723260 #741: font menu filters to variable fonts
Problem: After Effects 26.3's font menu can show only variable fonts.
EffectCraft's font menus (Character panel, Properties ▸ Text) had no such
filter, and text.fonts / MCP list_fonts didn't say which families are
variable.

Fix: the font scan marks a face variable when its table directory has an
fvar table declaring axes (header read only, no extra file loading). The
font menu gets a "Variable fonts only" checkbox above the results; it
combines with the typed search, keeps the keyboard in the search field and
stays set while the app runs. text.fonts reports `variable` per family and
takes `{variable: true}`; list_fonts passes it through. Catalog rows for
ja, zh-Hans, zh-Hant and uk.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 12:14:50 +02:00