<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[181278] trunk</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/181278">181278</a></dd>
<dt>Author</dt> <dd>mmaxfield@apple.com</dd>
<dt>Date</dt> <dd>2015-03-09 12:58:37 -0700 (Mon, 09 Mar 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Work around a Cocoa font parsing bug
https://bugs.webkit.org/show_bug.cgi?id=142446
Source/WebCore:
<rdar://problem/20086223>
Reviewed by Simon Fraser.
Work around a bug in Cocoa regarding font parsing.
* svg/SVGToOTFFontConversion.cpp:
LayoutTests:
Reviewed by Simon Fraser.
Adding a few extra tests for bits of SVG fonts that could use some more tests.
* svg/fonts/resources/svg-font-general.svg: Updated and moved from svg-font-horiz-origin-font.svg
* svg/fonts/svg-font-general.html: Updated and moved from svg-font-horiz-origin.html
* svg/fonts/svg-font-general-expected.html: Updated and moved from svg-font-horiz-origin-expected.html</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoresvgSVGToOTFFontConversioncpp">trunk/Source/WebCore/svg/SVGToOTFFontConversion.cpp</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestssvgfontsresourcessvgfontgeneralsvg">trunk/LayoutTests/svg/fonts/resources/svg-font-general.svg</a></li>
<li><a href="#trunkLayoutTestssvgfontssvgfontgeneralexpectedhtml">trunk/LayoutTests/svg/fonts/svg-font-general-expected.html</a></li>
<li><a href="#trunkLayoutTestssvgfontssvgfontgeneralhtml">trunk/LayoutTests/svg/fonts/svg-font-general.html</a></li>
</ul>
<h3>Removed Paths</h3>
<ul>
<li><a href="#trunkLayoutTestssvgfontsresourcessvgfonthorizoriginfontsvg">trunk/LayoutTests/svg/fonts/resources/svg-font-horiz-origin-font.svg</a></li>
<li><a href="#trunkLayoutTestssvgfontssvgfonthorizoriginexpectedhtml">trunk/LayoutTests/svg/fonts/svg-font-horiz-origin-expected.html</a></li>
<li><a href="#trunkLayoutTestssvgfontssvgfonthorizoriginhtml">trunk/LayoutTests/svg/fonts/svg-font-horiz-origin.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (181277 => 181278)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-03-09 19:39:12 UTC (rev 181277)
+++ trunk/LayoutTests/ChangeLog        2015-03-09 19:58:37 UTC (rev 181278)
</span><span class="lines">@@ -1,5 +1,18 @@
</span><span class="cx"> 2015-03-09 Myles C. Maxfield <mmaxfield@apple.com>
</span><span class="cx">
</span><ins>+ Work around a Cocoa font parsing bug
+ https://bugs.webkit.org/show_bug.cgi?id=142446
+
+ Reviewed by Simon Fraser.
+
+ Adding a few extra tests for bits of SVG fonts that could use some more tests.
+
+ * svg/fonts/resources/svg-font-general.svg: Updated and moved from svg-font-horiz-origin-font.svg
+ * svg/fonts/svg-font-general.html: Updated and moved from svg-font-horiz-origin.html
+ * svg/fonts/svg-font-general-expected.html: Updated and moved from svg-font-horiz-origin-expected.html
+
+2015-03-09 Myles C. Maxfield <mmaxfield@apple.com>
+
</ins><span class="cx"> [SVG -> OTF Converter] x-height cannot be specified
</span><span class="cx"> https://bugs.webkit.org/show_bug.cgi?id=142465
</span><span class="cx">
</span></span></pre></div>
<a id="trunkLayoutTestssvgfontsresourcessvgfontgeneralsvg"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/fonts/resources/svg-font-general.svg (0 => 181278)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/fonts/resources/svg-font-general.svg         (rev 0)
+++ trunk/LayoutTests/svg/fonts/resources/svg-font-general.svg        2015-03-09 19:58:37 UTC (rev 181278)
</span><span class="lines">@@ -0,0 +1,48 @@
</span><ins>+<?xml version="1.0" standalone="yes"?>
+<svg version="1.1" viewBox="0 0 160 160" xmlns = 'http://www.w3.org/2000/svg' xmlns:xlink="http://www.w3.org/1999/xlink">
+ <defs>
+ <font id="Litherum" horiz-adv-x="1000">
+ <font-face units-per-em="1000" ascent="1000" descent="0">
+ </font-face>
+ <glyph unicode="A" horiz-adv-x="1000" d="M 500 0 H 1000 V 600 H 500 z"/>
+ <glyph unicode="B" horiz-adv-x="1000"/>
+ </font>
+ <font id="Litherum2" horiz-adv-x="1000" horiz-origin-x="500" horiz-origin-y="300">
+ <font-face units-per-em="1000" ascent="1000" descent="0">
+ </font-face>
+ <glyph unicode="A" horiz-adv-x="1000" d="M 0 -300 H 500 V 300 H 0 z"/>
+ </font>
+ <font id="Litherum3" horiz-adv-x="1000">
+ <font-face font-weight="normal" font-style="normal" units-per-em="1000" cap-height="600" x-height="400" ascent="1000" descent="0">
+ </font-face>
+ <glyph unicode="A" d="M 0 0 H 500 V 600 H 0 z"/>
+ <glyph unicode="BC" horiz-adv-x="500" d="M 0 0 H 500 L 250 600 z"/>
+ <glyph unicode="&#x672c;" horiz-adv-x="500" d="M 0 0 H 500 L 0 600 z"/>
+ </font>
+ <font id="Litherum4" horiz-adv-x="500">
+ <font-face font-weight="normal" font-style="normal" units-per-em="1000" cap-height="600" x-height="400" ascent="1000" descent="0">
+ </font-face>
+ <glyph unicode="A" horiz-adv-x="1000" d="M 0 0 H 500 V 600 H 0 z"/>
+ <glyph unicode="D" horiz-adv-x="500" d="M 0 0 H 500 L 250 600 z"/>
+ <glyph unicode="&#x672c;" horiz-adv-x="500" d="M 0 0 H 500 L 0 600 z"/>
+ </font>
+ <font id="Litherum5" horiz-adv-x="500">
+ <glyph unicode="A" horiz-adv-x="1000" d="M 0 0 H 250 V 600 H 0 z"/>
+ </font>
+ <font id="Litherum6">
+ <font-face units-per-em="1000" ascent="1000" descent="1000">
+ </font-face>
+ <glyph unicode="A" horiz-adv-x="1000" d="M 0 0 V -1000 H 1000 V 1000 H 0 z"/>
+ <glyph unicode="B" horiz-adv-x="1000" d="M 0 0 H 1000 V 1000 H 0 z"/>
+ </font>
+ <font horiz-adv-x="1000" id="Litherum7">
+ <font-face units-per-em="1000" ascent="1000" descent="0"/>
+ <glyph unicode="A" horiz-adv-x="1000" d="M 500 0 H 1000 V 600 z"/>
+ </font>
+ <font horiz-adv-x="1000" id="Litherum8">
+ <font-face units-per-em="1000" ascent="1000" descent="0"/>
+ <glyph unicode="A" horiz-adv-x="1000" d="M 500 0 H 1000 V 600 z"/>
+ <missing-glyph d="M0 0V1000H1000V0z"/>
+ </font>
+ </defs>
+</svg>
</ins></span></pre></div>
<a id="trunkLayoutTestssvgfontsresourcessvgfonthorizoriginfontsvg"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/svg/fonts/resources/svg-font-horiz-origin-font.svg (181277 => 181278)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/fonts/resources/svg-font-horiz-origin-font.svg        2015-03-09 19:39:12 UTC (rev 181277)
+++ trunk/LayoutTests/svg/fonts/resources/svg-font-horiz-origin-font.svg        2015-03-09 19:58:37 UTC (rev 181278)
</span><span class="lines">@@ -1,21 +0,0 @@
</span><del>-<?xml version="1.0" standalone="yes"?>
-<svg version="1.1" viewBox="0 0 160 160" xmlns = 'http://www.w3.org/2000/svg' xmlns:xlink="http://www.w3.org/1999/xlink">
- <defs>
- <font id="Litherum" horiz-adv-x="1000">
- <font-face font-family="Litherum" font-weight="normal" font-style="normal" units-per-em="1000" cap-height="600" x-height="400" ascent="1000" descent="0" alphabetic="0" mathematical="500" ideographic="400" hanging="500">
- <font-face-src>
- <font-face-name name="Litherum"/>
- </font-face-src>
- </font-face>
- <glyph unicode="A" horiz-adv-x="1000" d="M 500 0 H 1000 V 600 H 500 z"/>
- </font>
- <font id="Litherum2" horiz-adv-x="1000" horiz-origin-x="500" horiz-origin-y="300">
- <font-face font-family="Litherum" font-weight="normal" font-style="normal" units-per-em="1000" cap-height="600" x-height="400" ascent="1000" descent="0" alphabetic="0" mathematical="500" ideographic="400" hanging="500">
- <font-face-src>
- <font-face-name name="Litherum"/>
- </font-face-src>
- </font-face>
- <glyph unicode="A" horiz-adv-x="1000" d="M 0 -300 H 500 V 300 H 0 z"/>
- </font>
- </defs>
-</svg>
</del></span></pre></div>
<a id="trunkLayoutTestssvgfontssvgfontgeneralexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/fonts/svg-font-general-expected.html (0 => 181278)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/fonts/svg-font-general-expected.html         (rev 0)
+++ trunk/LayoutTests/svg/fonts/svg-font-general-expected.html        2015-03-09 19:58:37 UTC (rev 181278)
</span><span class="lines">@@ -0,0 +1,33 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<style>
+@font-face {
+ font-family: 'Litherum';
+ src: url("resources/svg-font-general.svg#Litherum2") format(svg);
+}
+@font-face {
+ font-family: 'Litherum4';
+ src: url("resources/svg-font-general.svg#Litherum4") format(svg);
+}
+@font-face {
+ font-family: 'Litherum8';
+ src: url("resources/svg-font-general.svg#Litherum8") format(svg);
+}
+.a {
+ font-family: 'Litherum4';
+}
+</style>
+</head>
+<body style="-webkit-font-smoothing: none;">
+These tests test horiz-origin, fallback of horiz-adv property, glyph rendering, ligatures, svg -&gt; native fallback, and units-per-em, respectively.
+<div><span style="font: 50px Litherum;">AAA</span><span style="position: relative; left: 50px;">AAA</span></div>
+<div><span style="font: 50px Litherum4;">AAA</span>AAA</div>
+<div><div style="display: inline-block; width: 150px; height: 52px; position: relative;"><div style="position: absolute; width: 25px; height: 30px; left: 0px; bottom: 0px; background: black;"></div><div style="position: absolute; width: 25px; height: 30px; left: 50px; bottom: 0px; background: black;"></div><div style="position: absolute; width: 25px; height: 30px; left: 100px; bottom: 0px; background: black;"></div></div>AAA</div>
+<div style="height: 7px;"></div>
+<div><span style="font: 50px Litherum4;">D</span><span style="font-size: 50px;">A</span></div>
+<div style="font-size: 50px;"><span class="a">A</span>Z<span class="a">A</span>Z<span class="a">A</span></span><span class="a">&#x672c;</span>N<span class="a">&#x672c;</span>N<span class="a">&#x672c;</span></span></div>
+<div style="display: inline-block; position: relative; width: 200px; height: 206px;"><div style="position: absolute; top: 2px; left: 0px; width: 50px; height: 100px; background: black;"></div><div style="position: absolute; top: 2px; left: 50px; width: 50px; height: 50px; background: black;"></div><div style="position: absolute; bottom: -1px; left: 0px; width: 50px; height: 100px; background: black;"></div><div style="position: absolute; bottom: 49px; left: 50px; width: 50px; height: 50px; background: black;"></div></div>
+<div style="font: 50px Litherum8; position: absolute; left: 400px; top: 100px;">A</div>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestssvgfontssvgfontgeneralhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/svg/fonts/svg-font-general.html (0 => 181278)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/fonts/svg-font-general.html         (rev 0)
+++ trunk/LayoutTests/svg/fonts/svg-font-general.html        2015-03-09 19:58:37 UTC (rev 181278)
</span><span class="lines">@@ -0,0 +1,37 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<style>
+@font-face {
+ font-family: 'Litherum';
+ src: url("resources/svg-font-general.svg#Litherum") format(svg);
+}
+@font-face {
+ font-family: 'Litherum3';
+ src: url("resources/svg-font-general.svg#Litherum3") format(svg);
+}
+@font-face {
+ font-family: 'Litherum5';
+ src: url("resources/svg-font-general.svg#Litherum5") format(svg);
+}
+@font-face {
+ font-family: 'Litherum6';
+ src: url("resources/svg-font-general.svg#Litherum6") format(svg);
+}
+@font-face {
+ font-family: 'Litherum7';
+ src: url("resources/svg-font-general.svg#Litherum7") format(svg);
+}
+</style>
+</head>
+<body style="-webkit-font-smoothing: none;">
+These tests test horiz-origin, fallback of horiz-adv property, glyph rendering, ligatures, svg -&gt; native fallback, and units-per-em, respectively.
+<div><span style="font: 50px Litherum;">AAAB</span>AAA</div>
+<div><span style="font: 50px Litherum3;">AAA</span>AAA</div>
+<div><span style="font: 50px Litherum3;">AAA</span>AAA</div>
+<div><span style="font: 50px Litherum3;">BC</span><span style="font: 50px Litherum5;">A</span></div>
+<div style="font-size: 50px;"><span style="font-family: Litherum3, Times;">AZAZA</span><span style="font-family: Times, Litherum3">&#x672c;N&#x672c;N&#x672c;</span></div>
+<div style="font-size: 50px;"><span style="font-family: Litherum6;">AB</span><br/><span style="font-family: Litherum6;">AB</span></div>
+<div style="font: 50px Litherum7; position: absolute; left: 400px; top: 100px;">A</div>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestssvgfontssvgfonthorizoriginexpectedhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/svg/fonts/svg-font-horiz-origin-expected.html (181277 => 181278)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/fonts/svg-font-horiz-origin-expected.html        2015-03-09 19:39:12 UTC (rev 181277)
+++ trunk/LayoutTests/svg/fonts/svg-font-horiz-origin-expected.html        2015-03-09 19:58:37 UTC (rev 181278)
</span><span class="lines">@@ -1,15 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<style>
-@font-face {
- font-family: 'Litherum';
- src: url("resources/svg-font-horiz-origin-font.svg#Litherum2") format(svg)
-}
-</style>
-</head>
-<body>
-This test makes sure that the horiz-origin-x and horiz-origin-y attributes are correctly converted.
-<div><span style="font: 48px Litherum;">AAA</span>AAA</div>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkLayoutTestssvgfontssvgfonthorizoriginhtml"></a>
<div class="delfile"><h4>Deleted: trunk/LayoutTests/svg/fonts/svg-font-horiz-origin.html (181277 => 181278)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/svg/fonts/svg-font-horiz-origin.html        2015-03-09 19:39:12 UTC (rev 181277)
+++ trunk/LayoutTests/svg/fonts/svg-font-horiz-origin.html        2015-03-09 19:58:37 UTC (rev 181278)
</span><span class="lines">@@ -1,15 +0,0 @@
</span><del>-<!DOCTYPE html>
-<html>
-<head>
-<style>
-@font-face {
- font-family: 'Litherum';
- src: url("resources/svg-font-horiz-origin-font.svg#Litherum") format(svg)
-}
-</style>
-</head>
-<body>
-This test makes sure that the horiz-origin-x and horiz-origin-y attributes are correctly converted.
-<div><span style="font: 48px Litherum;">AAA</span>AAA</div>
-</body>
-</html>
</del></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (181277 => 181278)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-03-09 19:39:12 UTC (rev 181277)
+++ trunk/Source/WebCore/ChangeLog        2015-03-09 19:58:37 UTC (rev 181278)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2015-03-09 Myles C. Maxfield <mmaxfield@apple.com>
+
+ Work around a Cocoa font parsing bug
+ https://bugs.webkit.org/show_bug.cgi?id=142446
+ <rdar://problem/20086223>
+
+ Reviewed by Simon Fraser.
+
+ Work around a bug in Cocoa regarding font parsing.
+
+ * svg/SVGToOTFFontConversion.cpp:
+
</ins><span class="cx"> 2015-03-09 Csaba Osztrogonác <ossy@webkit.org>
</span><span class="cx">
</span><span class="cx"> Fix the build after r181153
</span></span></pre></div>
<a id="trunkSourceWebCoresvgSVGToOTFFontConversioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/svg/SVGToOTFFontConversion.cpp (181277 => 181278)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/svg/SVGToOTFFontConversion.cpp        2015-03-09 19:39:12 UTC (rev 181277)
+++ trunk/Source/WebCore/svg/SVGToOTFFontConversion.cpp        2015-03-09 19:58:37 UTC (rev 181278)
</span><span class="lines">@@ -1300,6 +1300,10 @@
</span><span class="cx"> processGlyphElement(glyphElement, &glyphElement, defaultHorizontalAdvance, defaultVerticalAdvance, unicodeAttribute, initialGlyph);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ // <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));
+
</ins><span class="cx"> appendLigatureGlyphs();
</span><span class="cx">
</span><span class="cx"> if (m_glyphs.size() > std::numeric_limits<Glyph>::max()) {
</span></span></pre>
</div>
</div>
</body>
</html>