Skip to content

fix: reduce itinerary SVG font payload#36

Merged
Minorli merged 1 commit into
mainfrom
fix/0.1.63-itinerary-font-subset
Jul 12, 2026
Merged

fix: reduce itinerary SVG font payload#36
Minorli merged 1 commit into
mainfrom
fix/0.1.63-itinerary-font-subset

Conversation

@Minorli

@Minorli Minorli commented Jul 12, 2026

Copy link
Copy Markdown
Owner

Summary

  • subset the embedded itinerary title font to only glyphs used by the current title and subtitle
  • preserve the existing self-contained SVG font and visual styling while reducing client decode pressure
  • fall back to system fonts if subsetting fails and cap the glyph-set cache
  • release PicGen 0.1.63

Production finding

A deployed 0.1.62 customer-style run produced a 12.7 MB itinerary SVG and Chromium crashed once while loading/compositing it. A controlled identical-background comparison reduced the SVG from 10,093,980 bytes to 1,689,480 bytes (83% reduction).

Test plan

  • ./scripts/check.sh (408 passed; Ruff and Mypy clean)
  • uv run --with pytest-cov pytest -q --cov=picgen --cov-report=term (87% total)
  • uv run --with pip-audit pip-audit (no known vulnerabilities)
  • old/new Chrome render comparison at 1792x1792 (0.042% tiny antialiasing-only pixel delta)
  • 20 repeated SVG decode + logo canvas composition + PNG encode cycles
  • Docker build and non-root healthy-container smoke test

@Minorli
Minorli merged commit 8e315be into main Jul 12, 2026
1 check passed
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.

1 participant