Changeset 185842 in webkit


Ignore:
Timestamp:
Jun 22, 2015, 1:53:26 PM (10 years ago)
Author:
mmaxfield@apple.com
Message:

[iOS] Arabic text styled with Georgia is rendered as boxes
https://bugs.webkit.org/show_bug.cgi?id=145681
<rdar://problem/21169844>

Reviewed by Darin Adler.

Source/WebCore:

Georgia doesn't support Arabic, so we ask CoreText what font does support Arabic. It returns
TimesNewRomanPSMT. However, WebKit explicitly disallows this font on iOS. Therefore, instead
of using TimesNewRomanPSMT, we will simply just use GeezaPro.

Test: fast/text/arabic-times-new-roman.html

  • platform/graphics/ios/FontCacheIOS.mm:

(WebCore::FontCache::systemFallbackForCharacters):

  • platform/graphics/Font.h: Let FontCacheIOS call fontFamilyShouldNotBeUsedForArabic()
  • platform/graphics/cocoa/FontCocoa.mm:

(WebCore::fontFamilyShouldNotBeUsedForArabic):

LayoutTests:

  • fast/text/arabic-times-new-roman.html: Added.
  • platform/ios-simulator/fast/text/arabic-times-new-roman-expected.txt: Added.
  • platform/ios-simulator/fast/text/arabic-times-new-roman-expected.png: Added.
  • platform/mac-mavericks/fast/text/arabic-times-new-roman-expected.txt: Added.
  • platform/mac/fast/text/arabic-times-new-roman-expected.txt: Added.
  • platform/mac/fast/text/arabic-times-new-roman-expected.png: Added.
Location:
trunk
Files:
6 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r185838 r185842  
     12015-06-22  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        [iOS] Arabic text styled with Georgia is rendered as boxes
     4        https://bugs.webkit.org/show_bug.cgi?id=145681
     5        <rdar://problem/21169844>
     6
     7        Reviewed by Darin Adler.
     8
     9        * fast/text/arabic-times-new-roman.html: Added.
     10        * platform/ios-simulator/fast/text/arabic-times-new-roman-expected.txt: Added.
     11        * platform/ios-simulator/fast/text/arabic-times-new-roman-expected.png: Added.
     12        * platform/mac-mavericks/fast/text/arabic-times-new-roman-expected.txt: Added.
     13        * platform/mac/fast/text/arabic-times-new-roman-expected.txt: Added.
     14        * platform/mac/fast/text/arabic-times-new-roman-expected.png: Added.
     15
    1162015-06-22  Zalan Bujtas  <zalan@apple.com>
    217
  • trunk/Source/WebCore/ChangeLog

    r185841 r185842  
     12015-06-22  Myles C. Maxfield  <mmaxfield@apple.com>
     2
     3        [iOS] Arabic text styled with Georgia is rendered as boxes
     4        https://bugs.webkit.org/show_bug.cgi?id=145681
     5        <rdar://problem/21169844>
     6
     7        Reviewed by Darin Adler.
     8
     9        Georgia doesn't support Arabic, so we ask CoreText what font does support Arabic. It returns
     10        TimesNewRomanPSMT. However, WebKit explicitly disallows this font on iOS. Therefore, instead
     11        of using TimesNewRomanPSMT, we will simply just use GeezaPro.
     12
     13        Test: fast/text/arabic-times-new-roman.html
     14
     15        * platform/graphics/ios/FontCacheIOS.mm:
     16        (WebCore::FontCache::systemFallbackForCharacters):
     17        * platform/graphics/Font.h: Let FontCacheIOS call fontFamilyShouldNotBeUsedForArabic()
     18        * platform/graphics/cocoa/FontCocoa.mm:
     19        (WebCore::fontFamilyShouldNotBeUsedForArabic):
     20
    1212015-06-22  Alex Christensen  <achristensen@webkit.org>
    222
  • trunk/Source/WebCore/platform/graphics/Font.h

    r183153 r185842  
    323323};
    324324
     325#if PLATFORM(IOS)
     326bool fontFamilyShouldNotBeUsedForArabic(CFStringRef);
     327#endif
     328
    325329ALWAYS_INLINE FloatRect Font::boundsForGlyph(Glyph glyph) const
    326330{
  • trunk/Source/WebCore/platform/graphics/cocoa/FontCocoa.mm

    r185632 r185842  
    8080}
    8181#else
    82 static bool fontFamilyShouldNotBeUsedForArabic(CFStringRef fontFamilyName)
     82bool fontFamilyShouldNotBeUsedForArabic(CFStringRef fontFamilyName)
    8383{
    8484    if (!fontFamilyName)
  • trunk/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm

    r185205 r185842  
    447447#else
    448448    RetainPtr<CTFontDescriptorRef> fallbackFontDescriptor = adoptCF(CTFontCreatePhysicalFontDescriptorForCharactersWithLanguage(originalFontData->getCTFont(), characters, length, nullptr, nullptr));
    449     if (RetainPtr<CFStringRef> foundFontName = adoptCF(static_cast<CFStringRef>(CTFontDescriptorCopyAttribute(fallbackFontDescriptor.get(), kCTFontNameAttribute))))
     449    if (auto foundFontName = adoptCF(static_cast<CFStringRef>(CTFontDescriptorCopyAttribute(fallbackFontDescriptor.get(), kCTFontNameAttribute)))) {
     450        if (c >= 0x0600 && c <= 0x06ff) { // Arabic
     451            auto familyName = adoptCF(static_cast<CFStringRef>(CTFontDescriptorCopyAttribute(fallbackFontDescriptor.get(), kCTFontFamilyNameAttribute)));
     452            if (fontFamilyShouldNotBeUsedForArabic(familyName.get()))
     453                foundFontName = isFontWeightBold(description.weight()) ? CFSTR("GeezaPro-Bold") : CFSTR("GeezaPro");
     454        }
    450455        font = fontForFamily(description, foundFontName.get(), false);
     456    }
    451457#endif
    452458
Note: See TracChangeset for help on using the changeset viewer.