You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
generateBrand: resvg loads every system font per render (12s+ on Windows, brand test times out) #120
generateBrand (packages/ui/src/lib/brand.ts, also run by the brand Vite plugin at every build and dev start) creates one new Resvg(svg, …) per PNG. @resvg/resvg-js loads every system font by default (font.loadSystemFonts: true) on each construction. On Windows that costs ~450 ms per render, so one icon set (6 PNGs) takes ~2.7 s and the unit test that renders three sets takes 12–17 s.
As a result packages/ui/tests/brand.test.ts › generateBrand › writes the hashed icon set; inputs, not pixels, decide the hash times out (5 s) on Windows, so bun run validate and the pre-push gate fail there:
(fail) generateBrand > writes the hashed icon set; inputs, not pixels, decide the hash [13229.13ms]
^ this test timed out after 5000ms.
Measured on Windows 11 (Bun 1.4.2), 6 renders of a 512px path-only SVG:
{} 2724 ms
{"font":{"loadSystemFonts":false}} 30 ms
Fix
A brand mark is paths. Only load system fonts when the SVG actually has <text>: font: { loadSystemFonts: /<text\b/.test(svg) }. Builds get faster on every OS, and the test passes on Windows.
Activity
FabioHAraujo commentedon Oct 15, 2026
Working on this in #121 (draft). Branch
fix/120-generatebrand-resvg-loads-every-system-font. Regression test first, then the fix.fix: generateBrand: load system fonts only for marks with text (#120)
chore: start #120
fix: generateBrand: load system fonts only for marks with text (#120)
fix: generateBrand: load system fonts only for marks with text (codea…