Skip to content

fix(viewer): drop ttf-parser by moving to fontdb 0.24 - #447

Merged
ElbertePlinio merged 1 commit into
mainfrom
fix/443-font-discovery
Oct 29, 2026
Merged

ElbertePlinio merged 1 commit into
mainfrom
fix/443-font-discovery

Conversation

@ElbertePlinio

@ElbertePlinio ElbertePlinio commented Oct 29, 2026 •

Copy link
Copy Markdown
Member

Closes #443

The native viewer's host font fallback now uses fontdb 0.24, which carries its own small font parser and no longer depends on ttf-parser. RUSTSEC-2026-0192 marks ttf-parser unmaintained, so the exception in osv-scanner.toml is removed. fontdb's API, Linux font discovery and fontconfig <dir> reading are unchanged, so fallback.rs and ui.rs do not change.

Traceability

Requirement Verification Scenario and edge cases Result Evidence
Move off ttf-parser cargo tree -p pickforge-viewer -i ttf-parser and cargo tree --workspace -i ttf-parser No match; Cargo.lock drops ttf-parser, core_maths and libm ~/.pickforge/investigations/443/tree-before.txt, tree-after.txt
Remove the RUSTSEC-2026-0192 exception osv-scanner scan source --recursive on the branch; control on the origin/main lockfile without the exception Branch: no issues. Control: fails on ttf-parser 0.25.1 ~/.pickforge/investigations/443/osv-after.log, osv-control-old-lock.log
Same fonts, order and metadata Temporary test that dumps every scanned face in preference order, run on 0.23 and 0.24 This host's 903 faces, including collections Identical paths, face indexes, families, style, weight, stretch, monospace flags and PostScript names, in the same order ~/.pickforge/investigations/443/faces-before.txt, faces-after.txt, temp-tests.rs.txt
No slower scan First lookup that triggers the scan, 5 runs each Cold page cache and warm Cold: mean about 582 ms before, 543 ms after. Warm: 42 to 46 ms before, 29 to 41 ms after ~/.pickforge/investigations/443/timing-before.txt, timing-after.txt, bench.sh
No new C runtime library ldd on the release binary libgcc_s, libm and libc, as on origin/main ~/.pickforge/investigations/443/ldd-before.txt, ldd-after.txt
Drawing unchanged #421 round 2 QA script on a private Xvfb CJK, Arabic, mixed Latin and Arabic, brackets, warning sign, right-to-left override refusal Banners pixel-identical to the #421 shots; labels draw the same glyphs (the session id is now 16 hex digits) ~/.pickforge/investigations/443/qa/
Viewer checks fmt, clippy, PICKFORGE_REQUIRE_XVFB=1 cargo test -p pickforge-viewer, native viewer vitest files Pass ~/.pickforge/investigations/443/cargo-checks.log, js-checks.log
Full suite full-suite.sh build, lint, typecheck, viewer build, vitest coverage, cargo Pass at 0382594: 3504 vitest tests passed, 4 skipped; cargo 351 passed ~/.pickforge/investigations/443/full/
PickCheck and secret scan pickcheck check --base origin/main --fail-on new,worsened,unmatched; gitleaks on the branch commit 0 violations (no source file changed); no leaks ~/.pickforge/investigations/443/pickcheck.json

Review

Sol, round 1 at 0382594: 9/10, no findings. It compared fontdb 0.24's vendored parser with ttf-parser 0.25.1 (no unsafe code, no new dependency) and confirmed Linux discovery, fontconfig handling and memory mapping are unchanged. The face dumps prove equal behavior for this host's 903 faces, not for every possible font; coverage still uses the unchanged swash code.

fontdb 0.24 vendors the small font parser it needs and no longer
depends on ttf-parser, which RUSTSEC-2026-0192 marks unmaintained.
The public API is unchanged, so the host font fallback keeps its
scan, order and coverage. Remove the advisory exception.

Closes #443
@ElbertePlinio
ElbertePlinio merged commit 37995aa into main Oct 29, 2026
10 checks passed
@ElbertePlinio
ElbertePlinio deleted the fix/443-font-discovery branch October 29, 2026 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

viewer: move host font discovery off the unmaintained ttf-parser before 2027-01-31

1 participant