RESOLVED INVALID 29618
Text isn't fully rendered with certain fonts in Win32/Cairo
https://bugs.webkit.org/show_bug.cgi?id=29618
Summary Text isn't fully rendered with certain fonts in Win32/Cairo
Marshall Culpepper
Reported 2009-09-21 14:55:28 PDT
Created attachment 39882 [details] Screenshot In some cases, at the end of a line of text, it looks like a few pixels are cut off from the rendered text. This appears in both inline text and buttons as far as I've seen. I've attached a sample HTML file which reproduces this behavior as of r48572, as well as a screenshot of what it looks like in both Windows 7 and Windows XP SP2.
Attachments
Screenshot (18.72 KB, image/png)
2009-09-21 14:55 PDT, Marshall Culpepper
no flags
Testcase HTML (985 bytes, text/html)
2009-09-21 15:01 PDT, Marshall Culpepper
no flags
Screenshot (69.18 KB, image/png)
2009-09-21 15:01 PDT, Marshall Culpepper
no flags
Disable subpixel antialiasing (2.14 KB, patch)
2009-12-21 11:08 PST, Martin Robinson
eric: review+
Patch to Cairo to correct the win32 rendering problem (1.66 KB, patch)
2009-12-22 21:00 PST, Brent Fulgham
no flags
Comparison of Cairo rendered glyphs with (right side) and without (left side) the cairo-win32-font patch. (46.29 KB, image/png)
2009-12-22 21:04 PST, Brent Fulgham
no flags
Marshall Culpepper
Comment 1 2009-09-21 15:01:07 PDT
Created attachment 39883 [details] Testcase HTML
Marshall Culpepper
Comment 2 2009-09-21 15:01:36 PDT
Created attachment 39884 [details] Screenshot
Martin Robinson
Comment 3 2009-12-21 11:08:11 PST
Created attachment 45338 [details] Disable subpixel antialiasing The rendering glitches are due to limitations in Cairo (or GDI) with rendering ClearType-quality (subpixel) anti-aliased fonts onto a non-DDB surface. The WebKit in Windows currently uses a DIBSection for the backing store.
WebKit Review Bot
Comment 4 2009-12-21 11:09:56 PST
style-queue ran check-webkit-style on attachment 45338 [details] without any errors.
Eric Seidel (no email)
Comment 5 2009-12-22 16:18:23 PST
OK.
Eric Seidel (no email)
Comment 6 2009-12-22 16:20:26 PST
Comment on attachment 45338 [details] Disable subpixel antialiasing Does the WinCairo build have pixel tests? If so, they'll have to be updated as a result of this change.
Brent Fulgham
Comment 7 2009-12-22 17:18:44 PST
Note that a very similar issue was discussed on the Cairo mailing list over three years ago. See http://lists.freedesktop.org/archives/cairo/2006-October/008081.html. While the referenced images seem to be lost in time, the commentary is illuminating: "note how the "1" digits that occur as the final character of a string have been partially cut off)" At the time, the resolution seemed to be to force use of the 24-bit backend for certain operations: "If I changed cairo_win32_surface_create() to use RGB24 also when BITSPIXEL is 32, the problem went away, as _cairo_win32_scaled_font_show_glyphs() then uses the "direct" branch. But this seemed like using a awfully large hammer to fix the problem."
Eric Seidel (no email)
Comment 8 2009-12-22 17:36:37 PST
Comment on attachment 45338 [details] Disable subpixel antialiasing I'm confused by bfulgam's recent comment. Removing cq+ for now.
Brent Fulgham
Comment 9 2009-12-22 17:40:33 PST
Thanks, Eric. I would prefer to hold off committing this change (even though I twisted Martin's arm into posting his patch), because what it does is remove the sub-pixel anti-aliasing resulting in very blocky text. I'd prefer to review this issue with the Cairo team to see if a 'correct' fix could be identified that would allow us to continue seeing ClearType rendered text, but resolve the trailing pixel problem Martin and Marshall identified.
Brent Fulgham
Comment 10 2009-12-22 17:41:00 PST
BTW, this issue is definitely confirmed. :-)
Brent Fulgham
Comment 11 2009-12-22 21:00:44 PST
Created attachment 45417 [details] Patch to Cairo to correct the win32 rendering problem Note: This is not a WebKit patch, but is shown here to help other implementors.
Brent Fulgham
Comment 12 2009-12-22 21:04:30 PST
Created attachment 45418 [details] Comparison of Cairo rendered glyphs with (right side) and without (left side) the cairo-win32-font patch.
Brent Fulgham
Comment 13 2009-12-22 21:06:24 PST
I believe removing the sub-pixel antialiasing is ill-advised. The true problem is in the underlying Cairo library. Making the recommended change (which is already in use on FireFox) will resolve the problem properly.
Note You need to log in before you can comment on or make changes to this bug.