usvg panics on text with diacritics
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 4.1k
- Forks
- 348
- Avg merge
- 1d 14h
- Merged PRs (30d)
- 3
Description
`usvg@0.41.0` panics here when rendering a text having diacritics using a custom font:
```
removal index (is 2) should be < len (is 2)
```
https://github.com/RazrFalcon/resvg/blob/fb7e28513f561ed847acbf4a6fb8b743474837a0/crates/usvg/src/text/layout.rs#L823
I'm using a non-system font that **does not** include diacritics. Relevant SVG:
```html
```
Perhaps we can check if the glyph exists at the index before removing it, but I'm not certain if it's the right way to handle this.
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
Start in crates/usvg/src/text/layout.rs around line 823 and reproduce the panic with the provided SVG, a custom font without diacritics, and the y̆ text. Trace the glyph-removal path and verify that rendering the example completes without the removal-index panic; add or update coverage if the repository provides a relevant test location.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- computer-graphics
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100