The Skia backend supports subpixel-positioned text (via SkPaint::setSubpixelText()), but we currently lack a way to enable it. I have a change that adds a useSubpixelPositioning field to FontRenderStyle and WebFontRenderStyle and makes FontPlatformDataHarfBuzz apply it to the SkPaint. It also renames the existing useSubpixel fields to useSubpixelRendering.
Created attachment 145665 [details] Patch
Please wait for approval from abarth@webkit.org, dglazkov@chromium.org, fishd@chromium.org, jamesr@chromium.org or tkent@chromium.org before submitting, as this patch contains changes to the Chromium public API. See also https://trac.webkit.org/wiki/ChromiumWebKitAPI.
+ // FontConfig doesn't provide parameters to configure whether subpixel + // positioning should be used or not. + out->useSubpixelPositioning = 2; A better default may be to enable this if hinting is off?
Comment on attachment 145665 [details] Patch Attachment 145665 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/12901496 New failing tests: fonts/fantasy.html fast/css/font-face-synthetic-bold-italic.html fast/text/fake-italic.html fonts/cursive.html fast/css/font-face-multiple-faces.html
Created attachment 145778 [details] Archive of layout-test-results from ec2-cr-linux-02 The attached test failures were seen while running run-webkit-tests on the chromium-ews. Bot: ec2-cr-linux-02 Port: <class 'webkitpy.common.config.ports.ChromiumXVFBPort'> Platform: Linux-2.6.35-28-virtual-x86_64-with-Ubuntu-10.10-maverick
#3: Not sure. That seems like a fairly substantial change in behavior; I'd prefer for this change to be a no-op for now except in the case where we explicitly request subpixel positioning.
Fair enough. I'll go request an element for this in Fontconfig...
Created attachment 145823 [details] Patch
The patch from #8 makes SimpleFontData::platformWidthForGlyph() again round widths, but now only when subpixel positioning is disabled. It looks like SkPaint::measureText() is returning fractional widths for fake-italics (and maybe also fake-bold?). Behdad suggests that Skia should be doing the rounding itself when subpixel positioning is disabled; I think that ensuring that this is the case within WebKit is safe.
Comment on attachment 145823 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=145823&action=review Code change looks fine. You'll have to wait for an API reviewer to take a look at this change. > Source/WebCore/ChangeLog:13 > + Pass setting to SkPaint in FontPlatformDataHarfBuzz and remove > + round() call when computing glyph widths in SimpleFontDataSkia. > + Please add a sentence about why there are no new tests. E.g., No new tests because this shouldn't change page rendering. It might be possible to write a gtest style test (see the Source/WebKit/chromium/tests directory) for what is exposed via WebFontRenderStyle.h, but I'm not sure if you can verify that the value was properly set. > Source/WebCore/platform/graphics/chromium/FontRenderStyle.h:49 > - useSubpixel(0) { } > + useSubpixelRendering(0), > + useSubpixelPositioning(0) { } Nit: WebKit style normally puts the , in front (lines up below the :).
Created attachment 145881 [details] Patch
Comment on attachment 145881 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=145881&action=review > LayoutTests/platform/chromium-linux/fast/text/chromium-linux-text-subpixel-positioning.html:3 > + <p>This test requires Chromium Linux <tt>test_shell</tt> in Nit: I would change this text to "This test requires DumpRenderTree, as that ..."
Created attachment 145890 [details] Patch
Comment on attachment 145890 [details] Patch Public WebKit API lgtm
Comment on attachment 145890 [details] Patch Attachment 145890 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/12897824 New failing tests: platform/chromium-linux/fast/text/chromium-linux-text-subpixel-positioning.html
Created attachment 146030 [details] Archive of layout-test-results from ec2-cr-linux-02 The attached test failures were seen while running run-webkit-tests on the chromium-ews. Bot: ec2-cr-linux-02 Port: <class 'webkitpy.common.config.ports.ChromiumXVFBPort'> Platform: Linux-2.6.35-28-virtual-x86_64-with-Ubuntu-10.10-maverick
Created attachment 146119 [details] Patch
Comment on attachment 146119 [details] Patch Adding a new entry to fonts.conf seems fine.
Comment on attachment 146119 [details] Patch Clearing flags on attachment: 146119 Committed r119732: <http://trac.webkit.org/changeset/119732>
All reviewed patches have been landed. Closing bug.
Reopening to attach new patch.
Created attachment 147334 [details] Patch
The new patch removes a field that was deprecated by this change.
(In reply to comment #21) > Reopening to attach new patch. Normally we use a new bug for each patch.
Comment on attachment 147334 [details] Patch Clearing flags on attachment: 147334 Committed r120363: <http://trac.webkit.org/changeset/120363>