Title: [261416] trunk
Revision
261416
Author
[email protected]
Date
2020-05-08 14:16:23 -0700 (Fri, 08 May 2020)

Log Message

[iOS] Text-style fonts aren't locale-specific
https://bugs.webkit.org/show_bug.cgi?id=211438
<rdar://problem/51654163>

Reviewed by Sam Weinig.

Source/WebCore:

Simply hook up the locale to the Core Text function.

It turns out that this patch actually has no behavior change,
because this locale is only used for font fallback, but WebKit
does its own font fallback and we already pass the locale into
CTFontCopyDefaultCascadeListForLanguages(). However, for
symmetry with CTFontCreateUIFontWithLanguage() it's a good idea
to just supply it anyway. Just in case.

Test: platform/ios/fast/text/lang-text-style.html

* platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
(WebCore::SystemFontDatabaseCoreText::createTextStyleFont):

LayoutTests:

This test actually already passes. But it's a good idea to make
sure that it continues to pass in the future.

* platform/ios/fast/text/lang-text-style-expected-mismatch.html: Added.
* platform/ios/fast/text/lang-text-style.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (261415 => 261416)


--- trunk/LayoutTests/ChangeLog	2020-05-08 21:14:24 UTC (rev 261415)
+++ trunk/LayoutTests/ChangeLog	2020-05-08 21:16:23 UTC (rev 261416)
@@ -1,3 +1,17 @@
+2020-05-08  Myles C. Maxfield  <[email protected]>
+
+        [iOS] Text-style fonts aren't locale-specific
+        https://bugs.webkit.org/show_bug.cgi?id=211438
+        <rdar://problem/51654163>
+
+        Reviewed by Sam Weinig.
+
+        This test actually already passes. But it's a good idea to make
+        sure that it continues to pass in the future.
+
+        * platform/ios/fast/text/lang-text-style-expected-mismatch.html: Added.
+        * platform/ios/fast/text/lang-text-style.html: Added.
+
 2020-05-08  Kenneth Russell  <[email protected]>
 
         [WebGL2] Complete new texture upload entry points in WebGL2RenderingContext

Added: trunk/LayoutTests/platform/ios/fast/text/lang-text-style-expected-mismatch.html (0 => 261416)


--- trunk/LayoutTests/platform/ios/fast/text/lang-text-style-expected-mismatch.html	                        (rev 0)
+++ trunk/LayoutTests/platform/ios/fast/text/lang-text-style-expected-mismatch.html	2020-05-08 21:16:23 UTC (rev 261416)
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta name="viewport" content="width=device-width, initial-scale=1">
+</head>
+<body>
+<div lang="ja" style="font: -apple-system-body;"><span style="font-size: 48px;">&#x9aa8;</span></div>
+</body>
+</html>

Added: trunk/LayoutTests/platform/ios/fast/text/lang-text-style.html (0 => 261416)


--- trunk/LayoutTests/platform/ios/fast/text/lang-text-style.html	                        (rev 0)
+++ trunk/LayoutTests/platform/ios/fast/text/lang-text-style.html	2020-05-08 21:16:23 UTC (rev 261416)
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+<head>
+<meta name="viewport" content="width=device-width, initial-scale=1">
+</head>
+<body>
+<div lang="zh-Hans" style="font: -apple-system-body;"><span style="font-size: 48px;">&#x9aa8;</span></div>
+</body>
+</html>

Modified: trunk/Source/WebCore/ChangeLog (261415 => 261416)


--- trunk/Source/WebCore/ChangeLog	2020-05-08 21:14:24 UTC (rev 261415)
+++ trunk/Source/WebCore/ChangeLog	2020-05-08 21:16:23 UTC (rev 261416)
@@ -1,3 +1,25 @@
+2020-05-08  Myles C. Maxfield  <[email protected]>
+
+        [iOS] Text-style fonts aren't locale-specific
+        https://bugs.webkit.org/show_bug.cgi?id=211438
+        <rdar://problem/51654163>
+
+        Reviewed by Sam Weinig.
+
+        Simply hook up the locale to the Core Text function.
+
+        It turns out that this patch actually has no behavior change,
+        because this locale is only used for font fallback, but WebKit
+        does its own font fallback and we already pass the locale into
+        CTFontCopyDefaultCascadeListForLanguages(). However, for
+        symmetry with CTFontCreateUIFontWithLanguage() it's a good idea
+        to just supply it anyway. Just in case.
+
+        Test: platform/ios/fast/text/lang-text-style.html
+
+        * platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp:
+        (WebCore::SystemFontDatabaseCoreText::createTextStyleFont):
+
 2020-05-08  Kenneth Russell  <[email protected]>
 
         [WebGL2] Complete new texture upload entry points in WebGL2RenderingContext

Modified: trunk/Source/WebCore/platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp (261415 => 261416)


--- trunk/Source/WebCore/platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp	2020-05-08 21:14:24 UTC (rev 261415)
+++ trunk/Source/WebCore/platform/graphics/cocoa/SystemFontDatabaseCoreText.cpp	2020-05-08 21:16:23 UTC (rev 261416)
@@ -85,7 +85,7 @@
 RetainPtr<CTFontRef> SystemFontDatabaseCoreText::createTextStyleFont(const CascadeListParameters& parameters)
 {
 #if PLATFORM(IOS_FAMILY)
-    auto fontDescriptor = adoptCF(CTFontDescriptorCreateWithTextStyle(parameters.fontName.string().createCFString().get(), RenderThemeIOS::contentSizeCategory(), nullptr));
+    auto fontDescriptor = adoptCF(CTFontDescriptorCreateWithTextStyle(parameters.fontName.string().createCFString().get(), RenderThemeIOS::contentSizeCategory(), parameters.locale.string().createCFString().get()));
     // FIXME: Use createFontByApplyingWeightItalicsAndFallbackBehavior() once <rdar://problem/33046041> is fixed.
     CTFontSymbolicTraits traits = (parameters.weight >= kCTFontWeightSemibold ? kCTFontTraitBold : 0) | (parameters.italic ? kCTFontTraitItalic : 0);
     if (traits)
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to