Log Message
Cherry-pick r248071. rdar://problem/53789003
Use CTFontCreateForCharactersWithLanguageAndOption if available instead of CTFontCreateForCharactersWithLanguage
https://bugs.webkit.org/show_bug.cgi?id=200241
Source/WebCore:
Reviewed by Myles C. Maxfield.
We can use CTFontCreateForCharactersWithLanguageAndOption instead of CTFontCreateForCharactersWithLanguage
as it allows setting more easily the fallback option.
This allows us to never fallback to user installed fonts.
In such a case, we no longer need to wrap the fonts to change the fallback option.
We also prewarm the fonts with the same SPI and use system fallback as the default value.
Covered by existing tests.
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::preparePlatformFont):
(WebCore::lookupFallbackFont):
(WebCore::FontCache::systemFallbackForCharacters):
(WebCore::FontCache::prewarm):
(WebCore::fontFamiliesForPrewarming):
Source/WebCore/PAL:
Reviewed by Myles C. Maxfield.
Add new SPI.
* pal/spi/cocoa/CoreTextSPI.h:
Source/WTF:
Reviewed by Myles C. Maxfield.
* wtf/Platform.h: Add macro to enable/disable new SPI.
LayoutTests:
We update the tests to flush font caches as otherwise some debug asserts would be hit.
This is due to changing the user installed font runtime flag while browsing which is not a typical situation.
Reviewed by Myles C. Maxfield.
* fast/text/user-installed-fonts/extended-character-with-user-font.html:
* fast/text/user-installed-fonts/extended-character.html:
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248071 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Modified Paths
- branches/safari-608-branch/LayoutTests/ChangeLog
- branches/safari-608-branch/LayoutTests/fast/text/user-installed-fonts/extended-character-with-user-font.html
- branches/safari-608-branch/LayoutTests/fast/text/user-installed-fonts/extended-character.html
- branches/safari-608-branch/Source/WTF/ChangeLog
- branches/safari-608-branch/Source/WTF/wtf/Platform.h
- branches/safari-608-branch/Source/WebCore/ChangeLog
- branches/safari-608-branch/Source/WebCore/PAL/ChangeLog
- branches/safari-608-branch/Source/WebCore/PAL/pal/spi/cocoa/CoreTextSPI.h
- branches/safari-608-branch/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp
Diff
Modified: branches/safari-608-branch/LayoutTests/ChangeLog (248090 => 248091)
--- branches/safari-608-branch/LayoutTests/ChangeLog 2019-08-01 01:23:03 UTC (rev 248090)
+++ branches/safari-608-branch/LayoutTests/ChangeLog 2019-08-01 01:23:07 UTC (rev 248091)
@@ -1,5 +1,71 @@
2019-07-31 Alan Coon <[email protected]>
+ Cherry-pick r248071. rdar://problem/53789003
+
+ Use CTFontCreateForCharactersWithLanguageAndOption if available instead of CTFontCreateForCharactersWithLanguage
+ https://bugs.webkit.org/show_bug.cgi?id=200241
+
+ Source/WebCore:
+
+ Reviewed by Myles C. Maxfield.
+
+ We can use CTFontCreateForCharactersWithLanguageAndOption instead of CTFontCreateForCharactersWithLanguage
+ as it allows setting more easily the fallback option.
+ This allows us to never fallback to user installed fonts.
+ In such a case, we no longer need to wrap the fonts to change the fallback option.
+ We also prewarm the fonts with the same SPI and use system fallback as the default value.
+
+ Covered by existing tests.
+
+ * platform/graphics/cocoa/FontCacheCoreText.cpp:
+ (WebCore::preparePlatformFont):
+ (WebCore::lookupFallbackFont):
+ (WebCore::FontCache::systemFallbackForCharacters):
+ (WebCore::FontCache::prewarm):
+ (WebCore::fontFamiliesForPrewarming):
+
+ Source/WebCore/PAL:
+
+ Reviewed by Myles C. Maxfield.
+
+ Add new SPI.
+
+ * pal/spi/cocoa/CoreTextSPI.h:
+
+ Source/WTF:
+
+ Reviewed by Myles C. Maxfield.
+
+ * wtf/Platform.h: Add macro to enable/disable new SPI.
+
+ LayoutTests:
+
+ We update the tests to flush font caches as otherwise some debug asserts would be hit.
+ This is due to changing the user installed font runtime flag while browsing which is not a typical situation.
+
+ Reviewed by Myles C. Maxfield.
+
+ * fast/text/user-installed-fonts/extended-character-with-user-font.html:
+ * fast/text/user-installed-fonts/extended-character.html:
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248071 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2019-07-31 Youenn Fablet <[email protected]>
+
+ Use CTFontCreateForCharactersWithLanguageAndOption if available instead of CTFontCreateForCharactersWithLanguage
+ https://bugs.webkit.org/show_bug.cgi?id=200241
+
+ We update the tests to flush font caches as otherwise some debug asserts would be hit.
+ This is due to changing the user installed font runtime flag while browsing which is not a typical situation.
+
+ Reviewed by Myles C. Maxfield.
+
+ * fast/text/user-installed-fonts/extended-character-with-user-font.html:
+ * fast/text/user-installed-fonts/extended-character.html:
+
+2019-07-31 Alan Coon <[email protected]>
+
Cherry-pick r248046. rdar://problem/53788952
Owners of MultiChannelResampler should make sure that the output bus given to it has the same number of channels
Modified: branches/safari-608-branch/LayoutTests/fast/text/user-installed-fonts/extended-character-with-user-font.html (248090 => 248091)
--- branches/safari-608-branch/LayoutTests/fast/text/user-installed-fonts/extended-character-with-user-font.html 2019-08-01 01:23:03 UTC (rev 248090)
+++ branches/safari-608-branch/LayoutTests/fast/text/user-installed-fonts/extended-character-with-user-font.html 2019-08-01 01:23:07 UTC (rev 248091)
@@ -5,6 +5,8 @@
</head>
<body>
<script>
+if (window.internals)
+ internals.invalidateFontCache();
if (window.testRunner)
testRunner.installFakeHelvetica("SingleExtendedCharacter");
</script>
Modified: branches/safari-608-branch/LayoutTests/fast/text/user-installed-fonts/extended-character.html (248090 => 248091)
--- branches/safari-608-branch/LayoutTests/fast/text/user-installed-fonts/extended-character.html 2019-08-01 01:23:03 UTC (rev 248090)
+++ branches/safari-608-branch/LayoutTests/fast/text/user-installed-fonts/extended-character.html 2019-08-01 01:23:07 UTC (rev 248091)
@@ -5,8 +5,10 @@
</head>
<body>
<script>
-if (window.internals)
+if (window.internals) {
+ internals.invalidateFontCache();
internals.settings.setShouldAllowUserInstalledFonts(false);
+}
if (window.testRunner)
testRunner.installFakeHelvetica("SingleExtendedCharacter");
</script>
Modified: branches/safari-608-branch/Source/WTF/ChangeLog (248090 => 248091)
--- branches/safari-608-branch/Source/WTF/ChangeLog 2019-08-01 01:23:03 UTC (rev 248090)
+++ branches/safari-608-branch/Source/WTF/ChangeLog 2019-08-01 01:23:07 UTC (rev 248091)
@@ -1,5 +1,67 @@
2019-07-31 Alan Coon <[email protected]>
+ Cherry-pick r248071. rdar://problem/53789003
+
+ Use CTFontCreateForCharactersWithLanguageAndOption if available instead of CTFontCreateForCharactersWithLanguage
+ https://bugs.webkit.org/show_bug.cgi?id=200241
+
+ Source/WebCore:
+
+ Reviewed by Myles C. Maxfield.
+
+ We can use CTFontCreateForCharactersWithLanguageAndOption instead of CTFontCreateForCharactersWithLanguage
+ as it allows setting more easily the fallback option.
+ This allows us to never fallback to user installed fonts.
+ In such a case, we no longer need to wrap the fonts to change the fallback option.
+ We also prewarm the fonts with the same SPI and use system fallback as the default value.
+
+ Covered by existing tests.
+
+ * platform/graphics/cocoa/FontCacheCoreText.cpp:
+ (WebCore::preparePlatformFont):
+ (WebCore::lookupFallbackFont):
+ (WebCore::FontCache::systemFallbackForCharacters):
+ (WebCore::FontCache::prewarm):
+ (WebCore::fontFamiliesForPrewarming):
+
+ Source/WebCore/PAL:
+
+ Reviewed by Myles C. Maxfield.
+
+ Add new SPI.
+
+ * pal/spi/cocoa/CoreTextSPI.h:
+
+ Source/WTF:
+
+ Reviewed by Myles C. Maxfield.
+
+ * wtf/Platform.h: Add macro to enable/disable new SPI.
+
+ LayoutTests:
+
+ We update the tests to flush font caches as otherwise some debug asserts would be hit.
+ This is due to changing the user installed font runtime flag while browsing which is not a typical situation.
+
+ Reviewed by Myles C. Maxfield.
+
+ * fast/text/user-installed-fonts/extended-character-with-user-font.html:
+ * fast/text/user-installed-fonts/extended-character.html:
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248071 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2019-07-31 Youenn Fablet <[email protected]>
+
+ Use CTFontCreateForCharactersWithLanguageAndOption if available instead of CTFontCreateForCharactersWithLanguage
+ https://bugs.webkit.org/show_bug.cgi?id=200241
+
+ Reviewed by Myles C. Maxfield.
+
+ * wtf/Platform.h: Add macro to enable/disable new SPI.
+
+2019-07-31 Alan Coon <[email protected]>
+
Cherry-pick r248018. rdar://problem/53764057
REGRESSION(r241288): Text on Yahoo Japan mobile looks too bold
Modified: branches/safari-608-branch/Source/WTF/wtf/Platform.h (248090 => 248091)
--- branches/safari-608-branch/Source/WTF/wtf/Platform.h 2019-08-01 01:23:03 UTC (rev 248090)
+++ branches/safari-608-branch/Source/WTF/wtf/Platform.h 2019-08-01 01:23:07 UTC (rev 248091)
@@ -1540,6 +1540,10 @@
#define HAVE_DISALLOWABLE_USER_INSTALLED_FONTS 1
#endif
+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101500) || (PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000)
+#define HAVE_CTFONTCREATEFORCHARACTERSWITHLANGUAGEANDOPTION 1
+#endif
+
#if PLATFORM(IOS_FAMILY) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 130000
#define HAVE_ARKIT_QUICK_LOOK_PREVIEW_ITEM 1
#endif
Modified: branches/safari-608-branch/Source/WebCore/ChangeLog (248090 => 248091)
--- branches/safari-608-branch/Source/WebCore/ChangeLog 2019-08-01 01:23:03 UTC (rev 248090)
+++ branches/safari-608-branch/Source/WebCore/ChangeLog 2019-08-01 01:23:07 UTC (rev 248091)
@@ -1,5 +1,80 @@
2019-07-31 Alan Coon <[email protected]>
+ Cherry-pick r248071. rdar://problem/53789003
+
+ Use CTFontCreateForCharactersWithLanguageAndOption if available instead of CTFontCreateForCharactersWithLanguage
+ https://bugs.webkit.org/show_bug.cgi?id=200241
+
+ Source/WebCore:
+
+ Reviewed by Myles C. Maxfield.
+
+ We can use CTFontCreateForCharactersWithLanguageAndOption instead of CTFontCreateForCharactersWithLanguage
+ as it allows setting more easily the fallback option.
+ This allows us to never fallback to user installed fonts.
+ In such a case, we no longer need to wrap the fonts to change the fallback option.
+ We also prewarm the fonts with the same SPI and use system fallback as the default value.
+
+ Covered by existing tests.
+
+ * platform/graphics/cocoa/FontCacheCoreText.cpp:
+ (WebCore::preparePlatformFont):
+ (WebCore::lookupFallbackFont):
+ (WebCore::FontCache::systemFallbackForCharacters):
+ (WebCore::FontCache::prewarm):
+ (WebCore::fontFamiliesForPrewarming):
+
+ Source/WebCore/PAL:
+
+ Reviewed by Myles C. Maxfield.
+
+ Add new SPI.
+
+ * pal/spi/cocoa/CoreTextSPI.h:
+
+ Source/WTF:
+
+ Reviewed by Myles C. Maxfield.
+
+ * wtf/Platform.h: Add macro to enable/disable new SPI.
+
+ LayoutTests:
+
+ We update the tests to flush font caches as otherwise some debug asserts would be hit.
+ This is due to changing the user installed font runtime flag while browsing which is not a typical situation.
+
+ Reviewed by Myles C. Maxfield.
+
+ * fast/text/user-installed-fonts/extended-character-with-user-font.html:
+ * fast/text/user-installed-fonts/extended-character.html:
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248071 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2019-07-31 Youenn Fablet <[email protected]>
+
+ Use CTFontCreateForCharactersWithLanguageAndOption if available instead of CTFontCreateForCharactersWithLanguage
+ https://bugs.webkit.org/show_bug.cgi?id=200241
+
+ Reviewed by Myles C. Maxfield.
+
+ We can use CTFontCreateForCharactersWithLanguageAndOption instead of CTFontCreateForCharactersWithLanguage
+ as it allows setting more easily the fallback option.
+ This allows us to never fallback to user installed fonts.
+ In such a case, we no longer need to wrap the fonts to change the fallback option.
+ We also prewarm the fonts with the same SPI and use system fallback as the default value.
+
+ Covered by existing tests.
+
+ * platform/graphics/cocoa/FontCacheCoreText.cpp:
+ (WebCore::preparePlatformFont):
+ (WebCore::lookupFallbackFont):
+ (WebCore::FontCache::systemFallbackForCharacters):
+ (WebCore::FontCache::prewarm):
+ (WebCore::fontFamiliesForPrewarming):
+
+2019-07-31 Alan Coon <[email protected]>
+
Cherry-pick r248046. rdar://problem/53788952
Owners of MultiChannelResampler should make sure that the output bus given to it has the same number of channels
Modified: branches/safari-608-branch/Source/WebCore/PAL/ChangeLog (248090 => 248091)
--- branches/safari-608-branch/Source/WebCore/PAL/ChangeLog 2019-08-01 01:23:03 UTC (rev 248090)
+++ branches/safari-608-branch/Source/WebCore/PAL/ChangeLog 2019-08-01 01:23:07 UTC (rev 248091)
@@ -1,3 +1,67 @@
+2019-07-31 Alan Coon <[email protected]>
+
+ Cherry-pick r248071. rdar://problem/53789003
+
+ Use CTFontCreateForCharactersWithLanguageAndOption if available instead of CTFontCreateForCharactersWithLanguage
+ https://bugs.webkit.org/show_bug.cgi?id=200241
+
+ Source/WebCore:
+
+ Reviewed by Myles C. Maxfield.
+
+ We can use CTFontCreateForCharactersWithLanguageAndOption instead of CTFontCreateForCharactersWithLanguage
+ as it allows setting more easily the fallback option.
+ This allows us to never fallback to user installed fonts.
+ In such a case, we no longer need to wrap the fonts to change the fallback option.
+ We also prewarm the fonts with the same SPI and use system fallback as the default value.
+
+ Covered by existing tests.
+
+ * platform/graphics/cocoa/FontCacheCoreText.cpp:
+ (WebCore::preparePlatformFont):
+ (WebCore::lookupFallbackFont):
+ (WebCore::FontCache::systemFallbackForCharacters):
+ (WebCore::FontCache::prewarm):
+ (WebCore::fontFamiliesForPrewarming):
+
+ Source/WebCore/PAL:
+
+ Reviewed by Myles C. Maxfield.
+
+ Add new SPI.
+
+ * pal/spi/cocoa/CoreTextSPI.h:
+
+ Source/WTF:
+
+ Reviewed by Myles C. Maxfield.
+
+ * wtf/Platform.h: Add macro to enable/disable new SPI.
+
+ LayoutTests:
+
+ We update the tests to flush font caches as otherwise some debug asserts would be hit.
+ This is due to changing the user installed font runtime flag while browsing which is not a typical situation.
+
+ Reviewed by Myles C. Maxfield.
+
+ * fast/text/user-installed-fonts/extended-character-with-user-font.html:
+ * fast/text/user-installed-fonts/extended-character.html:
+
+
+ git-svn-id: https://svn.webkit.org/repository/webkit/trunk@248071 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+ 2019-07-31 Youenn Fablet <[email protected]>
+
+ Use CTFontCreateForCharactersWithLanguageAndOption if available instead of CTFontCreateForCharactersWithLanguage
+ https://bugs.webkit.org/show_bug.cgi?id=200241
+
+ Reviewed by Myles C. Maxfield.
+
+ Add new SPI.
+
+ * pal/spi/cocoa/CoreTextSPI.h:
+
2019-07-24 Alan Coon <[email protected]>
Apply patch. rdar://problem/53483188
Modified: branches/safari-608-branch/Source/WebCore/PAL/pal/spi/cocoa/CoreTextSPI.h (248090 => 248091)
--- branches/safari-608-branch/Source/WebCore/PAL/pal/spi/cocoa/CoreTextSPI.h 2019-08-01 01:23:03 UTC (rev 248090)
+++ branches/safari-608-branch/Source/WebCore/PAL/pal/spi/cocoa/CoreTextSPI.h 2019-08-01 01:23:07 UTC (rev 248091)
@@ -132,6 +132,7 @@
bool CTFontDescriptorIsSystemUIFont(CTFontDescriptorRef);
CTFontRef CTFontCreateForCSS(CFStringRef name, uint16_t weight, CTFontSymbolicTraits, CGFloat size);
CTFontRef CTFontCreateForCharactersWithLanguage(CTFontRef currentFont, const UTF16Char *characters, CFIndex length, CFStringRef language, CFIndex *coveredLength);
+CTFontRef CTFontCreateForCharactersWithLanguageAndOption(CTFontRef currentFont, const UTF16Char *characters, CFIndex length, CFStringRef language, CTFontFallbackOption option, CFIndex *coveredLength);
CTFontRef CTFontCopyPhysicalFont(CTFontRef);
extern const CFStringRef kCTUIFontTextStyleShortHeadline;
Modified: branches/safari-608-branch/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp (248090 => 248091)
--- branches/safari-608-branch/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp 2019-08-01 01:23:03 UTC (rev 248090)
+++ branches/safari-608-branch/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp 2019-08-01 01:23:07 UTC (rev 248091)
@@ -568,8 +568,13 @@
bool dontNeedToApplyOpticalSizing = fontOpticalSizing == FontOpticalSizing::Enabled && !forceOpticalSizingOn;
bool fontFaceDoesntSpecifyFeatures = !fontFaceFeatures || fontFaceFeatures->isEmpty();
bool fontFaceDoesntSpecifyVariations = !fontFaceVariantSettings || fontFaceVariantSettings->isAllNormal();
- if (noFontFeatureSettings && noFontVariationSettings && textRenderingModeIsAuto && variantSettingsIsNormal && dontNeedToApplyOpticalSizing && fontFaceDoesntSpecifyFeatures && fontFaceDoesntSpecifyVariations)
+ if (noFontFeatureSettings && noFontVariationSettings && textRenderingModeIsAuto && variantSettingsIsNormal && dontNeedToApplyOpticalSizing && fontFaceDoesntSpecifyFeatures && fontFaceDoesntSpecifyVariations) {
+#if HAVE(CTFONTCREATEFORCHARACTERSWITHLANGUAGEANDOPTION)
+ return originalFont;
+#else
return createFontForInstalledFonts(originalFont, fontDescription.shouldAllowUserInstalledFonts());
+#endif
+ }
// This algorithm is described at http://www.w3.org/TR/css3-fonts/#feature-precedence
FeaturesMap featuresToBeApplied;
@@ -881,11 +886,15 @@
: fontDescriptor(fontDescriptor)
, capabilities(capabilitiesForFontDescriptor(fontDescriptor))
{
+#if HAVE(CTFONTCREATEFORCHARACTERSWITHLANGUAGEANDOPTION)
+ UNUSED_PARAM(allowUserInstalledFonts);
+#else
if (allowUserInstalledFonts != AllowUserInstalledFonts::No)
return;
auto attributes = adoptCF(CFDictionaryCreateMutable(kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
addAttributesForInstalledFonts(attributes.get(), allowUserInstalledFonts);
this->fontDescriptor = CTFontDescriptorCreateCopyWithAttributes(fontDescriptor, attributes.get());
+#endif
}
RetainPtr<CTFontDescriptorRef> fontDescriptor;
@@ -1388,8 +1397,42 @@
}
#endif
-static RetainPtr<CTFontRef> lookupFallbackFont(CTFontRef font, FontSelectionValue fontWeight, const AtomString& locale, const UChar* characters, unsigned length)
+#if !ASSERT_DISABLED
+static inline bool isUserInstalledFont(CTFontRef font)
{
+#if HAVE(DISALLOWABLE_USER_INSTALLED_FONTS)
+ auto isUserInstalledFont = adoptCF(static_cast<CFBooleanRef>(CTFontCopyAttribute(font, kCTFontUserInstalledAttribute)));
+ return isUserInstalledFont && CFBooleanGetValue(isUserInstalledFont.get());
+#else
+ UNUSED_PARAM(font);
+ return false;
+#endif
+}
+#endif
+
+#if !USE(PLATFORM_SYSTEM_FALLBACK_LIST) && (PLATFORM(MAC) || (PLATFORM(IOS_FAMILY) && TARGET_OS_IOS))
+static RetainPtr<CTFontRef> createFontForCharacters(CTFontRef font, CFStringRef localeString, AllowUserInstalledFonts, const UChar* characters, unsigned length)
+{
+ CFIndex coveredLength = 0;
+ return adoptCF(CTFontCreatePhysicalFontForCharactersWithLanguage(font, characters, length, localeString, &coveredLength));
+}
+#elif HAVE(CTFONTCREATEFORCHARACTERSWITHLANGUAGEANDOPTION)
+static RetainPtr<CTFontRef> createFontForCharacters(CTFontRef font, CFStringRef localeString, AllowUserInstalledFonts allowUserInstalledFonts, const UChar* characters, unsigned length)
+{
+ CFIndex coveredLength = 0;
+ auto fallbackOption = allowUserInstalledFonts == AllowUserInstalledFonts::No ? kCTFontFallbackOptionSystem : kCTFontFallbackOptionDefault;
+ return adoptCF(CTFontCreateForCharactersWithLanguageAndOption(font, characters, length, localeString, fallbackOption, &coveredLength));
+}
+#else
+static RetainPtr<CTFontRef> createFontForCharacters(CTFontRef font, CFStringRef localeString, AllowUserInstalledFonts, const UChar* characters, unsigned length)
+{
+ CFIndex coveredLength = 0;
+ return adoptCF(CTFontCreateForCharactersWithLanguage(font, characters, length, localeString, &coveredLength));
+}
+#endif
+
+static RetainPtr<CTFontRef> lookupFallbackFont(CTFontRef font, FontSelectionValue fontWeight, const AtomString& locale, AllowUserInstalledFonts allowUserInstalledFonts, const UChar* characters, unsigned length)
+{
ASSERT(length > 0);
RetainPtr<CFStringRef> localeString;
@@ -1400,13 +1443,8 @@
UNUSED_PARAM(locale);
#endif
- CFIndex coveredLength = 0;
- RetainPtr<CTFontRef> result;
-#if !USE(PLATFORM_SYSTEM_FALLBACK_LIST) && (PLATFORM(MAC) || (PLATFORM(IOS_FAMILY) && TARGET_OS_IOS))
- result = adoptCF(CTFontCreatePhysicalFontForCharactersWithLanguage(font, characters, length, localeString.get(), &coveredLength));
-#else
- result = adoptCF(CTFontCreateForCharactersWithLanguage(font, characters, length, localeString.get(), &coveredLength));
-#endif
+ auto result = createFontForCharacters(font, localeString.get(), allowUserInstalledFonts, characters, length);
+ ASSERT(!isUserInstalledFont(result.get()) || allowUserInstalledFonts == AllowUserInstalledFonts::Yes);
#if PLATFORM(IOS_FAMILY)
// Callers of this function won't include multiple code points. "Length" is to know how many code units
@@ -1447,7 +1485,7 @@
if (!fullName.isEmpty())
m_fontNamesRequiringSystemFallbackForPrewarming.add(fullName);
- auto result = lookupFallbackFont(platformData.font(), description.weight(), description.locale(), characters, length);
+ auto result = lookupFallbackFont(platformData.font(), description.weight(), description.locale(), description.shouldAllowUserInstalledFonts(), characters, length);
result = preparePlatformFont(result.get(), description, nullptr, nullptr, { });
if (!result)
@@ -1646,7 +1684,12 @@
// This is sufficient to warm CoreText caches for language and character specific fallbacks.
CFIndex coveredLength = 0;
UChar character = ' ';
+
+#if HAVE(CTFONTCREATEFORCHARACTERSWITHLANGUAGEANDOPTION)
+ auto fallbackWarmingFont = adoptCF(CTFontCreateForCharactersWithLanguageAndOption(warmingFont.get(), &character, 1, nullptr, kCTFontFallbackOptionSystem, &coveredLength));
+#else
auto fallbackWarmingFont = adoptCF(CTFontCreateForCharactersWithLanguage(warmingFont.get(), &character, 1, nullptr, &coveredLength));
+#endif
}
}
});
_______________________________________________ webkit-changes mailing list [email protected] https://lists.webkit.org/mailman/listinfo/webkit-changes
