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

Text positioning regression in 0.36 compared to 0.27 #671

Open
Weasy666 opened this issue Oct 21, 2023 · 4 comments
Open

Text positioning regression in 0.36 compared to 0.27 #671

Weasy666 opened this issue Oct 21, 2023 · 4 comments

Comments

@Weasy666
Copy link

I was running version 0.27 of resvg-explorer-extension.exe for a long time and came around to update recently and noticed a regression between 0.27 and 0.36 in regard to the text handling/positioning.

As i am also using usvg in a project of mine to parse SVG files and then render them, i went ahead and also updated my project from 0.27 to 0.36 and noticed the same regression there.

Here you can find an example:

usvg 0.27 (correct text placement)

Rendered in my project:
grafik

usvg 0.36 (wrong text placement)

Rendered in my project:
grafik

Thumbnail rendered in explorer:
grafik
If you look closely where the arrow points to, you can see, some cut of text pieces there.

I'll also attach the file in question for debugging reasons:
twinkle.zip

@RazrFalcon
Copy link
Owner

resvg renders this file just fine. Maybe you're handling transforms incorrectly on your side?

As for thumbnailer, it looks like fonts were not loaded to begin with. Will try to figure it out.
This SVG file doesn't define any fonts to begin with. Times is not a valid family name in most cases. It should fallback to Times New Roman, but it didn't I guess.

@Weasy666
Copy link
Author

If you look closely to where the red arrow is pointing, then you can see the comma an lower part of the f can be seen on the thumbnail. So it loads some font and displays it, but at the same incorrect position as it does in my project.

I am using the NodeExt abs_transform to get the position. Which worked fine in version 0.27, but not any more in 0.36, despite using TreeTextToPath.

@RazrFalcon
Copy link
Owner

Yes, as I've said, there is definitely a bug in the thumbnailer, but not in resvg.

Will see what's wrong with NodeExt::abs_transform. There were a lot of breaking changes since 0.27. Not surprising. And only resvg rendering is tested.

@Weasy666
Copy link
Author

No worries. Thank you very much for all of your work and these crates 🙂

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