[Feature]: Embed fonts in the SVG export to preserve fidelity
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 52/100
Research direction
Start by tracing the SVG export path and how it emits <text> elements and the font references; the issue does not name source files or tests. Compare the proposed font embedding, path conversion, and UI documentation options against the client-side and selectable-text constraints. Done means the chosen approach preserves SVG fidelity on machines without the bundled font, or clearly documents the limitation in the UI and README.
Written by the indexing model from the issue text.
Description
Problem
The exported SVG references fonts by name only. Token positions are also hardcoded per <text> element using an approximate character width (font_size * 0.602). On any machine without the exact bundled font installed, the text renders with a fallback font at different advances, so tokens drift, overlap, or leave gaps. The SVG export therefore cannot guarantee visual fidelity outside the app, while the PNG export can.
Proposed solution
Pick one of:
- Embed the used font subset as base64
@font-faceinside the<defs>of the exported SVG. Self-contained files, larger output (the woff2 files are small, and only one family is used per export). - Convert text runs to outline paths at export time (
<path>instead of<text>). Perfect fidelity everywhere, no font dependency, larger files, and text stops being selectable and searchable. - If neither is acceptable, surface the limitation in the UI next to the SVG button and document it in the README.
Option 1 is the smallest behavioral change and keeps text selectable.
Alternatives considered
Do nothing and document the limitation. This keeps the current file sizes but leaves the fidelity gap between PNG and SVG.
Project constraints
- This keeps everything client-side (no backend, no server-side processing; code never leaves the browser).
- This does not introduce a DOM-screenshot library (html2canvas, dom-to-image); rendering stays on Canvas2D/SVG.
- This respects resolution honesty: the export canvas is drawn at true scale and never upscaled after the fact.
- Dominant language
- Rust
- Stars
- 1
- Forks
- 0
- Avg merge
- 1d 7h
- Merged PRs (30d)
- 5
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from suradet-ps/codeframe
-
enhancement good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
suradet-ps/codeframe#40 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
suradet-ps/codeframe#35 ·
Maintainers usually reply within 1 day
-
documentation good first issue
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
suradet-ps/codeframe#36 ·
Maintainers usually reply within 1 day
-
[Bug]: Target width input clamps the value on every keystrokePossibly taken @AnushreeKasturi claimed this 4 days ago. Openbug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
suradet-ps/codeframe#37 · 2 comments ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
suradet-ps/codeframe#38 ·
Maintainers usually reply within 1 day
All issues in suradet-ps/codeframe
Similar issues
-
area: config effort: S good first issue P3 type: bug
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
ferenyl/azuredevopstui#63 ·
-
needs-triage O-Arm T-libs
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
bug CLI config mcp
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
documentation good first issue
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
yunaremaia/sandbox-ffi-layers#56 ·
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
git-ai-project/git-ai#2434 ·
Maintainers usually reply within 1 day