Changeset 206896 in webkit


Ignore:
Timestamp:
Oct 6, 2016 8:21:27 PM (8 years ago)
Author:
mmaxfield@apple.com
Message:

Variation fonts don't affect glyph advances
https://bugs.webkit.org/show_bug.cgi?id=163093

Reviewed by Darin Adler.

Source/WebCore:

Work around known bug <rdar://problem/28662086>. For variation fonts,
CTFontGetAdvancesForGlyphs() gives correct answers but
CTFontGetUnsummedAdvancesForGlyphsAndStyle() doesn't.

Test: fast/text/variations/advances.html

  • platform/graphics/FontPlatformData.h:

(WebCore::FontPlatformData::hasVariations):

  • platform/graphics/cocoa/FontCocoa.mm:

(WebCore::Font::platformWidthForGlyph):

  • platform/graphics/cocoa/FontPlatformDataCocoa.mm:

(WebCore::FontPlatformData::FontPlatformData):

LayoutTests:

  • platform/ios-simulator/TestExpectations: Mark the test

as failing on iOS because that OS doesn't have Skia.

  • fast/text/variations/advances-expected.txt: Added.
  • fast/text/variations/advances.html: Added.
Location:
trunk
Files:
2 added
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r206895 r206896  
     12016-10-06  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        Variation fonts don't affect glyph advances
     4        https://bugs.webkit.org/show_bug.cgi?id=163093
     5
     6        Reviewed by Darin Adler.
     7
     8        * platform/ios-simulator/TestExpectations: Mark the test
     9        as failing on iOS because that OS doesn't have Skia.
     10        * fast/text/variations/advances-expected.txt: Added.
     11        * fast/text/variations/advances.html: Added.
     12
    1132016-10-06  Gyuyoung Kim  <gyuyoung.kim@webkit.org>
    214
  • trunk/LayoutTests/platform/ios-simulator/TestExpectations

    r206864 r206896  
    26732673
    26742674webkit.org/b/163009 media/modern-media-controls/icon-button/icon-button-active-state.html [ Failure ]
     2675
     2676# This variation font test requires Skia which isn't available on iOS.
     2677webkit.org/b/163093 fast/text/variations/advances.html [ Failure ]
  • trunk/Source/WebCore/ChangeLog

    r206894 r206896  
     12016-10-06  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        Variation fonts don't affect glyph advances
     4        https://bugs.webkit.org/show_bug.cgi?id=163093
     5
     6        Reviewed by Darin Adler.
     7
     8        Work around known bug <rdar://problem/28662086>. For variation fonts,
     9        CTFontGetAdvancesForGlyphs() gives correct answers but
     10        CTFontGetUnsummedAdvancesForGlyphsAndStyle() doesn't.
     11
     12        Test: fast/text/variations/advances.html
     13
     14        * platform/graphics/FontPlatformData.h:
     15        (WebCore::FontPlatformData::hasVariations):
     16        * platform/graphics/cocoa/FontCocoa.mm:
     17        (WebCore::Font::platformWidthForGlyph):
     18        * platform/graphics/cocoa/FontPlatformDataCocoa.mm:
     19        (WebCore::FontPlatformData::FontPlatformData):
     20
    1212016-10-06  Commit Queue  <commit-queue@webkit.org>
    222
  • trunk/Source/WebCore/platform/graphics/FontPlatformData.h

    r206597 r206896  
    139139#endif
    140140
     141    bool hasVariations() const { return m_hasVariations; }
     142
    141143#if USE(CG) && (PLATFORM(WIN) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED < 101200) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED < 100000))
    142144    CGFontRef cgFont() const { return m_cgFont.get(); }
     
    278280    bool m_isHashTableDeletedValue { false };
    279281    bool m_isSystemFont { false };
     282    bool m_hasVariations { false };
    280283    // The values above are common to all ports
    281284
  • trunk/Source/WebCore/platform/graphics/cocoa/FontCocoa.mm

    r205883 r206896  
    625625    if (platformData().size()) {
    626626        CTFontOrientation orientation = horizontal || m_isBrokenIdeographFallback ? kCTFontOrientationHorizontal : kCTFontOrientationVertical;
    627         // FIXME: Remove this special-casing when <rdar://problem/28197291> is fixed.
    628         if (CTFontIsAppleColorEmoji(m_platformData.ctFont()))
     627        // FIXME: Remove this special-casing when <rdar://problem/28197291> and <rdar://problem/28662086> are fixed.
     628        if (CTFontIsAppleColorEmoji(m_platformData.ctFont()) || m_platformData.hasVariations())
    629629            CTFontGetAdvancesForGlyphs(m_platformData.ctFont(), orientation, &glyph, &advance, 1);
    630630        else
  • trunk/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm

    r206839 r206896  
    5151    m_isColorBitmapFont = CTFontGetSymbolicTraits(font) & kCTFontTraitColorGlyphs;
    5252    m_isSystemFont = CTFontDescriptorIsSystemUIFont(adoptCF(CTFontCopyFontDescriptor(m_font.get())).get());
     53    auto variations = adoptCF(static_cast<CFDictionaryRef>(CTFontCopyAttribute(font, kCTFontVariationAttribute)));
     54    m_hasVariations = variations && CFDictionaryGetCount(variations.get());
    5355
    5456#if PLATFORM(IOS)
Note: See TracChangeset for help on using the changeset viewer.