Summary: | [Qt] Monospace font does not render in proper sizes | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | mdesign <m.karoly> | ||||||||||||||
Component: | Text | Assignee: | Allan Sandfeld Jensen <allan.jensen> | ||||||||||||||
Status: | RESOLVED FIXED | ||||||||||||||||
Severity: | Normal | CC: | allan.jensen, ap, mitz, noam, pierre.rossi, trevor, webkit.org, webkit.review.bot | ||||||||||||||
Priority: | P2 | ||||||||||||||||
Version: | 528+ (Nightly build) | ||||||||||||||||
Hardware: | All | ||||||||||||||||
OS: | All | ||||||||||||||||
Bug Depends on: | |||||||||||||||||
Bug Blocks: | 36532 | ||||||||||||||||
Attachments: |
|
Description
mdesign
2012-08-06 06:15:05 PDT
Created attachment 156675 [details]
Firefox 14 - renders right
Created attachment 156676 [details]
qtwebkit fails
Created attachment 156678 [details] WebKit-r124698 fails If anyone can help, where can i start hacking the code, don't hesitate, please share with me!:) Does anyone know what libs responsible for the font rendering in webkit on different operating systems? The proper rendering in Firefox 14 and Internet Explorer 9 is done via new DirectWrite API. Before using DirectWrite the monospace rendering failed same way like webkit. There is a list about different browsers and rendering engines in this article: http://www.smashingmagazine.com/2012/04/24/a-closer-look-at-font-rendering/ I tested every browser on windows. Just the browsers with DirectWrite engine renders properly. Interesting. Have you tried compiling WebKit yourself? If you do, you can try to activate SUBPIXEL_LAYOUT and see if that helps. It looks like sizes are rounded poorly. Im using webkit in Qt. I found a workaround: Commenting out this row in this file makes the monospace fonts render correctly: /src/3rdparty/webkit/WebCore/platform/graphics/qt/FontPlatformDataQt.cpp font.setStyleStrategy(QFont::ForceIntegerMetrics); In my testing the workaround suggested in comment #7 also results in a general improvement in font kerning which was previously often very poor. Any news on this? Found it mentioned here: https://groups.google.com/forum/?fromgroups=#!topic/wkhtmltopdf-dev/SWLkI5eHi_4 Dear Allan Sandfeld Jensen! I using Qt, so i suggested a workaround for it. But the issue exists in webkit too (as you can see it in the screenshots) Best regards, Károly Marton I think there a two ways about this. One, we need to establish if the bug #36532 still applies on Mac. Can we remove ForceIntegerMetrics. Second, maybe ForceIntegerMetrics is being too aggressive, and should only force basic metrics to integers but not advances. I can confirm that removing the forced rounding on advances also solves this bug. Created attachment 193767 [details]
Patch
Comment on attachment 193767 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=193767&action=review Pierre, any opinion? > Source/WebCore/platform/graphics/qt/FontPlatformDataQt.cpp:74 > +#if QT_VERSION < QT_VERSION_CHECK(5, 1, 0) Please add a comment in the code explaining why the version guard is used. Created attachment 193814 [details]
Patch
Comment on attachment 193814 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=193814&action=review LGTM. That seems like the sensible approach (not affecting < 5.1 behaviour I mean) > Source/WebCore/platform/graphics/qt/FontPlatformDataQt.cpp:75 > + // Kept enabled for Qt<5.1 to maintain stable baselines for 5.0. coding style: Qt < 5.1. Ah wait no, I'm told it doesn't matter for comments ;) > Source/WebCore/platform/graphics/qt/FontPlatformDataQt.cpp:76 > + // FIXME: Remove when we depend on Qt 5.1. not sure if that was strictly necessary... But it'll go away with the whole ifdef chunk soon enough :) Committed r146203: <http://trac.webkit.org/changeset/146203> Committed r147544: <http://trac.webkit.org/changeset/147544> |