Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

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

Open
#41 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
52/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Active
Tech stack
rust
Domain
frontend

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

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.
Dominant language
Rust
Stars
1
Forks
0
Avg merge
1d 7h
Merged PRs (30d)
5

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from suradet-ps/codeframe

All issues in suradet-ps/codeframe

Similar issues

More Rust issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.