[Feature]: Embed fonts in the SVG export to preserve fidelity
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
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 の本文から書いたものです。
説明
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.
- 主要言語
- Rust
- スター
- 1
- フォーク
- 0
- 平均マージ
- 1日 7時間
- マージ済み PR(30日)
- 5
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
suradet-ps/codeframe のほかの issue
-
enhancement good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 83/100
suradet-ps/codeframe#40 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
suradet-ps/codeframe#35 ·
メンテナーはふだん 1 日以内に返信
-
documentation good first issue
難易度 1/5 1〜3時間 初心者へのやさしさ 88/100
suradet-ps/codeframe#36 ·
メンテナーはふだん 1 日以内に返信
-
[Bug]: Target width input clamps the value on every keystroke対応中かも @AnushreeKasturi が 4 日前に担当しました。 オープンbug good first issue
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
suradet-ps/codeframe#37 · コメント 2 件 ·
メンテナーはふだん 1 日以内に返信
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
suradet-ps/codeframe#38 ·
メンテナーはふだん 1 日以内に返信
suradet-ps/codeframe の issue をすべて見る
似ている issue
-
documentation priority:p2 type:chore
難易度 2/5 1〜3時間 初心者へのやさしさ 73/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
facebookincubator/scrut#60 ·
-
dispatch:sol-high documentation
難易度 1/5 1〜3時間 初心者へのやさしさ 85/100
carrick-sh/carrick#768 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
correctness postgres tursopg
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
tursodatabase/turso#10442 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 82/100
ankitects/anki#5864 · リアクション 1 件 ·
メンテナーはふだん 2 日以内に返信