Title: [185100] trunk
Revision
185100
Author
mmaxfi...@apple.com
Date
2015-06-01 20:11:11 -0700 (Mon, 01 Jun 2015)

Log Message

[SVG -> OTF Converter] Remove unnecessary hacks
https://bugs.webkit.org/show_bug.cgi?id=145088

Reviewed by Simon Fraser.

Source/WebCore:

Not needed anymore.

Test: svg/text/offset-square-svg-font.html

* svg/SVGToOTFFontConversion.cpp:
(WebCore::SVGToOTFFontConverter::appendKERNTable):
(WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter):

LayoutTests:

Test that the hacks are unnecessary.

* svg/text/offset-square-svg-font-expected.html: Added.
* svg/text/offset-square-svg-font.html: Added.
* svg/text/resources/offset-square-svg-font.svg: Added.
* svg/text/resources/offset-square-svg-font2.svg: Added.

Modified Paths

Added Paths

Diff

Modified: trunk/LayoutTests/ChangeLog (185099 => 185100)


--- trunk/LayoutTests/ChangeLog	2015-06-02 02:59:39 UTC (rev 185099)
+++ trunk/LayoutTests/ChangeLog	2015-06-02 03:11:11 UTC (rev 185100)
@@ -1,3 +1,17 @@
+2015-06-01  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        [SVG -> OTF Converter] Remove unnecessary hacks
+        https://bugs.webkit.org/show_bug.cgi?id=145088
+
+        Reviewed by Simon Fraser.
+
+        Test that the hacks are unnecessary.
+
+        * svg/text/offset-square-svg-font-expected.html: Added.
+        * svg/text/offset-square-svg-font.html: Added.
+        * svg/text/resources/offset-square-svg-font.svg: Added.
+        * svg/text/resources/offset-square-svg-font2.svg: Added.
+
 2015-06-01  Zalan Bujtas  <za...@apple.com>
 
         [Mac] Unreviewed gardening.

Added: trunk/LayoutTests/svg/text/offset-square-svg-font-expected.html (0 => 185100)


--- trunk/LayoutTests/svg/text/offset-square-svg-font-expected.html	                        (rev 0)
+++ trunk/LayoutTests/svg/text/offset-square-svg-font-expected.html	2015-06-02 03:11:11 UTC (rev 185100)
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+@font-face {
+    font-family: "TestFont";
+    src: url("resources/offset-square-svg-font2.svg") format("svg");
+}
+</style>
+</head>
+<body>
+This test makes sure that a glyph which is an offset square is rendered as expected. The test succeeds if you see a square below.
+<div style="font: 40px TestFont;">ab</div>
+</body>
+</html>

Added: trunk/LayoutTests/svg/text/offset-square-svg-font.html (0 => 185100)


--- trunk/LayoutTests/svg/text/offset-square-svg-font.html	                        (rev 0)
+++ trunk/LayoutTests/svg/text/offset-square-svg-font.html	2015-06-02 03:11:11 UTC (rev 185100)
@@ -0,0 +1,15 @@
+<!DOCTYPE html>
+<html>
+<head>
+<style>
+@font-face {
+    font-family: "TestFont";
+    src: url("resources/offset-square-svg-font.svg") format("svg");
+}
+</style>
+</head>
+<body>
+This test makes sure that a glyph which is an offset square is rendered as expected. The test succeeds if you see a square below.
+<div style="font: 40px TestFont;">a</div>
+</body>
+</html>

Added: trunk/LayoutTests/svg/text/resources/offset-square-svg-font.svg (0 => 185100)


--- trunk/LayoutTests/svg/text/resources/offset-square-svg-font.svg	                        (rev 0)
+++ trunk/LayoutTests/svg/text/resources/offset-square-svg-font.svg	2015-06-02 03:11:11 UTC (rev 185100)
@@ -0,0 +1,9 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg">
+<defs>
+<font horiz-adv-x="481" id="ascii">
+  <font-face font-family="testfont" units-per-em="1000" ascent="800" descent="-200" alphabetic="0"/>
+<glyph unicode="a" horiz-adv-x="1000" d="M500 0V500H1000V0H500Z"/>
+</font>
+</defs>
+</svg>

Added: trunk/LayoutTests/svg/text/resources/offset-square-svg-font2.svg (0 => 185100)


--- trunk/LayoutTests/svg/text/resources/offset-square-svg-font2.svg	                        (rev 0)
+++ trunk/LayoutTests/svg/text/resources/offset-square-svg-font2.svg	2015-06-02 03:11:11 UTC (rev 185100)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<svg width="100%" height="100%" xmlns="http://www.w3.org/2000/svg">
+<defs>
+<font horiz-adv-x="481" id="ascii">
+  <font-face font-family="testfont" units-per-em="1000" ascent="800" descent="-200" alphabetic="0"/>
+<glyph unicode="a" horiz-adv-x="500" d="M0 0Z"/>
+<glyph unicode="b" horiz-adv-x="500" d="M0 0V500H500V0H0Z"/>
+</font>
+</defs>
+</svg>

Modified: trunk/Source/WebCore/ChangeLog (185099 => 185100)


--- trunk/Source/WebCore/ChangeLog	2015-06-02 02:59:39 UTC (rev 185099)
+++ trunk/Source/WebCore/ChangeLog	2015-06-02 03:11:11 UTC (rev 185100)
@@ -1,3 +1,18 @@
+2015-06-01  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+        [SVG -> OTF Converter] Remove unnecessary hacks
+        https://bugs.webkit.org/show_bug.cgi?id=145088
+
+        Reviewed by Simon Fraser.
+
+        Not needed anymore.
+
+        Test: svg/text/offset-square-svg-font.html
+
+        * svg/SVGToOTFFontConversion.cpp:
+        (WebCore::SVGToOTFFontConverter::appendKERNTable):
+        (WebCore::SVGToOTFFontConverter::SVGToOTFFontConverter):
+
 2015-06-01  Andreas Kling  <akl...@apple.com>
 
         CSS animations in filling-forwards state shouldn't force compositing.

Modified: trunk/Source/WebCore/svg/SVGToOTFFontConversion.cpp (185099 => 185100)


--- trunk/Source/WebCore/svg/SVGToOTFFontConversion.cpp	2015-06-02 02:59:39 UTC (rev 185099)
+++ trunk/Source/WebCore/svg/SVGToOTFFontConversion.cpp	2015-06-02 03:11:11 UTC (rev 185100)
@@ -1102,9 +1102,11 @@
     size_t sizeOfVerticalSubtable = appendKERNSubtable<SVGVKernElement>(&SVGVKernElement::buildVerticalKerningPair, 0);
     ASSERT_UNUSED(sizeOfVerticalSubtable, subtablesOffset + sizeOfHorizontalSubtable + sizeOfVerticalSubtable == m_result.size());
 
+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED <= 101000) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED <= 80000)
     // Work around a bug in Apple's font parser by adding some padding bytes. <rdar://problem/18401901>
     for (int i = 0; i < 6; ++i)
         m_result.append(0);
+#endif
 }
 
 template <typename V>
@@ -1398,9 +1400,11 @@
             processGlyphElement(glyphElement, &glyphElement, defaultHorizontalAdvance, defaultVerticalAdvance, unicodeAttribute, initialGlyph);
     }
 
+#if (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED <= 101000) || (PLATFORM(IOS) && __IPHONE_OS_VERSION_MIN_REQUIRED <= 80000)
     // <rdar://problem/20086223> Cocoa has a bug where glyph bounding boxes are not correctly respected for frustum culling. Work around this by
     // inflating the font's bounding box
     m_boundingBox.extend(FloatPoint(0, 0));
+#endif
 
     appendLigatureGlyphs();
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to