linebender / linebender/resvg

Loading text without fonts

Open
#1,074 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Rust
Stars
4.1k
Forks
348
Avg merge
1d 14h
Merged PRs (30d)
3

Description

I'm trying to build a terminal renderer for simple SVG files consisting only of text. I'm interested in extracting the text from an SVG, and I'd like to know the properties like the fill color (which is why I'd like to use `usvg` rather than `roxmltree` directly), but I don't actually care about the font at all, and I don't need the layout or glyph position information.

Would it be possible to support *simple* text element extraction without having the fontdb? I'd love to *just* get the `TextChunk`/`TextSpan` information, and it'd be fine if all the information like `.dx()`, `.dy()`, positioned glyphs, decoration spans, etc were all unavailable. (I do want the explicit x/y positioning info from the SVG itself, and it'd be helpful to know *whether* the span is decorated.)

Contributor guide

No contributing guide indexed for this repository

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.

Research direction

Start by tracing how usvg currently exposes text through TextChunk and TextSpan, and where fontdb is required compared with direct roxmltree parsing. Define the supported extraction data, including SVG x/y positions and decoration state, and verify that font-dependent fields such as dx, dy, and positioned glyphs remain unavailable.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
computer-graphics
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.