Commit 7190baf
fix(badge): register Geist font with canvas to fix width measurement
The Geist font was not registered with @napi-rs/canvas, causing text
measurement to use a wider system fallback font in production. This
produced badges with excessive whitespace, especially for longer text.
Register the Geist font from server assets so canvas measures text
with the same font the SVG specifies for rendering.
Closes #2187
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent 7f2fc1a commit 7190baf
File tree
2 files changed
+28
-1
lines changed- server/api/registry/badge/[type]
2 files changed
+28
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
253 | 253 | | |
254 | 254 | | |
255 | 255 | | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
256 | 262 | | |
257 | 263 | | |
258 | 264 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | | - | |
| 2 | + | |
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
55 | 74 | | |
56 | 75 | | |
57 | 76 | | |
| |||
431 | 450 | | |
432 | 451 | | |
433 | 452 | | |
| 453 | + | |
| 454 | + | |
434 | 455 | | |
435 | 456 | | |
436 | 457 | | |
| |||
0 commit comments