[Cocoa] Font features are not applied to the system font
authormmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Jan 2016 22:58:45 +0000 (22:58 +0000)
committermmaxfield@apple.com <mmaxfield@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Jan 2016 22:58:45 +0000 (22:58 +0000)
https://bugs.webkit.org/show_bug.cgi?id=153053

Reviewed by Dean Jackson.

Source/WebCore:

We simply need to call preparePlatformFont() on it.

Test: fast/text/system-font-features.html

* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::fontWithFamily):

LayoutTests:

* fast/text/system-font-features-expected.html: Added.
* fast/text/system-font-features.html: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@195150 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/text/system-font-features-expected.html [new file with mode: 0644]
LayoutTests/fast/text/system-font-features.html [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp

index 0eb0f5f..1299d95 100644 (file)
@@ -1,3 +1,13 @@
+2016-01-15  Myles C. Maxfield  <mmaxfield@apple.com>
+
+        [Cocoa] Font features are not applied to the system font
+        https://bugs.webkit.org/show_bug.cgi?id=153053
+
+        Reviewed by Dean Jackson.
+
+        * fast/text/system-font-features-expected.html: Added.
+        * fast/text/system-font-features.html: Added.
+
 2016-01-15  Joseph Pecoraro  <pecoraro@apple.com>
 
         Media Query (-webkit-video-playable-inline) is failing as an invalid media query expression
diff --git a/LayoutTests/fast/text/system-font-features-expected.html b/LayoutTests/fast/text/system-font-features-expected.html
new file mode 100644 (file)
index 0000000..20a4b2d
--- /dev/null
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+<body>
+This test makes sure that font features are applied to -apple-system.
+<div style="font: 50px -apple-system-monospaced-numbers;">0123456789</div>
+</body>
+</html>
diff --git a/LayoutTests/fast/text/system-font-features.html b/LayoutTests/fast/text/system-font-features.html
new file mode 100644 (file)
index 0000000..ef4584b
--- /dev/null
@@ -0,0 +1,9 @@
+<!DOCTYPE html>
+<html>
+<head>
+</head>
+<body>
+This test makes sure that font features are applied to -apple-system.
+<div style="font: 50px -apple-system; font-variant-numeric: tabular-nums;">0123456789</div>
+</body>
+</html>
index 22e0f88..50207ab 100644 (file)
@@ -1,3 +1,17 @@
+2016-01-15  Myles C. Maxfield  <mmaxfield@apple.com>
+
+        [Cocoa] Font features are not applied to the system font
+        https://bugs.webkit.org/show_bug.cgi?id=153053
+
+        Reviewed by Dean Jackson.
+
+        We simply need to call preparePlatformFont() on it.
+
+        Test: fast/text/system-font-features.html
+
+        * platform/graphics/cocoa/FontCacheCoreText.cpp:
+        (WebCore::fontWithFamily):
+
 2016-01-15  Tim Horton  <timothy_horton@apple.com>
 
         Data detector yellow highlight location is vertically mirrored in WebKit1
index 0066946..153771f 100644 (file)
@@ -676,15 +676,15 @@ static RetainPtr<CTFontRef> fontWithFamily(const AtomicString& family, CTFontSym
 {
     if (family.isEmpty())
         return nullptr;
-    if (auto specialCase = platformFontWithFamilySpecialCase(family, weight, desiredTraits, size))
-        return specialCase;
+
+    RetainPtr<CTFontRef> foundFont = platformFontWithFamilySpecialCase(family, weight, desiredTraits, size);
+    if (!foundFont) {
 #if ENABLE(PLATFORM_FONT_LOOKUP)
-    RetainPtr<CTFontRef> foundFont = platformFontLookupWithFamily(family, desiredTraits, weight, size);
+        foundFont = platformFontLookupWithFamily(family, desiredTraits, weight, size);
 #else
-    UNUSED_PARAM(featureSettings);
-    UNUSED_PARAM(variantSettings);
-    RetainPtr<CTFontRef> foundFont = platformFontWithFamily(family, desiredTraits, weight, textRenderingMode, size);
+        foundFont = platformFontWithFamily(family, desiredTraits, weight, textRenderingMode, size);
 #endif
+    }
     return preparePlatformFont(foundFont.get(), textRenderingMode, nullptr, nullptr, featureSettings, variantSettings);
 }