Title: [188726] trunk/Source/WebCore
Revision
188726
Author
[email protected]
Date
2015-08-20 18:33:37 -0700 (Thu, 20 Aug 2015)

Log Message

[iOS] Delete dead code
https://bugs.webkit.org/show_bug.cgi?id=148278

Reviewed by Dean Jackson.

No new tests because there is no behavior change.

* platform/graphics/cocoa/FontCocoa.mm:
(WebCore::Font::platformInit):
* platform/graphics/ios/FontCacheIOS.mm:
(WebCore::copyFontCharacterSet): Deleted.
(WebCore::appleColorEmojiCharacterSet): Deleted.
(WebCore::phoneFallbackCharacterSet): Deleted.
(WebCore::languageSpecificFallbackFont): Deleted.
(WebCore::FontCache::systemFallbackForCharacters): Deleted.

Modified Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (188725 => 188726)


--- trunk/Source/WebCore/ChangeLog	2015-08-21 01:31:51 UTC (rev 188725)
+++ trunk/Source/WebCore/ChangeLog	2015-08-21 01:33:37 UTC (rev 188726)
@@ -1,3 +1,21 @@
+2015-08-20  Myles C. Maxfield  <[email protected]>
+
+        [iOS] Delete dead code
+        https://bugs.webkit.org/show_bug.cgi?id=148278
+
+        Reviewed by Dean Jackson.
+
+        No new tests because there is no behavior change.
+
+        * platform/graphics/cocoa/FontCocoa.mm:
+        (WebCore::Font::platformInit):
+        * platform/graphics/ios/FontCacheIOS.mm:
+        (WebCore::copyFontCharacterSet): Deleted.
+        (WebCore::appleColorEmojiCharacterSet): Deleted.
+        (WebCore::phoneFallbackCharacterSet): Deleted.
+        (WebCore::languageSpecificFallbackFont): Deleted.
+        (WebCore::FontCache::systemFallbackForCharacters): Deleted.
+
 2015-08-20  Tim Horton  <[email protected]>
 
         Unreviewed, rolling out r188712.

Modified: trunk/Source/WebCore/platform/graphics/cocoa/FontCocoa.mm (188725 => 188726)


--- trunk/Source/WebCore/platform/graphics/cocoa/FontCocoa.mm	2015-08-21 01:31:51 UTC (rev 188725)
+++ trunk/Source/WebCore/platform/graphics/cocoa/FontCocoa.mm	2015-08-21 01:33:37 UTC (rev 188726)
@@ -225,50 +225,18 @@
     m_syntheticBoldOffset = m_platformData.m_syntheticBold ? ceilf(m_platformData.size()  / 24.0f) : 0.f;
     m_spaceGlyph = 0;
     m_spaceWidth = 0;
-    unsigned unitsPerEm;
-    float ascent;
-    float descent;
-    float capHeight;
-    float lineGap;
-    float lineSpacing;
-    float xHeight;
-    RetainPtr<CFStringRef> familyName;
-    if (CTFontRef ctFont = m_platformData.font()) {
-        FontServicesIOS fontService(ctFont);
-        ascent = ceilf(fontService.ascent());
-        descent = ceilf(fontService.descent());
-        lineSpacing = fontService.lineSpacing();
-        lineGap = fontService.lineGap();
-        xHeight = fontService.xHeight();
-        capHeight = fontService.capHeight();
-        unitsPerEm = fontService.unitsPerEm();
-        familyName = adoptCF(CTFontCopyFamilyName(ctFont));
-    } else {
-        // FIXME: This else block is dead code. Remove it.
-        CGFontRef cgFont = m_platformData.cgFont();
 
-        unitsPerEm = CGFontGetUnitsPerEm(cgFont);
+    CTFontRef ctFont = m_platformData.font();
+    FontServicesIOS fontService(ctFont);
+    m_fontMetrics.setUnitsPerEm(fontService.unitsPerEm());
+    m_fontMetrics.setAscent(ceilf(fontService.ascent()));
+    m_fontMetrics.setDescent(ceilf(fontService.descent()));
+    m_fontMetrics.setLineGap(fontService.lineGap());
+    m_fontMetrics.setLineSpacing(fontService.lineSpacing());
+    m_fontMetrics.setXHeight(fontService.xHeight());
+    m_fontMetrics.setCapHeight(fontService.capHeight());
+    m_shouldNotBeUsedForArabic = fontFamilyShouldNotBeUsedForArabic(adoptCF(CTFontCopyFamilyName(ctFont)).get());
 
-        float pointSize = m_platformData.size();
-        ascent = lroundf(scaleEmToUnits(CGFontGetAscent(cgFont), unitsPerEm) * pointSize);
-        descent = lroundf(-scaleEmToUnits(-abs(CGFontGetDescent(cgFont)), unitsPerEm) * pointSize);
-        lineGap = lroundf(scaleEmToUnits(CGFontGetLeading(cgFont), unitsPerEm) * pointSize);
-        xHeight = scaleEmToUnits(CGFontGetXHeight(cgFont), unitsPerEm) * pointSize;
-        capHeight = scaleEmToUnits(CGFontGetCapHeight(cgFont), unitsPerEm) * pointSize;
-
-        lineSpacing = ascent + descent + lineGap;
-        familyName = adoptCF(CGFontCopyFamilyName(cgFont));
-    }
-
-    m_fontMetrics.setUnitsPerEm(unitsPerEm);
-    m_fontMetrics.setAscent(ascent);
-    m_fontMetrics.setDescent(descent);
-    m_fontMetrics.setLineGap(lineGap);
-    m_fontMetrics.setLineSpacing(lineSpacing);
-    m_fontMetrics.setXHeight(xHeight);
-    m_fontMetrics.setCapHeight(capHeight);
-    m_shouldNotBeUsedForArabic = fontFamilyShouldNotBeUsedForArabic(familyName.get());
-
     if (platformData().orientation() == Vertical && !isTextOrientationFallback())
         m_hasVerticalGlyphs = fontHasVerticalGlyphs(m_platformData.ctFont());
 

Modified: trunk/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm (188725 => 188726)


--- trunk/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm	2015-08-21 01:31:51 UTC (rev 188725)
+++ trunk/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm	2015-08-21 01:33:37 UTC (rev 188726)
@@ -54,28 +54,6 @@
     return character == AppleLogo || character == blackCircle || character == narrowNonBreakingSpace;
 }
 
-#if __IPHONE_OS_VERSION_MIN_REQUIRED < 90000
-static CFCharacterSetRef copyFontCharacterSet(CFStringRef fontName)
-{
-    // The size, 10, is arbitrary.
-    RetainPtr<CTFontDescriptorRef> fontDescriptor = adoptCF(CTFontDescriptorCreateWithNameAndSize(fontName, 10));
-    RetainPtr<CTFontRef> font = adoptCF(CTFontCreateWithFontDescriptor(fontDescriptor.get(), 10, nullptr));
-    return (CFCharacterSetRef)CTFontDescriptorCopyAttribute(fontDescriptor.get(), kCTFontCharacterSetAttribute);
-}
-
-static CFCharacterSetRef appleColorEmojiCharacterSet()
-{
-    static CFCharacterSetRef characterSet = copyFontCharacterSet(CFSTR("AppleColorEmoji"));
-    return characterSet;
-}
-
-static CFCharacterSetRef phoneFallbackCharacterSet()
-{
-    static CFCharacterSetRef characterSet = copyFontCharacterSet(CFSTR(".PhoneFallback"));
-    return characterSet;
-}
-#endif
-
 PassRefPtr<Font> FontCache::getSystemFontFallbackForCharacters(const FontDescription& description, const Font* originalFontData, const UChar* characters, unsigned length)
 {
     const FontPlatformData& platformData = originalFontData->platformData();
@@ -108,105 +86,6 @@
     return fontForPlatformData(alternateFont);
 }
 
-#if __IPHONE_OS_VERSION_MIN_REQUIRED < 90000
-enum class LanguageSpecificFont {
-    None,
-    ChineseJapanese,
-    Korean,
-    Cyrillic,
-    Arabic,
-    Hebrew,
-    Indic,
-    Thai,
-    Lao,
-    Tibetan,
-    CanadianAboriginalSyllabic,
-    Khmer,
-    Emoji,
-};
-
-static LanguageSpecificFont languageSpecificFallbackFont(UChar32 c)
-{
-    static bool isGB18030ComplianceRequired = wkIsGB18030ComplianceRequired();
-
-    // The following ranges are Korean Hangul and should be rendered by AppleSDGothicNeo
-    // U+1100 - U+11FF
-    // U+3130 - U+318F
-    // U+AC00 - U+D7A3
-
-    // These are Cyrillic and should be rendered by Helvetica Neue
-    // U+0400 - U+052F
-
-    if (c < 0x400)
-        return LanguageSpecificFont::None;
-    if (c < 0x530)
-        return LanguageSpecificFont::Cyrillic;
-    if (c < 0x590)
-        return LanguageSpecificFont::None;
-    if (c < 0x600)
-        return LanguageSpecificFont::Hebrew;
-    if (c < 0x700)
-        return LanguageSpecificFont::Arabic;
-    if (c < 0x900)
-        return LanguageSpecificFont::None;
-    if (c < 0xE00)
-        return LanguageSpecificFont::Indic;
-    if (c < 0xE80)
-        return LanguageSpecificFont::Thai;
-    if (c < 0x0F00)
-        return LanguageSpecificFont::Lao;
-    if (c < 0x1000)
-        return LanguageSpecificFont::Tibetan;
-    if (c < 0x1100)
-        return LanguageSpecificFont::None;
-    if (c < 0x1200)
-        return LanguageSpecificFont::Korean;
-    if (c < 0x1400)
-        return LanguageSpecificFont::None;
-    if (c < 0x1780)
-        return LanguageSpecificFont::CanadianAboriginalSyllabic;
-    if (c < 0x1800)
-        return LanguageSpecificFont::Khmer;
-    if (c < 0x2E80)
-        return LanguageSpecificFont::None;
-    if (c < 0x3130)
-        return LanguageSpecificFont::ChineseJapanese;
-    if (c < 0x3190)
-        return LanguageSpecificFont::Korean;
-    if (c < 0xAC00)
-        return LanguageSpecificFont::ChineseJapanese;
-    if (c < 0xD7A4)
-        return LanguageSpecificFont::Korean;
-    if (c < 0xE000)
-        return LanguageSpecificFont::ChineseJapanese;
-    if (c < 0xE600)
-        return isGB18030ComplianceRequired ? LanguageSpecificFont::ChineseJapanese : LanguageSpecificFont::Emoji;
-    if (c < 0xE865 && isGB18030ComplianceRequired)
-        return LanguageSpecificFont::ChineseJapanese;
-    if (c < 0xF900)
-        return LanguageSpecificFont::None;
-    if (c < 0xFB00)
-        return LanguageSpecificFont::ChineseJapanese;
-    if (c < 0xFB50)
-        return LanguageSpecificFont::None;
-    if (c < 0xFE00)
-        return LanguageSpecificFont::Arabic;
-    if (c < 0xFE20)
-        return LanguageSpecificFont::None;
-    if (c < 0xFE70)
-        return LanguageSpecificFont::ChineseJapanese;
-    if (c < 0xFF00)
-        return LanguageSpecificFont::Arabic;
-    if (c < 0xFFF0)
-        return LanguageSpecificFont::ChineseJapanese;
-    if (c < 0x20000)
-        return LanguageSpecificFont::None;
-    if (c < 0x30000)
-        return LanguageSpecificFont::ChineseJapanese;
-    return LanguageSpecificFont::None;
-}
-#endif
-
 RefPtr<Font> FontCache::systemFallbackForCharacters(const FontDescription& description, const Font* originalFontData, bool, const UChar* characters, unsigned length)
 {
     // Unlike OS X, our fallback font on iPhone is Arial Unicode, which doesn't have some apple-specific glyphs like F8FF.
@@ -231,229 +110,6 @@
 
     RefPtr<Font> font;
 
-#if __IPHONE_OS_VERSION_MIN_REQUIRED < 90000
-    LanguageSpecificFont languageSpecificFont = LanguageSpecificFont::None;
-    if (length)
-        languageSpecificFont = languageSpecificFallbackFont(c);
-
-    switch (languageSpecificFont) {
-    case LanguageSpecificFont::ChineseJapanese: {
-        // By default, Chinese font is preferred, fall back on Japanese.
-
-        enum CJKFontVariant {
-            kCJKFontUseHiragino = 0,
-            kCJKFontUseSTHeitiSC,
-            kCJKFontUseSTHeitiTC,
-            kCJKFontUseSTHeitiJ,
-            kCJKFontUseSTHeitiK,
-            kCJKFontsUseHKGPW3UI
-        };
-
-        static NeverDestroyed<AtomicString> plainHiragino("HiraKakuProN-W3", AtomicString::ConstructFromLiteral);
-        static NeverDestroyed<AtomicString> plainSTHeitiSC("STHeitiSC-Light", AtomicString::ConstructFromLiteral);
-        static NeverDestroyed<AtomicString> plainSTHeitiTC("STHeitiTC-Light", AtomicString::ConstructFromLiteral);
-        static NeverDestroyed<AtomicString> plainSTHeitiJ("STHeitiJ-Light", AtomicString::ConstructFromLiteral);
-        static NeverDestroyed<AtomicString> plainSTHeitiK("STHeitiK-Light", AtomicString::ConstructFromLiteral);
-        static NeverDestroyed<AtomicString> plainHKGPW3UI("HKGPW3UI", AtomicString::ConstructFromLiteral);
-        static AtomicString* cjkPlain[] = {     
-            &plainHiragino.get(),
-            &plainSTHeitiSC.get(),
-            &plainSTHeitiTC.get(),
-            &plainSTHeitiJ.get(),
-            &plainSTHeitiK.get(),
-            &plainHKGPW3UI.get(),
-        };
-
-        static NeverDestroyed<AtomicString> boldHiragino("HiraKakuProN-W6", AtomicString::ConstructFromLiteral);
-        static NeverDestroyed<AtomicString> boldSTHeitiSC("STHeitiSC-Medium", AtomicString::ConstructFromLiteral);
-        static NeverDestroyed<AtomicString> boldSTHeitiTC("STHeitiTC-Medium", AtomicString::ConstructFromLiteral);
-        static NeverDestroyed<AtomicString> boldSTHeitiJ("STHeitiJ-Medium", AtomicString::ConstructFromLiteral);
-        static NeverDestroyed<AtomicString> boldSTHeitiK("STHeitiK-Medium", AtomicString::ConstructFromLiteral);
-        static NeverDestroyed<AtomicString> boldHKGPW3UI("HKGPW3UI", AtomicString::ConstructFromLiteral);
-        static AtomicString* cjkBold[] = {  
-            &boldHiragino.get(),
-            &boldSTHeitiSC.get(),
-            &boldSTHeitiTC.get(),
-            &boldSTHeitiJ.get(),
-            &boldSTHeitiK.get(),
-            &boldHKGPW3UI.get(),
-        };
-
-        // Default below is for Simplified Chinese user: zh-Hans - note that Hiragino is the
-        // the secondary font as we want its for Hiragana and Katakana. The other CJK fonts
-        // do not, and should not, contain Hiragana or Katakana glyphs.
-        static CJKFontVariant preferredCJKFont = kCJKFontUseSTHeitiSC;
-        static CJKFontVariant secondaryCJKFont = kCJKFontsUseHKGPW3UI;
-
-        static bool CJKFontInitialized;
-        if (!CJKFontInitialized) {
-            CJKFontInitialized = true;
-            // Testing: languageName = (CFStringRef)@"ja";
-            NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
-            NSArray *languages = [defaults stringArrayForKey:@"AppleLanguages"];
-
-            if (languages) {
-                for (NSString *language in languages) {
-                    RetainPtr<CFStringRef> languageName = adoptCF(CFLocaleCreateCanonicalLanguageIdentifierFromString(nullptr, (CFStringRef)language));
-                    if (CFEqual(languageName.get(), CFSTR("zh-Hans")))
-                        break; // Simplified Chinese - default settings
-                    else if (CFEqual(languageName.get(), CFSTR("ja"))) {
-                        preferredCJKFont = kCJKFontUseHiragino; // Japanese - prefer Hiragino and STHeiti Japanse Variant
-                        secondaryCJKFont = kCJKFontUseSTHeitiJ;
-                        break;
-                    } else if (CFEqual(languageName.get(), CFSTR("ko"))) {
-                        preferredCJKFont = kCJKFontUseSTHeitiK; // Korean - prefer STHeiti Korean Variant 
-                        break;
-                    } else if (CFEqual(languageName.get(), CFSTR("zh-Hant"))) {
-                        preferredCJKFont = kCJKFontUseSTHeitiTC; // Traditional Chinese - prefer STHeiti Traditional Variant
-                        break;
-                    }
-                }
-            }
-        }
-
-        font = fontForFamily(description, isFontWeightBold(description.weight()) ? *cjkBold[preferredCJKFont] : *cjkPlain[preferredCJKFont], false);
-        bool useSecondaryFont = true;
-        if (font) {
-            CGGlyph glyphs[2];
-            // CGFontGetGlyphsForUnichars takes UTF-16 buffer. Should only be 1 codepoint but since we may pass in two UTF-16 characters,
-            // make room for 2 glyphs just to be safe.
-            CGFontGetGlyphsForUnichars(font->platformData().cgFont(), characters, glyphs, length);
-
-            useSecondaryFont = (glyphs[0] == 0);
-        }
-
-        if (useSecondaryFont)
-            font = fontForFamily(description, isFontWeightBold(description.weight()) ? *cjkBold[secondaryCJKFont] : *cjkPlain[secondaryCJKFont], false);
-        break;
-    }
-    case LanguageSpecificFont::Korean: {
-        static NeverDestroyed<AtomicString> koreanPlain("AppleSDGothicNeo-Medium", AtomicString::ConstructFromLiteral);
-        static NeverDestroyed<AtomicString> koreanBold("AppleSDGothicNeo-Bold", AtomicString::ConstructFromLiteral);
-        font = fontForFamily(description, isFontWeightBold(description.weight()) ? koreanBold : koreanPlain, false);
-        break;
-    }
-    case LanguageSpecificFont::Cyrillic: {
-        static NeverDestroyed<AtomicString> cyrillicPlain("HelveticaNeue", AtomicString::ConstructFromLiteral);
-        static NeverDestroyed<AtomicString> cyrillicBold("HelveticaNeue-Bold", AtomicString::ConstructFromLiteral);
-        font = fontForFamily(description, isFontWeightBold(description.weight()) ? cyrillicBold : cyrillicPlain, false);
-        break;
-    }
-    case LanguageSpecificFont::Arabic: {
-        static NeverDestroyed<AtomicString> arabicPlain("GeezaPro", AtomicString::ConstructFromLiteral);
-        static NeverDestroyed<AtomicString> arabicBold("GeezaPro-Bold", AtomicString::ConstructFromLiteral);
-        font = fontForFamily(description, isFontWeightBold(description.weight()) ? arabicBold : arabicPlain, false);
-        break;
-    }
-    case LanguageSpecificFont::Hebrew: {
-        static NeverDestroyed<AtomicString> hebrewPlain("ArialHebrew", AtomicString::ConstructFromLiteral);
-        static NeverDestroyed<AtomicString> hebrewBold("ArialHebrew-Bold", AtomicString::ConstructFromLiteral);
-        font = fontForFamily(description, isFontWeightBold(description.weight()) ? hebrewBold : hebrewPlain, false);
-        break;
-    }
-    case LanguageSpecificFont::Indic: {
-        static NeverDestroyed<AtomicString> devanagariFont("KohinoorDevanagari-Book", AtomicString::ConstructFromLiteral);
-        static NeverDestroyed<AtomicString> bengaliFont("BanglaSangamMN", AtomicString::ConstructFromLiteral);
-        static NeverDestroyed<AtomicString> gurmukhiFont("GurmukhiMN", AtomicString::ConstructFromLiteral); // Might be replaced in a future release with a Sangam version.
-        static NeverDestroyed<AtomicString> gujaratiFont("GujaratiSangamMN", AtomicString::ConstructFromLiteral);
-        static NeverDestroyed<AtomicString> oriyaFont("OriyaSangamMN", AtomicString::ConstructFromLiteral);
-        static NeverDestroyed<AtomicString> tamilFont("TamilSangamMN", AtomicString::ConstructFromLiteral);
-        static NeverDestroyed<AtomicString> teluguFont("TeluguSangamMN", AtomicString::ConstructFromLiteral);
-        static NeverDestroyed<AtomicString> kannadaFont("KannadaSangamMN", AtomicString::ConstructFromLiteral);
-        static NeverDestroyed<AtomicString> malayalamFont("MalayalamSangamMN", AtomicString::ConstructFromLiteral);
-        static NeverDestroyed<AtomicString> sinhalaFont("SinhalaSangamMN", AtomicString::ConstructFromLiteral);
-
-        static NeverDestroyed<AtomicString> devanagariFontBold("KohinoorDevanagari-Medium", AtomicString::ConstructFromLiteral);
-        static NeverDestroyed<AtomicString> bengaliFontBold("BanglaSangamMN-Bold", AtomicString::ConstructFromLiteral);
-        static NeverDestroyed<AtomicString> gurmukhiFontBold("GurmukhiMN-Bold", AtomicString::ConstructFromLiteral); // Might be replaced in a future release with a Sangam version.
-        static NeverDestroyed<AtomicString> gujaratiFontBold("GujaratiSangamMN-Bold", AtomicString::ConstructFromLiteral);
-        static NeverDestroyed<AtomicString> oriyaFontBold("OriyaSangamMN-Bold", AtomicString::ConstructFromLiteral);
-        static NeverDestroyed<AtomicString> tamilFontBold("TamilSangamMN-Bold", AtomicString::ConstructFromLiteral);
-        static NeverDestroyed<AtomicString> teluguFontBold("TeluguSangamMN-Bold", AtomicString::ConstructFromLiteral);
-        static NeverDestroyed<AtomicString> kannadaFontBold("KannadaSangamMN-Bold", AtomicString::ConstructFromLiteral);
-        static NeverDestroyed<AtomicString> malayalamFontBold("MalayalamSangamMN-Bold", AtomicString::ConstructFromLiteral);
-        static NeverDestroyed<AtomicString> sinhalaFontBold("SinhalaSangamMN-Bold", AtomicString::ConstructFromLiteral);
-
-        static AtomicString* indicUnicodePageFonts[] = {
-            &devanagariFont.get(),
-            &bengaliFont.get(),
-            &gurmukhiFont.get(),
-            &gujaratiFont.get(),
-            &oriyaFont.get(),
-            &tamilFont.get(),
-            &teluguFont.get(),
-            &kannadaFont.get(),
-            &malayalamFont.get(),
-            &sinhalaFont.get()
-        };
-
-        static AtomicString* indicUnicodePageFontsBold[] = {
-            &devanagariFontBold.get(),
-            &bengaliFontBold.get(),
-            &gurmukhiFontBold.get(),
-            &gujaratiFontBold.get(),
-            &oriyaFontBold.get(),
-            &tamilFontBold.get(),
-            &teluguFontBold.get(),
-            &kannadaFontBold.get(),
-            &malayalamFontBold.get(),
-            &sinhalaFontBold.get()
-        };
-
-        uint32_t indicPageOrderIndex = (c - 0x0900) / 0x0080; // Indic scripts start at 0x0900 in Unicode. Each script is allocalted a block of 0x80 characters.
-        if (indicPageOrderIndex < (sizeof(indicUnicodePageFonts) / sizeof(AtomicString*))) {
-            AtomicString* indicFontString = isFontWeightBold(description.weight()) ? indicUnicodePageFontsBold[indicPageOrderIndex] : indicUnicodePageFonts[indicPageOrderIndex];
-            if (indicFontString)
-                font = fontForFamily(description, *indicFontString, false);
-        }
-        break;
-    }
-    case LanguageSpecificFont::Thai: {
-        static NeverDestroyed<AtomicString> thaiPlain("Thonburi", AtomicString::ConstructFromLiteral);
-        static NeverDestroyed<AtomicString> thaiBold("Thonburi-Bold", AtomicString::ConstructFromLiteral);
-        font = fontForFamily(description, isFontWeightBold(description.weight()) ? thaiBold : thaiPlain, false);
-        break;
-    }
-    case LanguageSpecificFont::Tibetan: {
-        static NeverDestroyed<AtomicString> tibetanPlain("Kailasa", AtomicString::ConstructFromLiteral);
-        static NeverDestroyed<AtomicString> tibetanBold("Kailasa-Bold", AtomicString::ConstructFromLiteral);
-        font = fontForFamily(description, isFontWeightBold(description.weight()) ? tibetanBold : tibetanPlain, false);
-        break;
-    }
-    case LanguageSpecificFont::CanadianAboriginalSyllabic: {
-        static NeverDestroyed<AtomicString> casPlain("EuphemiaUCAS", AtomicString::ConstructFromLiteral);
-        static NeverDestroyed<AtomicString> casBold("EuphemiaUCAS-Bold", AtomicString::ConstructFromLiteral);
-        font = fontForFamily(description, isFontWeightBold(description.weight()) ? casBold : casPlain, false);
-        break;
-    }
-    case LanguageSpecificFont::Khmer: {
-        static NeverDestroyed<AtomicString> khmer("KhmerSangamMN", AtomicString::ConstructFromLiteral);
-        font = fontForFamily(description, khmer, false);
-        break;
-    }
-    case LanguageSpecificFont::Lao: {
-        static NeverDestroyed<AtomicString> lao("LaoSangamMN", AtomicString::ConstructFromLiteral);
-        font = fontForFamily(description, lao, false);
-        break;
-    }
-    default: {
-        static NeverDestroyed<AtomicString> appleColorEmoji("AppleColorEmoji", AtomicString::ConstructFromLiteral);
-        bool useEmojiFont = languageSpecificFont == LanguageSpecificFont::Emoji;
-        if (!useEmojiFont) {
-            if (!CFCharacterSetIsLongCharacterMember(phoneFallbackCharacterSet(), c))
-                useEmojiFont = CFCharacterSetIsLongCharacterMember(appleColorEmojiCharacterSet(), c);
-        }
-        if (useEmojiFont)
-            font = fontForFamily(description, appleColorEmoji, false);
-        else {
-            RetainPtr<CTFontRef> fallbackFont = adoptCF(CTFontCreateForCharacters(originalFontData->getCTFont(), characters, length, nullptr));
-            if (RetainPtr<CFStringRef> foundFontName = adoptCF(CTFontCopyPostScriptName(fallbackFont.get())))
-                font = fontForFamily(description, foundFontName.get(), false);
-        }
-        break;
-    }
-    }
-#else
     RetainPtr<CTFontDescriptorRef> fallbackFontDescriptor = adoptCF(CTFontCreatePhysicalFontDescriptorForCharactersWithLanguage(originalFontData->getCTFont(), characters, length, nullptr, nullptr));
     if (auto foundFontName = adoptCF(static_cast<CFStringRef>(CTFontDescriptorCopyAttribute(fallbackFontDescriptor.get(), kCTFontNameAttribute)))) {
         if (c >= 0x0600 && c <= 0x06ff) { // Arabic
@@ -463,7 +119,6 @@
         }
         font = fontForFamily(description, foundFontName.get(), false);
     }
-#endif
 
     if (font)
         return font.release();
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to