Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don’t separate combining characters in SVG text #2249

Open
liZe opened this issue Sep 8, 2024 · 0 comments
Open

Don’t separate combining characters in SVG text #2249

liZe opened this issue Sep 8, 2024 · 0 comments
Labels
bug Existing features not working as expected

Comments

@liZe
Copy link
Member

liZe commented Sep 8, 2024

SVG allows glyphes to be positioned separately. Because of this, we have to draw text glyph by glyph.

Unfortunately, that’s not what we do: we draw codepoint by codepoint. It obviously gives broken results for combining characters, ligatures, etc.

A dirty workaround would be to draw the whole text instead of separating codepoints when there’s no specified x, y, dx, dy or rotate values for specific glyphes (which is the most common case by far).

SVG is not really clear about the way combining characters have to be handled, but SVG2 gives a detailed explanation: https://svgwg.org/svg2-draft/text.html#TSpanNotes

(Of course, rtl and bidi are not supported yet in this case. Let’s keep that problem for a future issue.)

@liZe liZe added the bug Existing features not working as expected label Sep 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Existing features not working as expected
Projects
None yet
Development

No branches or pull requests

1 participant