Trying to render a subscript ends up with bold font
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 4.1k
- Forks
- 348
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 3
Description
Using a file like
```
```
and `./resvg --sans-serif-family "Liberation Sans" simple_subscript_bold.svg simple_subscript_bold.png` gives a warning "Warning (in usvg_text_layout:1398): Fallback from Liberation Sans to Noto Sans Mono." and result like

However specifying `./resvg --sans-serif-family "Noto Sans Mono" simple_subscript_bold.svg simple_subscript_bold.png` doesn't give any warnings and also doesn't render the text in bold:

I suppose the problem is that Liberation Sans doesn't have the codepoint 2083 (subscript 2) available: `fc-query --format='%{charset}\n' /usr/share/fonts/truetype/liberation/LiberationSans-Regular.ttf` ⇒ `… 207f 20a3-20a4 …` and Noto does (`2074-208e`). But I would expect then that a regular weight fallback would be used, and preferably a warning why the fallback was used when the requested font does exist.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the issue with the supplied SVG and the two resvg commands, then start at the usvg_text_layout warning path mentioned in the report. Trace how missing glyphs select a fallback font and how its weight is chosen. Done means Liberation Sans fallback renders the subscript without unintended bold styling and the fallback behavior is explained by an appropriate warning.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100