Changeset 128968 in webkit


Ignore:
Timestamp:
Sep 18, 2012, 11:19:31 PM (13 years ago)
Author:
bashi@chromium.org
Message:

[Chromium] SkiaGetGlyphWidthAndExtents() should invert y-axis
https://bugs.webkit.org/show_bug.cgi?id=97067

Reviewed by Yuta Kitamura.

Invert skBounds.fTop and skBounds.height(). Don't call hb_font_set_ppem().

No new tests. Arabic shadda (U+0651) should be placed more higher when Arabic lam (U+0644) follows it.
Tests under svg/W3C-I18N contain such sequences so these tests cover this change.

  • platform/graphics/harfbuzz/ng/HarfBuzzNGFaceSkia.cpp:

(WebCore::SkiaGetGlyphWidthAndExtents):
(WebCore::HarfBuzzNGFace::createFont):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r128965 r128968  
     12012-09-18  Kenichi Ishibashi  <bashi@chromium.org>
     2
     3        [Chromium] SkiaGetGlyphWidthAndExtents() should invert y-axis
     4        https://bugs.webkit.org/show_bug.cgi?id=97067
     5
     6        Reviewed by Yuta Kitamura.
     7
     8        Invert skBounds.fTop and skBounds.height(). Don't call hb_font_set_ppem().
     9
     10        No new tests. Arabic shadda (U+0651) should be placed more higher when Arabic lam (U+0644) follows it.
     11        Tests under svg/W3C-I18N contain such sequences so these tests cover this change.
     12
     13        * platform/graphics/harfbuzz/ng/HarfBuzzNGFaceSkia.cpp:
     14        (WebCore::SkiaGetGlyphWidthAndExtents):
     15        (WebCore::HarfBuzzNGFace::createFont):
     16
    1172012-09-18  Kenichi Ishibashi  <bashi@chromium.org>
    218
  • trunk/Source/WebCore/platform/graphics/harfbuzz/ng/HarfBuzzNGFaceSkia.cpp

    r122911 r128968  
    6969        *width = SkiaScalarToHarfbuzzPosition(skWidth);
    7070    if (extents) {
     71        // Invert y-axis because Skia is y-grows-down but we set up harfbuzz to be y-grows-up.
    7172        extents->x_bearing = SkiaScalarToHarfbuzzPosition(skBounds.fLeft);
    72         // The extents are unused in harfbuzz now so we're unsure whether a negation is needed here. Revisit when we're sure.
    73         extents->y_bearing = SkiaScalarToHarfbuzzPosition(skBounds.fTop);
     73        extents->y_bearing = SkiaScalarToHarfbuzzPosition(-skBounds.fTop);
    7474        extents->width = SkiaScalarToHarfbuzzPosition(skBounds.width());
    75         extents->height = SkiaScalarToHarfbuzzPosition(skBounds.height());
     75        extents->height = SkiaScalarToHarfbuzzPosition(-skBounds.height());
    7676    }
    7777}
     
    172172    hb_font_set_funcs(font, harfbuzzSkiaGetFontFuncs(), paint, destroyPaint);
    173173    float size = m_platformData->size();
    174     if (floorf(size) == size)
    175         hb_font_set_ppem(font, size, size);
    176174    int scale = SkiaScalarToHarfbuzzPosition(size);
    177175    hb_font_set_scale(font, scale, scale);
Note: See TracChangeset for help on using the changeset viewer.