Repository navigation
Conversation
Use the unstroke package to convert stroked icons into filled outlines for the webfont build instead of svg-path-outline + paper.js. The output is a single unioned path per glyph, so TTF files are ~36% smaller and the build no longer needs canvas, paper-jsdom or svg-path-commander.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Benchmark: before (
|
| before | after | |
|---|---|---|
| stroke → outline conversion, per weight | 12.4 s | 4.7–6.4 s |
whole build:webfont (conversion + font generation) |
62.5 s | 38.9 s |
Output size
| before | after | |
|---|---|---|
icons-outlined/400 |
25.3 MB | 20.1 MB |
tabler-icons.svg (font) |
33.5 MB | 15.6 MB |
tabler-icons.ttf |
2772 KB | 1764 KB |
tabler-icons.woff |
776 KB | 752 KB |
tabler-icons.woff2 |
452 KB | 492 KB |
tabler-icons-300.ttf / .woff2 |
2820 KB / 444 KB | 1780 KB / 496 KB |
tabler-icons-200.ttf / .woff2 |
2788 KB / 440 KB | 1780 KB / 504 KB |
Note on woff2: it is ~9% larger despite the much smaller TTF. The old glyphs were built from many overlapping rectangles and arcs that Brotli compressed very well; a single unioned, curve-fitted path is less repetitive. If woff2 size matters more than TTF size, precision / cornerAngle options in unstroke are worth tuning.
Accuracy: font glyphs rasterized at 96 px vs the original stroked SVGs
| before | after | |
|---|---|---|
| mean mismatched pixels, weight 400 | 0.143 % | 0.003 % |
| mean mismatched pixels, weight 200 | 0.153 % | 0.001 % |
| icons off by > 1 % (400) | 125 | 1 |
| icons off by > 0.5 % (400) | 178 | 4 |
| worst icon (400) | percentage-100: 35 % |
brand-parsinta: 4.3 % |
The old pipeline dropped filled areas: every percentage-* glyph rendered as an empty circle instead of a filled sector, and mood-tongue-wink* / mickey had wrong overlaps. The new output reproduces them. The only remaining outlier is brand-parsinta, whose arc has opacity=".5"; a font cannot express that and the old pipeline had the same 4.3 % there.
|
✅ All icons are valid! |
Summary
unstroke(outlineSvg) instead ofsvg-path-outline+paper.js+ the customsplitPaths/reorientPath/mergePathshelpers.percentage-*family rendered as an empty circle).svg-path-outline,paper-jsdom,canvas,@napi-rs/canvas,svg-path-commander. The rootonlyBuiltDependencies: ["canvas"]entry is gone too, so install no longer builds native canvas.icons-outlinedcache and the filled font are unchanged.Benchmark (build time, sizes, pixel diff against the source SVGs) is in the comment below.
Test plan
pnpm --filter @tabler/icons-webfont run build:webfontwith a cold cache