Changeset 176971 in webkit


Ignore:
Timestamp:
Dec 8, 2014 2:10:40 PM (9 years ago)
Author:
mmaxfield@apple.com
Message:

[iOS] Narrow non-breaking space does not fall back to a correct font
https://bugs.webkit.org/show_bug.cgi?id=139335

Reviewed by Enrica Casucci.

Source/WebCore:

Test: fast/text/narrow-non-breaking-space.html

  • platform/graphics/ios/FontCacheIOS.mm:

(WebCore::requiresCustomFallbackFont):
(WebCore::FontCache::getCustomFallbackFont):

LayoutTests:

  • fast/text/narrow-non-breaking-space-expected.html: Added.
  • fast/text/narrow-non-breaking-space.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r176957 r176971  
     12014-12-08  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        [iOS] Narrow non-breaking space does not fall back to a correct font
     4        https://bugs.webkit.org/show_bug.cgi?id=139335
     5
     6        Reviewed by Enrica Casucci.
     7
     8        * fast/text/narrow-non-breaking-space-expected.html: Added.
     9        * fast/text/narrow-non-breaking-space.html: Added.
     10
    1112014-12-08  Javier Fernandez  <jfernandez@igalia.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r176970 r176971  
     12014-12-08  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        [iOS] Narrow non-breaking space does not fall back to a correct font
     4        https://bugs.webkit.org/show_bug.cgi?id=139335
     5
     6        Reviewed by Enrica Casucci.
     7
     8        Test: fast/text/narrow-non-breaking-space.html
     9
     10        * platform/graphics/ios/FontCacheIOS.mm:
     11        (WebCore::requiresCustomFallbackFont):
     12        (WebCore::FontCache::getCustomFallbackFont):
     13
    1142014-12-08  Daniel Bates  <dabates@apple.com>
    215
  • trunk/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm

    r176229 r176971  
    5151static inline bool requiresCustomFallbackFont(const UInt32 character)
    5252{
    53     return character == AppleLogo || character == blackCircle;
     53    return character == AppleLogo || character == blackCircle || character == narrowNonBreakingSpace;
    5454}
    5555
     
    488488{
    489489    ASSERT(requiresCustomFallbackFont(c));
    490     if (c == AppleLogo) {
    491         static NeverDestroyed<AtomicString> helveticaFamily("Helvetica Neue", AtomicString::ConstructFromLiteral);
    492         return getCachedFontPlatformData(description, helveticaFamily);
    493     }
    494     if (c == blackCircle) {
    495         static NeverDestroyed<AtomicString> lockClockFamily("LockClock-Light", AtomicString::ConstructFromLiteral);
    496         return getCachedFontPlatformData(description, lockClockFamily);
    497     }
    498     return nullptr;
     490
     491    static NeverDestroyed<AtomicString> helveticaFamily("Helvetica Neue", AtomicString::ConstructFromLiteral);
     492    static NeverDestroyed<AtomicString> lockClockFamily("LockClock-Light", AtomicString::ConstructFromLiteral);
     493    static NeverDestroyed<AtomicString> timesNewRomanPSMTFamily("TimesNewRomanPSMT", AtomicString::ConstructFromLiteral);
     494
     495    AtomicString* family = nullptr;
     496    switch (c) {
     497    case AppleLogo:
     498        family = &helveticaFamily.get();
     499        break;
     500    case blackCircle:
     501        family = &lockClockFamily.get();
     502        break;
     503    case narrowNonBreakingSpace:
     504        family = &timesNewRomanPSMTFamily.get();
     505        break;
     506    default:
     507        ASSERT_NOT_REACHED();
     508        return nullptr;
     509    }
     510    ASSERT(family);
     511    if (!family)
     512        return nullptr;
     513    return getCachedFontPlatformData(description, *family);
    499514}
    500515
Note: See TracChangeset for help on using the changeset viewer.