Open zignis opened 5 months ago
usvg@0.41.0 panics here when rendering a text having diacritics using a custom font:
usvg@0.41.0
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:
<svg width="500" height="500" viewBox="0 0 500 500" fill="none" xmlns="http://www.w3.org/2000/svg"> <text font-family="Font without diacritics, Some fallback font" x="50%" y="50%"> <tspan>y̆</tspan> </text> </svg>
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.
Do you have fonts with which I can reproduce it?
@RazrFalcon try this: https://www.dropbox.com/scl/fi/6wiosp1bwtkysx77foqhx/CabinetGrotesk-Regular.ttf?rlkey=pen3lkx3ers0sic03z2sxmhfn&dl=0
usvg@0.41.0
panics here when rendering a text having diacritics using a custom font: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:
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.