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

Kerning issues with small fonts #1199

Closed
john8329 opened this issue Aug 22, 2020 · 4 comments
Closed

Kerning issues with small fonts #1199

john8329 opened this issue Aug 22, 2020 · 4 comments
Labels
bug Existing features not working as expected
Milestone

Comments

@john8329
Copy link

I'm having trouble creating small labels with WeasyPrint, when I format fonts with a small size (5pt and below) the kerning gets all messed up. See the screenshot for more details. Testing this seems trivial, but if it's not reproducible I'll share an example code.
No idea if it's a WeasyPrint issue or one of the other libraries, though it's not a big problem for me, I can do a transform: scale() trick and have it render nicely.

Screenshot 2020-08-22 at 09 01 32

@liZe
Copy link
Member

liZe commented Aug 22, 2020

Hello!

Do you have this problem only when rendering PNGs, or also with PDFs?

@john8329
Copy link
Author

Also with PNG (had to specify a resolution or it was unreadable). Could it be some floating point precision issue in the renderer?

@liZe
Copy link
Member

liZe commented Aug 22, 2020

It’s probably caused by hinting, always set in WeasyPrint when generating PNGs.

You can use the Python API to set enable_hinting=False in the render method, that’s probably the easiest solution to fix that right now.

@john8329
Copy link
Author

Interesting, I'm going to make use of the API in the future for a tighter integration, though at the moment I don't have the time. For now I think I'll stick with the workaround, thanks.

@liZe liZe added the bug Existing features not working as expected label Aug 22, 2020
@liZe liZe added this to the 53.0 milestone Dec 7, 2020
@liZe liZe closed this as completed in 7fe4e74 Dec 7, 2020
liZe added a commit that referenced this issue Jul 18, 2021
Debian stable (Buster, 10) includes Pango 1.42. Until the next version of
Debian (Bullseye, 11) is released, keep a workaround to avoid crashes.

This workaround is not documented on purpose, support of Pango 1.42 will not be
improved. Also note that WeasyPrint with Pango 1.42 will suffer from #1199.

Fix #1384.
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

2 participants