Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

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

オープン
#41 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
52/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
活発
技術スタック
rust
領域
frontend

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

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.
主要言語
Rust
スター
1
フォーク
0
平均マージ
1日 7時間
マージ済み PR(30日)
5

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

suradet-ps/codeframe のほかの issue

suradet-ps/codeframe の issue をすべて見る

似ている issue

Rust の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。