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 is strange at small font sizes #16

Open
hakanai opened this issue Jan 20, 2015 · 3 comments
Open

Kerning is strange at small font sizes #16

hakanai opened this issue Jan 20, 2015 · 3 comments

Comments

@hakanai
Copy link

hakanai commented Jan 20, 2015

Given a fairly simple HTML with no style of its own:

<html>
  <head>
    <title></title>
  </head>
  <body>
    <p>This is just one sentence for testing.</p>
  </body>
</html>

Providing the user stylesheet:

--user-style-string=html{font-family:Helvetica;font-size:11pt;line-height:1.0}

The kerning comes out looking very uneven, but if I make the font much larger:

--user-style-string=html{font-family:Helvetica;font-size:40pt;line-height:1.0}

Now it looks perfect.

I get the feeling that the comment about changing the quality settings for the QPrinter is relevant. Perhaps webkit thinks it's rendering to a 72dpi device, so it's moving letters to align them with the pixels, even though it shouldn't?

Screenshot of the 11pt version zoomed in vs. the 40pt version:

screen shot 2015-01-21 at 9 26 37 am

@hakanai
Copy link
Author

hakanai commented Jan 21, 2015

It seems I'm not the first to notice this quirk and it supposedly behaves differently depending on the display resolution, even though that should not affect printing.

http://www.qtcentre.org/threads/18007-QPrinter-amp-QPainter-Font-Differences-Between-LInux-and-WIndows

http://stackoverflow.com/questions/10299633/qtextdocumentdrawcontents-only-renders-at-96-dpi
(the accepted answer here might fix it)

@hoehrmann
Copy link
Owner

Does this only affect PDF output?

@hakanai
Copy link
Author

hakanai commented Feb 1, 2015

Good question. We only use PDF output.

Edit: And I can't seem to see the command-line parameter to choose the DPI for a PNG, so I'm not sure how I could compare 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