Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

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

Abierto
#41 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
52/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
rust
Área
frontend

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.
Lenguaje dominante
Rust
Estrellas
1
Forks
0
Merge medio
1 d 7 h
PR fusionados (30 d)
5

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de suradet-ps/codeframe

Todos los issues de suradet-ps/codeframe

Issues similares

Más issues de Rust

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.