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

Problem with rendering text #427

Open
vincentfpgarcia opened this issue Jul 31, 2024 · 1 comment
Open

Problem with rendering text #427

vincentfpgarcia opened this issue Jul 31, 2024 · 1 comment

Comments

@vincentfpgarcia
Copy link

vincentfpgarcia commented Jul 31, 2024

Here is an input SVG image: https://upload.wikimedia.org/wikipedia/commons/7/7d/Roll_pitch_yaw_mnemonic.svg

When rendering it, the text is off:

output_cairosvg

The SVG code contains 2 tspan tags nested within a text tag.
By removing one tspan, the text displays correctly.

As pointed https://stackoverflow.com/questions/78807441/problem-with-text-rendering-using-cairosvg/78807953?noredirect=1#comment138959543_78807953, the problem might come from a bug in the interpretation of the text-anchor: middle style.

@liZe
Copy link
Member

liZe commented Jul 31, 2024

the problem might come from a bug in the interpretation of the text-anchor: middle style.

Yes, that’s exactly the problem.

As the bug doesn’t happen in WeasyPrint, that uses a code that’s close to CairoSVG’s code, I think that it’s fixed by Kozea/WeasyPrint@1460522 in WeasyPrint.

Would you like to try to backport it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants