[Webkit-unassigned] [Bug 88684] New: [Chromium] Sometimes bottom of text is truncated when page has a fractional scale

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jun 8 13:37:44 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=88684

           Summary: [Chromium] Sometimes bottom of text is truncated when
                    page has a fractional scale
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
        OS/Version: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Platform
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: wangxianzhu at chromium.org
                CC: tony at chromium.org, jamesr at chromium.org
            Blocks: 66687


The issue was found on chromium-android. The following code causes the issue:

In SimpleFontData::platformInit() (Source/WebCore/WebCore/platform/graphics/skia/SimpleFontDataSkia.cpp)
        SkScalar height = -metrics.fAscent + metrics.fDescent + metrics.fLeading;
        ascent = SkScalarRound(-metrics.fAscent);
        descent = SkScalarRound(height) - ascent;

When the page has a fractional scale, the ascent and descent part of the fonts might be fractional. If the descent part is scaled down, the bottom of the text might be truncated when displayed.

We added the following code to fix the issue:

        // If the descent is rounded down, the descent part of the glyph may be truncated
        // when displayed. To avoid that, borrow 1 unit from the ascent.
        if (descent < SkScalarToFloat(metrics.fDescent) && ascent >= 1) {
            descent++;
            ascent--;
        }

Will create a formal patch soon. It'll need some time to create a layout test for it.

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list