Title: [214415] trunk
Revision
214415
Author
mmaxfi...@apple.com
Date
2017-03-27 09:18:33 -0700 (Mon, 27 Mar 2017)

Log Message

Implement format specifier for variation fonts
https://bugs.webkit.org/show_bug.cgi?id=169327

Reviewed by Simon Fraser.

Source/WebCore:

Variation fonts require the format("woff-variations"), format("truetype-variations"),
and format("opentype-variations") format specifies in @font-face rules.

Test: fast/text/variations/font-face-format.html

* platform/graphics/mac/FontCustomPlatformData.cpp:
(WebCore::FontCustomPlatformData::supportsFormat):

LayoutTests:

* fast/text/variations/font-face-format-expected.html: Added.
* fast/text/variations/font-face-format.html: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (214414 => 214415)


--- trunk/LayoutTests/ChangeLog	2017-03-27 16:12:21 UTC (rev 214414)
+++ trunk/LayoutTests/ChangeLog	2017-03-27 16:18:33 UTC (rev 214415)
@@ -1,5 +1,15 @@
 2017-03-27  Myles C. Maxfield  <mmaxfi...@apple.com>
 
+        Implement format specifier for variation fonts
+        https://bugs.webkit.org/show_bug.cgi?id=169327
+
+        Reviewed by Simon Fraser.
+
+        * fast/text/variations/font-face-format-expected.html: Added.
+        * fast/text/variations/font-face-format.html: Added.
+
+2017-03-27  Myles C. Maxfield  <mmaxfi...@apple.com>
+
         Make sure animation works for font-weight, font-stretch, and font-style
         https://bugs.webkit.org/show_bug.cgi?id=169683
 

Added: trunk/LayoutTests/fast/text/variations/font-face-format-expected.html (0 => 214415)


--- trunk/LayoutTests/fast/text/variations/font-face-format-expected.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/variations/font-face-format-expected.html	2017-03-27 16:18:33 UTC (rev 214415)
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+@font-face {
+	font-family: "WebFont";
+	src: url("../../../resources/Ahem.otf") format("woff");
+}
+@font-face {
+	font-family: "WebFont2";
+	src: url("../../../resources/Ahem.otf") format("truetype");
+}
+@font-face {
+	font-family: "WebFont3";
+	src: url("../../../resources/Ahem.otf") format("opentype");
+}
+</style>
+</head>
+<body>
+This test passes of you see three black rectangles below.
+<div style="font-size: 36px;">
+<p style="font-family: 'WebFont';">Hello</p>
+<p style="font-family: 'WebFont2';">Hello</p>
+<p style="font-family: 'WebFont3';">Hello</p>
+</div>
+</body>
+</html>
\ No newline at end of file

Added: trunk/LayoutTests/fast/text/variations/font-face-format.html (0 => 214415)


--- trunk/LayoutTests/fast/text/variations/font-face-format.html	                        (rev 0)
+++ trunk/LayoutTests/fast/text/variations/font-face-format.html	2017-03-27 16:18:33 UTC (rev 214415)
@@ -0,0 +1,27 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+@font-face {
+	font-family: "WebFont";
+	src: url("../../../resources/Ahem.otf") format("woff-variations"), local("Helvetica");
+}
+@font-face {
+	font-family: "WebFont2";
+	src: url("../../../resources/Ahem.otf") format("truetype-variations"), local("Helvetica");
+}
+@font-face {
+	font-family: "WebFont3";
+	src: url("../../../resources/Ahem.otf") format("opentype-variations"), local("Helvetica");
+}
+</style>
+</head>
+<body>
+This test passes of you see three black rectangles below.
+<div style="font-size: 36px;">
+<p style="font-family: 'WebFont';">Hello</p>
+<p style="font-family: 'WebFont2';">Hello</p>
+<p style="font-family: 'WebFont3';">Hello</p>
+</div>
+</body>
+</html>
\ No newline at end of file

Modified: trunk/Source/WebCore/ChangeLog (214414 => 214415)


--- trunk/Source/WebCore/ChangeLog	2017-03-27 16:12:21 UTC (rev 214414)
+++ trunk/Source/WebCore/ChangeLog	2017-03-27 16:18:33 UTC (rev 214415)
@@ -1,5 +1,20 @@
 2017-03-27  Myles C. Maxfield  <mmaxfi...@apple.com>
 
+        Implement format specifier for variation fonts
+        https://bugs.webkit.org/show_bug.cgi?id=169327
+
+        Reviewed by Simon Fraser.
+
+        Variation fonts require the format("woff-variations"), format("truetype-variations"),
+        and format("opentype-variations") format specifies in @font-face rules.
+
+        Test: fast/text/variations/font-face-format.html
+
+        * platform/graphics/mac/FontCustomPlatformData.cpp:
+        (WebCore::FontCustomPlatformData::supportsFormat):
+
+2017-03-27  Myles C. Maxfield  <mmaxfi...@apple.com>
+
         Make sure animation works for font-weight, font-stretch, and font-style
         https://bugs.webkit.org/show_bug.cgi?id=169683
 

Modified: trunk/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp (214414 => 214415)


--- trunk/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp	2017-03-27 16:12:21 UTC (rev 214414)
+++ trunk/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp	2017-03-27 16:18:33 UTC (rev 214415)
@@ -63,6 +63,11 @@
 #if (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED >= 100000) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101200)
         || equalLettersIgnoringASCIICase(format, "woff2")
 #endif
+#if ENABLE(VARIATION_FONTS)
+        || equalLettersIgnoringASCIICase(format, "woff-variations")
+        || equalLettersIgnoringASCIICase(format, "truetype-variations")
+        || equalLettersIgnoringASCIICase(format, "opentype-variations")
+#endif
         || equalLettersIgnoringASCIICase(format, "woff");
 }
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to