render, shaping: let a caller pin the font files a frame is drawn with #466
No reviewers
Labels
No labels
priority/P0
priority/P1
priority/P2
release/v0.1.0
status/blocked
status/planned
type/bug
type/design
type/test-gap
type/tracker
No milestone
No project
No assignees
1 participant
Due date
No due date set.
Dependencies
No dependencies set
Reference
natsukium/felis!466
Loading…
Reference in a new issue
No description provided.
Delete branch "render-pinned-fonts"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #441 (the pinned-fonts half; the offscreen target and readback landed in #465).
Why
Font selection always scanned the system, so a recording or screenshot rendered with different faces on two machines and a golden test could not hold its pixels. felis-reel needs to name the exact font files.
What
RendererConfig::font_files: when non-empty, every face lookup (primary, bold/italic styles, fallback walk) runsauto_discover's discovery over these files instead of the system scan. It is read by the warm-up thread, the constructors andreload_fontalike, so a reload cannot bring system faces back, and font features stay the config's as in a window.FontStack::discover_in_files: reads each file into memory (not mmap: the mapping's safety rests on immutable system font roots, and a caller's file can be truncated underneath it) and rejects a file with no face, which fontdb otherwise accepts silently.docs/explanation/rendering/text-shaping.md: "Font fallback" and "Font loading" describe the pinned path.A prebuilt
FontStackhanded to the constructor (the issue's proposal 3) was rejected:start_fonts,reload_fontand the config's feature list could each reintroduce faces or features the stack was not built with.Verification
just checkgreen.FontPath; a warm-up stack is discarded whenfont_fileschanges.