Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

[Feature]: Embed fonts in the SVG export to preserve fidelity

Aperta
#41 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
52/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
rust
Ambito
frontend

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

enhancement
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:

  1. Embed the used font subset as base64 @font-face inside the <defs> of the exported SVG. Self-contained files, larger output (the woff2 files are small, and only one family is used per export).
  2. 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.
  3. 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.
Lingua principale
Rust
Stelle
1
Fork
0
Merge medio
1g 7h
PR unite (30g)
5

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di suradet-ps/codeframe

Tutte le issue di suradet-ps/codeframe

Issue simili

Altre issue su Rust

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.