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.
Created attachment 39883 [details] Testcase HTML
Created attachment 39884 [details] Screenshot
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.
style-queue ran check-webkit-style on attachment 45338 [details] without any errors.
OK.
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.
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."
Comment on attachment 45338 [details] Disable subpixel antialiasing I'm confused by bfulgam's recent comment. Removing cq+ for now.
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.
BTW, this issue is definitely confirmed. :-)
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.
Created attachment 45418 [details] Comparison of Cairo rendered glyphs with (right side) and without (left side) the cairo-win32-font patch.
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.