* Disk cache: record the source files each frame reads
Part of #3184 (step 1): renders now report which footage files they read,
each with its identity (size and modification time) as read. Nothing uses
the list yet: images, cache keys and cache behaviour are unchanged.
- render: `reads` module with `FileStamp`, `ReadFile`, `ReadFiles` (sorted,
deduplicated, bounded; marked incomplete when it can't vouch for every
file) and the thread-safe `ReadLog`. `Renderer::reads` collects a frame's
files; `FootageSource::recording` lets a source note what it reads.
`file_stamp` uses the same identity.
- Layer cache entries keep the files their buffer was made of and report
them on every hit; derived entries (styles, blend space, flattened) keep
their base's. Buffers from the disk cache or the browser store don't know
their files yet and mark the list incomplete.
- Media pool: every file read notes its identity, taken from the file it
opens. Decoded frames, opened movies, GIFs, models and EXR channels keep
it with the cache entry, so a frame served from memory reports its file
without touching the disk.
- Viewer frame worker collects each frame's list and carries it to where
the disk entry is written (step 2 stores it).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Automation: confined footage passes on the files it reads
Part of #3184: ConfinedFootage forwards FootageSource::recording to the
source it wraps, so renders of an automation session list their files
instead of coming back incomplete. The read tests also render through the
viewer's CancellableFootage wrapper.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Disk cache: frame entries keep their source files, comp key from memory
Part of #3184 (step 2). Fixes#3175: opening a comp no longer stamps every
footage file of the project before its first frame can show.
- The comp's content key (`disk_cache::comp_content_key`) is taken from the
project in memory alone: no footage or proxy file is stamped, no
`VirtualFileId` is asked. `comp_content_key_with` is gone; `frame_key`
hashes a new entry version, so entries of the earlier format are never
looked up again (LRU evicts them).
- Frame entries (formats 2 and 3) store the files the frame read
(`EntryFiles`: size and modification time as read; size and content hash
through `VirtualFileId` for files from memory; missing files), then the
pixels. Formats 0 and 1 read as misses and are deleted.
- Check on hit: `get_frame`/`get_frame_f16` look only at the listed files
(one metadata call each) on the frame worker. A changed, back or unreadable
file, or a damaged entry, is a miss: the entry is deleted and the frame
rendered and stored again.
- A frame whose file list is incomplete is shown but not stored. The RAM
preview keeps each frame's files, so `persist_missing` writes only frames
with a complete list.
- Remote frame worker: `FrameServer` records each frame's reads
(`take_files`); the web worker stores them with the entry and the page
checks them through the file table before using it. The browser's media
epoch existed only for the old key and is removed. Export does not use
frame entries.
- The cache indicator still only asks whether an entry exists.
Tests: entry format round trip and damage, the check per file, and in the
viewer: a changed file re-renders exactly its frames (and a reopen reads the
rest from disk); a frame checks only its own files in a project with a large
unused sequence and the key looks at no file; missing, unreadable files and
damaged entries never serve a stale frame.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Disk cache: layer entries keep their source files, no footage salt
Part of #3184 (step 3 of 4).
Layer buffers on disk (and in the browser's layer store) now carry the
files they were made of, like frame entries since step 2, and are checked
against exactly those files when used. The project-wide footage salt is
gone: nothing stamps every footage file any more.
- Layer entry format 4: the buffer's EntryFiles, then the pixels. A hit
checks only the listed files (metadata, or the VirtualFileId hook for
files from memory; Missing must still be missing); a change, a damaged
entry or the old format 0 is a miss and the entry is deleted, so the
re-rendered buffer replaces it. A hit reports its file list, so frames
made of buffers from disk are complete and get stored again.
- Buffers whose files can't all be named are not written.
- Layer disk keys: layer_disk_key = hash of the layer entry version, the
renderer version and the layer cache key (which names the footage items
with their paths and settings, from memory).
- PrefetchStore checks on use; an entry made of changed files is dropped
and forgotten, so the new buffer is queued over it. FrameServer passes
its virtual-file hook to its layer cache.
- Removed: footage_salt(_with), file_stamp, footage_stamp,
set_disk_salt, set_store_salt, Session::refresh_disk_salt,
poll_disk_salt, footage_fingerprint, disk_salt, disk_salt_background,
disk_salt_job, DiskSaltJob, the UI's per-frame poll, the salt in
FrameServer and in the availability worker (with its cache_enabled
plumbing). The disk cache is attached as soon as it is configured.
- Docs: architecture.md, web.md.
Tests: layer entries check their files (size, time, missing/back,
folder, damaged, old format, incomplete); virtual files; prefetch store;
media tests with a real pool across restarts (only the changed file is
read, projects with the same item ids never share an entry, missing,
unreadable and damaged never serve stale buffers); engine tests that the
cache is attached at once and edits do no file work (#1926, #3106).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Disk cache: no-salt worker test, sequence paths in the frame-blend key
Part of #3184 (step 3 of 4).
- A frame-blended footage frame's layer-cache key now hashes the
sequence's file list: with no project-wide salt, two projects whose
items share an id and a first frame must not share its disk entry.
- Test: a frame worker syncing, patching and rendering a project with an
unused 5000-frame sequence asks its file hook only about the file its
buffer reads (the salt asked about every file at every sync).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Disk cache: the comp key covers what its expressions can read
With an expression anywhere in the project, every comp's disk key hashed
every item of the project, so any edit (another comp, an unused footage
item) threw away every comp's frames on disk. The key now covers what the
comp can draw plus what the expressions among it can reach
(Project::pixel_reach):
- without expressions: the items the comp draws, without silent layers,
plus the footage its precomp layers swap in (Media Replacement);
- with expressions: every layer of the comps they reach, their markers,
the comps and footage they name with string literals (comp("Name"),
footage("Name")) together with which items have those names now, and
the footage named like a reached source (its data is read by name);
- the whole project when an expression computes a name, uses the object
model's constructors or internals, dynamic code, computed keys or
writes, or text the scanner can't read for sure (regex literals,
template strings, escapes): expression_reach errs towards reaching more.
Markers count only where an expression can read them (#1083). Memory
only, no file is looked at.
Tests: scanner and reach unit tests in the project crate; engine tests
for the key (own-comp expressions keep the key through edits elsewhere,
comp("Other") follows Other and not a third comp, a second comp taking
the name counts, a computed name counts every item, markers read from
another comp); a ui-egui test that the disk frames outside an expression
layer are carried when the comp it names changes.
Part of #3184. Part of #1492.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Disk cache: Reload Footage drops the entries of its files, docs
File > Reload Footage now deletes the frame and layer entries whose file
lists name the reloaded item's files (DiskCache::drop_files), so a file
replaced by one with the same size and modification time, which the
check on hit can't tell apart, is read again. The index knows keys, not
files: the writer thread reads the files section at the start of each
frame and layer entry (not the pixels) after the writes queued before
it, and deletes the entries that list one of the files. Until it is
done, an entry made of one of them is a miss and frames aren't linked to
new keys. The entries are gone for good, so they don't come back after a
restart. Automatic reloads don't drop anything: they follow a changed
stamp, which the check on hit catches. The browser needs nothing (its
file identities are content hashes).
Removed: disk_cache::seal, which steps 2 and 3 left without callers (the
tests use seal_format). Updated the module, seal_format and forget_media
docs, and docs/architecture.md / docs/web.md describe the final design:
what is cached, keys from memory, file lists checked on hit, nothing
scans the project, incomplete lists stay in memory, Reload Footage drops
entries, edits keep the frames they can't change.
Tests: render unit tests (same size and time passes the check but not
the drop; other files' entries stay; an entry queued before the drop is
dropped; a layer entry too; written again afterwards it is used; the
drop survives a restart; a pending drop is a miss), and an engine test
through file.reloadFootage.
Closes#3184. Part of #1492.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Disk cache: file stamps keep the whole modification time
A file's modification time was nanoseconds since 1970 as u64: a time before 1970
read as "no time" (two such files of one size looked alike) and times after 2554
were truncated. It is now i128 nanoseconds, negative before the epoch; None only
means the file system has no time. The content-key hash writes a presence tag and
the full value.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Automation: a refused footage read leaves the render's file list incomplete
Footage outside the read roots shows nothing and was noted as no file at all, so a
picture made without it had a complete, empty list and could be kept on disk for
a later session with other roots. A refused read during `recording` now marks the
list incomplete.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Render: a buffer kept by another worker comes with its own files
LayerCache::insert returns the files of the buffer it keeps, and Renderer::keep
notes them in the render's log and returns them, so a render that uses another
worker's buffer lists that buffer's files (a file changed between the two reads
then has two identities and the list is incomplete).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Render: sampleImage and text fonts note the files they read
EvalCtx carries the render's read log. A sampleImage render records its footage
reads, keeps them with its per-thread cached buffer and notes them in the
evaluating render's log on every use. Text notes the font files it is drawn with,
with the identity their bytes were read with; a family that isn't installed, a
fallback or missing glyph, or a font from memory leaves the list incomplete.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Disk cache: frame entries store the whole modification time
A frame entry's file list stores a file's modification time as i128 nanoseconds
since 1970 (negative before), as the file stamps now keep it; the frame entry
format version goes to frame-entry-files-2 so entries in the old layout are not
read.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Disk cache: layer entries store the whole modification time
Layer entries share the frame entries' file list layout, which now stores the
full i128 modification time: the layer entry format version goes to
layer-entry-files-2. The module doc names the font files text is drawn with
among an entry's source files, and what keeps a list incomplete.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Layer cache: buffers that read other layers are keyed by the switches passed down
A layer whose effect reads another layer (Gradient Wipe, Set Matte, Blend…) gets
that layer drawn by its own renderer. Through a precomp layer, Switches Affect
Nested Comps, the switches inherited from the precomp layers above and motion
blur on change those pixels, but the key held only the layers' own switches: a
buffer made with the setting on was reused (from memory or the disk cache) with
it off. Such layers now derive their key with what the renderer passes down.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Layer cache: masked buffers are keyed by the mask motion blur gate
A mask with Mask Motion Blur On blurs even when the layer's own switch is off,
as long as the render's gate is open (Render Settings motion blur, and with
Switches Affect Nested Comps the precomp layers above). The key held the
layer's own motion blur state only, so a buffer blurred with the gate open was
reused with it closed (and the other way round), also from the disk cache.
Masked layer, input and footprint keys now tell a closed gate apart.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Render: cached buffers list what their expressions and substituted characters read
- Buffers made under `Renderer::recorded` (layer content, a Time effect's input, an adjustment
layer's footprint) evaluate their masks, shapes and effects with the context that notes into
the buffer's own read log, so a file an expression reads (`sampleImage`, also at shutter times
mask motion blur adds and the cache key doesn't see) is in the buffer's files.
- A styled layer served from the cache lists the files of the cached body and passes too, so
the buffers made of it (flattened, blending space) don't get a complete list when one of them
came with an incomplete one.
- A character put in by Character Offset or Character Value without a relayout notes the font
it is drawn with; a fallback face (or none) leaves the list incomplete.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Render: text lists the font file of a run that draws no glyph; tests clean their temp dirs
An empty first paragraph draws no glyph, but in a box its face sets the
first baseline that places every later line. The read list took faces only
from glyphs, so it could be complete without that file. Note each style
run's resolved face as well.
The font-reads and confine tests use tempfile::tempdir(): a fresh
directory per run, removed on panic too.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Disk cache: Reload Footage closes the gaps around its drop (#3184)
- A reload while the disk cache is off is kept on the session
(pending_disk_drops) and applied when the cache is switched on, before
anything is read from it.
- Each render takes the cache's drop generation before it reads (frame
worker; layer cache at the miss). An entry listing a file dropped after
that is refused under the queue's lock, so a render that was under way
during the reload can't store pixels from before it. Such a frame is
shown with an incomplete file list, so persist_missing skips it too.
The per-file record is bounded (past it, everything older is refused).
- An entry read while its drop was pending is a miss even when the
writer ends the sweep between the read and the check (a stale hit
found under load): the pending drops and the generation are taken
before the entry is read.
- Test: a reopened project serves its frame from disk with no source file
opened or decoded.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Disk cache: RAM frames keep the drop generation their render started at
Reload Footage empties the RAM preview, but an idle pass of
persist_missing may already hold a frame from before the reload. It
took the cache's drop generation when it ran, after the drop, so the old
pixels could be written back and, with the file's size and time
unchanged, served again after a restart.
Each RAM frame now keeps the disk cache its render started with and
that cache's drop generation then. persist_missing writes a frame only
to that cache, with that generation, and skips it once one of its files
was dropped since; a frame rendered without that cache is not written
from there.
Tests use tempfile directories (the layer drop test, the frame_files
folders under target/).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Doc comments for the functions this PR touches
* Disk cache: cap the free-space reserve at 10 GB, skip encodes the limit refuses
The reserve the cache leaves free on its disk was max(2 GB, 5% of the
disk) (#2551). On a 4 TB disk with 190 GB free that is 200 GB, so a
cache set to 20 GB had a limit of 0: every write was refused, the cache
never held anything, and only a log warning said so.
The reserve is now clamp(5% of the disk, 2 GB, 10 GB). It is there to
keep the cache from filling the disk, not to keep a share of a large
disk free: 10 GB leaves the system room to work on any disk, a small
disk still keeps 2 GB, and a 100 GB disk keeps 5 GB as before. After
Effects has only a maximum cache size and no reserve; a clamp keeps
the floor for small disks, where a fixed 10 GB would take most of the
space.
Writes the limit refuses cost no work: DiskCache::accepts_writes (one
atomic read) is checked before a frame is converted (put_disk_frame)
and before frames and layers are compressed (put_frame, put_frame_f16,
put_layer). The frame workers spent about 8 ms per frame and 14 ms per
layer on encodes that were then refused. persist_missing returns at
once at limit 0 instead of converting the RAM frames on every idle pass.
Settings > Disk shows the limit in effect in MB under Maximum Disk
Cache Size, with a note when free disk space lowers it
(settings.disk.cacheLimit).
* Disk cache: refuse writes below 64 MB of room, show this disk's reserve
Review follow-ups to the reserve fix:
- accepts_writes also refuses while free disk space leaves less than
64 MB of room (a limit the setting asks for is always used): a few
frames would fill it, and the rest would be compressed only to be
refused.
- While writes are refused the idle passes ask for no repaint, so the
UI keeps a frame coming every 5 s: the free space is read again and
the RAM frames are written once there is room.
- Settings > Disk names the space kept free on this disk (the reserve
the last reading applied; the rule from MIN/MAX_DISK_RESERVE when it
is unknown), and the "no room" note follows accepts_writes.
- The settings.disk.cacheLimit automation label is machine-readable
and the same in every language: limitMb, maxMb, reserveMb,
spaceLimited, writes.
- cargo fmt.
* Disk cache: follow 3D model sources in the comp's reach
The reach walk followed comp, footage and solid sources but not
LayerSource::Model. An expression reading a model layer's source
(thisComp.layer("Model").source.name) left the model item out of the
comp's content key, so renaming the model kept the key and the old
frames on disk were served. Every source item is followed now
(LayerSource::item), which also counts the model when no expression
reads it (Advanced 3D draws it).
The same omission is fixed in the RAM preview's content walk
(frames.rs) and in the layer key's walk of referenced layers
(cache/dependencies.rs).
* Disk cache: a render's drop generation travels with its reads; no disk entries for Expression Selectors
Drop generation per render: the layer cache recovered a buffer's drop
generation from the latest miss of its key, so a second render of the
key that started after File > Reload Footage lent its generation to a
render still running from before, and that render's buffer (the file as
it was) was written after the sweep. Now Renderer::recorded starts each
buffer's read log at the store's drop generation before anything is
read (ReadLog::starting_at); ReadFiles carries the earliest generation
through merges, so derived buffers (styles, the blend-space copy, the
flattened layer) and frames that use a buffer from memory carry it too.
LayerCache::insert keeps a buffer made of a file dropped since its
reads began neither on disk nor in memory; a list that doesn't say
counts as made before every drop. DiskCache::dropped_since takes the
list's own generation too. missed_at keeps only the miss time.
Expression Selectors: the layer key evaluates a text Expression
Selector's amount for the first character only, so a per-character
dependency such as textIndex == 1 ? 0 : footage("ref.png").width was
not in the key, and after the footage item's width changed a reopened
session reused the old layer entry. A text layer with an Expression
Selector now marks its reads unkeyed (ReadFiles::is_unkeyed), which
merges like the generation; such buffers stay in memory and are never
written to disk. Frame entries are unaffected: the comp's frame key
hashes what the expressions name. The equality and hash of ReadFiles
ignore both new fields.
* Disk cache: never serve a RAM layer buffer made before a drop of its files
A render that passed the drop check could sit in put_layer's encode
while Reload Footage cleared the layer cache and dropped the file, then
publish its old pixels to memory after the purge; get, and a fresh
render's insert, then served them. The disk-hit promotion went through
the same insert_mem.
Every way the cache hands out a RAM buffer (get, the kept-first path of
insert, an existing entry in insert_mem) now checks the entry's files
against the store's drops from their own generation (ReadFiles::since):
an entry made before a drop of one of its files is forgotten and the
lookup misses, so a fresh render's buffer replaces it. insert_mem also
re-checks a buffer just before publishing it.
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
The CJK render test skipped wherever no Japanese face was installed, which
is every CI runner, and on a Mac it drew glyphs with or without the fix, so
it caught nothing. Replace it with a fallback-order test: fixture faces for
`Hiragino Sans` and `Hiragino Sans GB` show that a zh-hans Han lookup tries
the Chinese family first, that ja tries the Japanese one, and that a layout
gets Hiragino Sans GB. Synthetic fonts in an isolated child process keep it
independent of the host's fonts; with the Simplified list reverted it fails
on `[7]` against `[8, 7]`.
Delete `TEST_CJK_LOCALE`: the locale-mutating tests moved to an isolated
child process, so nothing used the lock and the test-only static failed
clippy's `-D warnings` gate.
Trim the documentation edits to the single docs/gaps.md gap-11 row: revert
the header and changelog edits in ROADMAP.md, docs/roadmap.md,
docs/localization-parity.md and docs/target-app-parity.md, and the gaps.md
header and changelog row, which conflict with other PRs.
Tests: cargo clippy -p effectcraft-text -p effectcraft-render --all-targets
-- -D warnings, cargo clippy --workspace --all-targets -- -D warnings,
cargo test -p effectcraft-text (79 lib), cargo test -p effectcraft-render
(264 passed, 1 ignored perf test), cargo fmt --all -- --check.
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>
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>
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>
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>
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>
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.
* 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
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>
The test checked that Japanese text falls back to an installed Japanese
family, but left the process-global CJK locale at the host's: on a zh-CN
host with a Chinese face installed, han_order puts the Chinese families
first for the shared ideographs and the Japanese-family assertion fails.
Set ja-JP under the TEST_CJK_LOCALE lock and clear the request when the
test ends, as the zh-CN test beside it does.
Tests: effectcraft-text 75 lib + 3 integration passed; cargo fmt --all -- --check passed.
The macOS fallback test selected the first installed family from the
Simplified list, so a Mac that also has PingFang SC (or Microsoft YaHei /
Noto Sans CJK SC) picked that one and then failed an assertion that only
accepted the three macOS faces. Accept any family from the list -- every one
is Chinese -- and check that each installed macOS face covers the shared
ideographs instead.
Also exercise fallback_for itself under a zh-CN request, which the direct
resolve_in lookup bypassed, and serialise the process-global locale with the
layout CJK test so a cached family order cannot leak between them.
Tests: effectcraft-text 75 lib + 3 integration passed; effectcraft-render
233 passed, 1 ignored; cargo fmt --all -- --check and cargo clippy -p
effectcraft-text --all-targets -- -D warnings clean.
macOS does not install the on-demand PingFang SC (macOS 27 on an English
install ships Hiragino Sans GB, Heiti SC, Songti SC and STSong instead),
and the Simplified Chinese fallback list named only Windows and Linux
families. A Chinese character therefore fell through to the exhaustive
search, which picks the first installed face that covers it — Hiragino
Sans, the Japanese face — so Chinese text in a composition was drawn
with Japanese glyph forms (#453). Japanese kana and kanji were already
handled, and a Chinese-only character the Japanese face lacks (e.g.
页) still found a Chinese face, which is why the symptom looked
selective.
Add the macOS Chinese faces to the fallback lists: Hiragino Sans GB,
Heiti SC, Songti SC and STSong for Simplified Chinese, Songti TC for
Traditional (Heiti TC was already named). The interface language still
chooses between the scripts and an English interface keeps the
Japanese-first order for shared Han ideographs, as designed in #312;
what changes is that a Chinese-locale request has an installed Chinese
family to answer it on macOS.
Tests: a text-layer render test draws Japanese and Chinese text and
checks glyph coverage (skipped where no CJK face is installed); a layout
test checks every CJK glyph comes from a face that has the character, so
a missing-glyph box cannot creep back; and the fonts test fails without
the list change ("Hiragino Sans GB missing from the Han list"), passes
with it, and walks the Han branch's list to prove the first installed
Simplified family is a Chinese face, not a Japanese one.
Verified with CARGO_BUILD_JOBS=2 RUST_TEST_THREADS=2:
effectcraft-text 64 passed; effectcraft-render 233 passed, 1 ignored;
cargo clippy -p effectcraft-text -p effectcraft-render --all-targets --
-D warnings clean; cargo fmt --all -- --check clean. A 900x240 render of
"骨直真具画 中文测试" with the zh-hans request now uses Hiragino Sans GB
and differs from the Japanese render, which still uses Hiragino Sans.
- 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>
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>
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>
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>
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>
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.