Repository navigation
fix: generateBrand: load system fonts only for marks with text (#120) - #121
Merged
FabioHAraujo merged 3 commits intoOct 15, 2026
Merged
Conversation
resvg loads every system font on each construction by default: ~450 ms per render on Windows, ~2.7 s per icon set at every build, and the generateBrand unit test timed out (13 s against 5 s), failing validate and the pre-push gate there. The render options now come from resvgOptions(), which turns system fonts off unless the SVG has <text>. Closes #120
FabioHAraujo
force-pushed
the
fix/120-generatebrand-resvg-loads-every-system-font
branch
from
October 15, 2026 03:24
5551308 to
e5fa380
Compare
FabioHAraujo
marked this pull request as ready for review
October 15, 2026 03:55
Contributor
|
Site preview: https://pr-121.codeatlas-ui.pages.dev |
FabioHAraujo
deleted the
fix/120-generatebrand-resvg-loads-every-system-font
branch
October 15, 2026 04:03
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #120
Regression test (written first)
mainOn Windows, the existing test failed on
main:New
resvgOptionstest (tests/brand.test.ts): before the fix,SyntaxError: Export named 'resvgOptions' not found, 0 pass / 1 fail.After:
8 pass, 0 fail; writes the hashed icon set takes 0.17 s (was 13.2 s).Change
@resvg/resvg-jsloads every system font on eachnew Resvg()by default. Measured on Windows 11 for 6 renders of a 512px path-only mark: 2724 ms by default, 30 ms withfont.loadSystemFonts: false.generateBrand(and socaBrandPluginat every build and dev start) renders 6 PNGs per set.resvgOptions(svg, size)inbrand.tssetsfitToandfont.loadSystemFonts: /<text\b/.test(svg), so a mark with text still renders its glyphs. It is not re-exported (the./viteentry lists its brand exports by name).Checklist
bun run validatepasses (validate ok in 169.6s; pre-push gate ✔️)bun changeset) if the published package changes