Skip to content

Snapshot: catalog installed fonts before rendering - #2275

Merged
h-a-n-a-s-h-i merged 1 commit into
storytold:mainfrom
pick2510:fix/snapshot-waits-for-fonts
Oct 23, 2026
Merged

h-a-n-a-s-h-i merged 1 commit into
storytold:mainfrom
pick2510:fix/snapshot-waits-for-fonts

Conversation

@pick2510

@pick2510 pick2510 commented Oct 22, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • The offscreen snapshot example never started the font scan that the app runs from its first frame. A workbook's installed fonts (e.g. Helvetica Neue) were therefore drawn in the Calibri substitute.
  • The snapshot now calls fonts::catalog() before building the session, and runs 14 frames instead of 8 so the fonts bind as they do in the app.

Found while comparing snapshots with Excel: a Helvetica Neue workbook rendered in Carlito.

Test plan

  • Rendered a Helvetica Neue workbook: it now draws in Helvetica Neue (0.6 s; before this change it fell back).
  • cargo xtask ci: fmt, clippy, assets, layers, wasm, parity and keytips pass. The one test failure is header_autofit::table_filter_autofit_…, which depends on installed fonts and is fixed by test: header AutoFit check measures the text as AutoFit did #2273.

Example-only change, so there is no unit test; it changes no library code.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • The snapshot example now catalogs installed fonts before creating a session and completes 14 setup steps before rendering, up from 8. No changes to public APIs are included. These updates affect the example’s behavior; no direct changes to the application’s end-user features are noted.

The offscreen snapshot never started the background font scan the app runs
from its first frame, so a workbook's installed fonts (Helvetica Neue, say)
were drawn in the Calibri substitute. Catalog them up front and run a few more
frames so they bind, as in the app.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
📥 Commits

Reviewing files that changed from the base of the PR and between a1c8454 and 5bcbaac.

📒 Files selected for processing: 1
  • crates/ui-egui/examples/snapshot.rs

Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 8 remain after this review.

📝 Walkthrough

The snapshot example catalogs installed fonts before creating the session. It runs the harness for 14 steps before rendering, increased from 8.

Changes: Snapshot example

Layer / File(s) Summary
Snapshot setup and rendering
crates/ui-egui/examples/snapshot.rs
The example catalogs installed fonts before creating the session. The harness runs 14 steps before rendering, increased from 8.

Priority: ⬇️ Low

Estimated code review effort: 1 (Trivial) | ~5 minutes

Change: Bug fix

Possibly related issues

  • storytold/craft-libs#198 — The installed-font catalog change addresses part of the issue’s shared font discovery work.
  • storytold/craft-libs#223 — The example uses the installed-font catalog described in the issue.

Suggested reviewers: echelon

Merge Risk: ⚪ Minimal · up to 5bcba

The snapshot setup changes are correctly ordered and present no established merge-blocking risk.

Architecture risk: 🔵 Low · up to 5bcba

The change affects 1 system.

Changed systems: crates

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — crates (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in crates/ui-egui/examples/snapshot.rs: The example now catalogs installed fonts before creating the session.
  • observed — Modified behavior in crates/ui-egui/examples/snapshot.rs: The harness now runs 14 steps before rendering instead of 8.
Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the main change: cataloging installed fonts before snapshot rendering.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@h-a-n-a-s-h-i
h-a-n-a-s-h-i merged commit 67f13d8 into storytold:main Oct 23, 2026
1 check passed
@echelon

echelon commented Oct 23, 2026

Copy link
Copy Markdown
Member

Landed on main. Thank you for this contribution, @pick2510! Good to see you on the Discord too if you're not there yet: https://discord.gg/artcraft

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.

3 participants