<!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>[191440] 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/191440">191440</a></dd>
<dt>Author</dt> <dd>fred.wang@free.fr</dd>
<dt>Date</dt> <dd>2015-10-21 23:45:21 -0700 (Wed, 21 Oct 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>[Mac] Add support for the USE_TYPO_METRICS flag
https://bugs.webkit.org/show_bug.cgi?id=150394

Reviewed by Myles C. Maxfield.

Source/WebCore:

Make the Cocoa backend use the typo metrics for fonts with a MATH table when the OS/2 USE_TYPO_METRICS flag is set.

No new tests because this is already tested by fonts/use-typo-metrics-1.html

* platform/graphics/cocoa/FontCocoa.mm:
(WebCore::Font::platformInit): Verify whether the OS/2 USE_TYPO_METRICS flag is set and use the typo metrics if that is the case.

LayoutTests:

Update font, reference and Mac expectation for fonts/use-typo-metrics-1.html

* fonts/lineheight5000-typolineheight2300.woff: Add a MATH table.
* platform/mac-mavericks/mathml/opentype/opentype-stretchy-horizontal-expected.txt: Updated.
* platform/mac/TestExpectations: Remove Mac failure expectation.
* platform/mac/mathml/opentype/opentype-stretchy-expected.txt: Updated.
* platform/mac/mathml/opentype/opentype-stretchy-horizontal-expected.txt: Updated.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfontslineheight5000typolineheight2300woff">trunk/LayoutTests/fonts/lineheight5000-typolineheight2300.woff</a></li>
<li><a href="#trunkLayoutTestsplatformmacTestExpectations">trunk/LayoutTests/platform/mac/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformmacmathmlopentypeopentypestretchyexpectedtxt">trunk/LayoutTests/platform/mac/mathml/opentype/opentype-stretchy-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacmathmlopentypeopentypestretchyhorizontalexpectedtxt">trunk/LayoutTests/platform/mac/mathml/opentype/opentype-stretchy-horizontal-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacmavericksmathmlopentypeopentypestretchyhorizontalexpectedtxt">trunk/LayoutTests/platform/mac-mavericks/mathml/opentype/opentype-stretchy-horizontal-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscocoaFontCocoamm">trunk/Source/WebCore/platform/graphics/cocoa/FontCocoa.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (191439 => 191440)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-10-22 06:10:53 UTC (rev 191439)
+++ trunk/LayoutTests/ChangeLog        2015-10-22 06:45:21 UTC (rev 191440)
</span><span class="lines">@@ -1,3 +1,18 @@
</span><ins>+2015-10-21  Frederic Wang  &lt;fred.wang@free.fr&gt;
+
+        [Mac] Add support for the USE_TYPO_METRICS flag
+        https://bugs.webkit.org/show_bug.cgi?id=150394
+
+        Reviewed by Myles C. Maxfield.
+
+        Update font, reference and Mac expectation for fonts/use-typo-metrics-1.html
+
+        * fonts/lineheight5000-typolineheight2300.woff: Add a MATH table.
+        * platform/mac-mavericks/mathml/opentype/opentype-stretchy-horizontal-expected.txt: Updated.
+        * platform/mac/TestExpectations: Remove Mac failure expectation.
+        * platform/mac/mathml/opentype/opentype-stretchy-expected.txt: Updated.
+        * platform/mac/mathml/opentype/opentype-stretchy-horizontal-expected.txt: Updated.
+
</ins><span class="cx"> 2015-10-21  Ryan Haddad  &lt;ryanhaddad@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Adding http/tests/media/video-load-suspend.html to the list of flaky media tests
</span></span></pre></div>
<a id="trunkLayoutTestsfontslineheight5000typolineheight2300woff"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fonts/lineheight5000-typolineheight2300.woff (191439 => 191440)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fonts/lineheight5000-typolineheight2300.woff        2015-10-22 06:10:53 UTC (rev 191439)
+++ trunk/LayoutTests/fonts/lineheight5000-typolineheight2300.woff        2015-10-22 06:45:21 UTC (rev 191440)
</span><span class="lines">@@ -1,17 +1,16 @@
</span><del>-wOFFOTTOT
-CFF \xF4\xDF(\x89\xC9 6FFTM\xD4v\xC5\x86OS/2\xF0D`!\xD5'cmap4EJ\x93\xA9head|06\x8Dh\xB7hhea\xAC$+wOFFOTTO\xB4         CFF `\xDF(\x89\xC9 6FFTM@v\xDANpMATH\K\xF2DOS/2\D`!\xD5'cmapEJ\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N\xC30ş\xD3? \xB0\xB2\x99\x81\xAAJ\xE5\xA4\xCAҭT\xEAP%k\xF7\xAAJ\x93HU\%^rF\x8E\x828\x823p-^ C\x87J\x8D\x95\xF8g\xE7\xBD\xEF\xB3?\xC05^!\xD0=\x88 \x8C\xF0\xEE\xD8ýxt\xDC\xC3R|:\xEEc\xE4e\x8E\xB8\xF5\xDE1\xEA\xDDP)\xFAW\xAD\xAD\xABe\xC1\xE8\x95cO\xF8r\xDCóH\xF7{w\x8E\x90ދ\xE3!\xE7?\xB0\x84\xC6-\xA3Ȑ\xC3@b\x8C&amp;\xECC(\x88H        \xB6\xFC\x93\xB3\x8F9Z\xA0f\xD3Tv\xBE \x97\xC0R\x9B\xAA\xC8r#ǻ\x89 U\xC9dk\xF2$\x96\x8B\xBAֻbk
-M\xD9ު-|\xE8,\x912n\xFA\x9B=bζ\xF9\xE4\x86+\xD3\xFF\xAAB̬
-{]\xFFP\x94i\x9E\xB6\x99#\xA5\x94o\x9A\xA3\xFE\x9B
-g\x8A\xBA3\xA4:!\xCB\xCAm\xAD\xED+\xFAS[\xC4)\xDDs\xBE\xE7\xDCz1\xE0\xC8\xE7\xB7u\xFDV,\xCAJWY*é\x92syZ\x91( f~\xA0\xFC\xF6\xE4.tL\x9A+ޭ\xEEFIkl\xBB-c\x93V5o\x91T*\x982\x88\xBC\xCC:\xBF{\xBFfx\x9Cc`f\x83\xFF\xCD F@\x8A\x91-(U\xB9
</del><span class="cx">\ No newline at end of file
</span><ins>+\xD0maxpTPname\xA0]\xE4\xE6{\xAC\xE0postH \xFF\x863x\x9Cc`d``b\x96\xCC\xF2\x9Ax~\x9B\xAF \xDC\xCC/\x80&quot; \x97|7!\xE8\xFF\xCC/\x98\x80\&amp;\x90($Y
+Kx\x9Cc`d`\xE0&lt;\xC2y\x84\x81\x81\xF9\x98dd@LX\xE2uPx\x9Cc`a~\xC18\x81\x81\x95\x81\x81\xA9\x8BiC\x84f|\xC0`\xC8\xC8e`\xE5d\x80Ft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xC8G002102\xE8\xFD\xE0g\xF8!\xCD\xF8C\x86\xE9\x87,\xF3        \x96\xC6\xEE\xDF1\xBFj~na\x95ax\xC8/\xC3\xC0  \xC3\xF0LP\x86\x81O\x86QJ\x88\x81\xA4G\x8D\xC1\x87\xA1\xC89\xBF\xA0\xB2d\x96\x82F\xB2\xA6\x82\x91\x81\xA1\xA9\x82obI\x86\xAF\x8F\x82cqq~rfbIf~q.!ҽ@\xC0\xC8`\xC0\xC0\xCCȨ\xA4\xAC׽\xF7\x87\xEB^ƽ{n\xD9˼W\xEC\x97ď\x95\xFF$\xD8\xF6\xFE)\xFD\xE1\xFAs\xCBWv&gt;\xBE\xDF1,\xBFj~\xD5\xFC\xABa\xE7\xFBU#\xD2-Z&gt;\xFF\xE7\x96n\xB6n.\x8Elc[x\x9Cc```d\x82Kvo\xB8\xC1\xB4\xEFF#+B +x\x9Cc`d``\xE0bx\xC0\xF0\x82!\x80\xC1\x86\xF5&amp;\xE8A0\xA0ɝ\x80ҚX\xF4\xA1\x83i@\xFDqD\xA83\x82\xA8\xD306\x92(\xE2F\xD81\xA3(\xC3߫@\xB6
 +\\xA7\x8C\x8EF+J\xE8\xE8
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/TestExpectations (191439 => 191440)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/TestExpectations        2015-10-22 06:10:53 UTC (rev 191439)
+++ trunk/LayoutTests/platform/mac/TestExpectations        2015-10-22 06:45:21 UTC (rev 191440)
</span><span class="lines">@@ -1348,6 +1348,3 @@
</span><span class="cx"> 
</span><span class="cx"> # Imported Blink tests which have not been investigated.
</span><span class="cx"> imported/blink/compositing/video/video-controls-layer-creation-squashing.html [ Pass ImageOnlyFailure ]
</span><del>-
-# USE_TYPO_METRICS is not implemented on mac.
-webkit.org/b/131839 fonts/use-typo-metrics-1.html [ ImageOnlyFailure ]
</del></span></pre></div>
<a id="trunkLayoutTestsplatformmacmathmlopentypeopentypestretchyexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/mathml/opentype/opentype-stretchy-expected.txt (191439 => 191440)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/mathml/opentype/opentype-stretchy-expected.txt        2015-10-22 06:10:53 UTC (rev 191439)
+++ trunk/LayoutTests/platform/mac/mathml/opentype/opentype-stretchy-expected.txt        2015-10-22 06:45:21 UTC (rev 191440)
</span><span class="lines">@@ -9,7 +9,7 @@
</span><span class="cx">             RenderMathMLOperator {mo} at (0,0) size 47x11
</span><span class="cx">               RenderMathMLBlock (anonymous, flex) at (2,0) size 42x3
</span><span class="cx">                 RenderBlock (anonymous) at (0,0) size 3x3
</span><del>-                  RenderText at (0,-3) size 3x10
</del><ins>+                  RenderText at (0,-3) size 3x0
</ins><span class="cx">                     text run at (0,-3) width 3: &quot;\x{219F}&quot;
</span><span class="cx">         RenderText {#text} at (48,16) size 5x18
</span><span class="cx">           text run at (48,16) width 5: &quot; &quot;
</span><span class="lines">@@ -18,7 +18,7 @@
</span><span class="cx">             RenderMathMLOperator {mo} at (0,0) size 47x21
</span><span class="cx">               RenderMathMLBlock (anonymous, flex) at (2,0) size 42x3
</span><span class="cx">                 RenderBlock (anonymous) at (0,0) size 3x3
</span><del>-                  RenderText at (0,-3) size 3x10
</del><ins>+                  RenderText at (0,-3) size 3x0
</ins><span class="cx">                     text run at (0,-3) width 3: &quot;\x{219F}&quot;
</span><span class="cx">         RenderText {#text} at (100,16) size 5x18
</span><span class="cx">           text run at (100,16) width 5: &quot; &quot;
</span><span class="lines">@@ -27,7 +27,7 @@
</span><span class="cx">             RenderMathMLOperator {mo} at (0,0) size 47x31
</span><span class="cx">               RenderMathMLBlock (anonymous, flex) at (2,0) size 42x3
</span><span class="cx">                 RenderBlock (anonymous) at (0,0) size 3x3
</span><del>-                  RenderText at (0,-3) size 3x10
</del><ins>+                  RenderText at (0,-3) size 3x0
</ins><span class="cx">                     text run at (0,-3) width 3: &quot;\x{219F}&quot;
</span><span class="cx">         RenderText {#text} at (0,0) size 0x0
</span><span class="cx">       RenderBlock {P} at (0,50) size 784x154
</span><span class="lines">@@ -36,7 +36,7 @@
</span><span class="cx">             RenderMathMLOperator {mo} at (0,0) size 47x150
</span><span class="cx">               RenderMathMLBlock (anonymous, flex) at (2,0) size 42x3
</span><span class="cx">                 RenderBlock (anonymous) at (0,0) size 3x3
</span><del>-                  RenderText at (0,-3) size 3x10
</del><ins>+                  RenderText at (0,-3) size 3x0
</ins><span class="cx">                     text run at (0,-3) width 3: &quot;\x{219F}&quot;
</span><span class="cx">         RenderText {#text} at (0,0) size 0x0
</span><span class="cx">       RenderBlock {P} at (0,220) size 784x85
</span><span class="lines">@@ -45,6 +45,6 @@
</span><span class="cx">             RenderMathMLOperator {mo} at (0,0) size 84x82
</span><span class="cx">               RenderMathMLBlock (anonymous, flex) at (0,0) size 83x12
</span><span class="cx">                 RenderBlock (anonymous) at (0,0) size 11x12
</span><del>-                  RenderText at (0,6) size 11x10
</del><ins>+                  RenderText at (0,6) size 11x0
</ins><span class="cx">                     text run at (0,6) width 11: &quot;\x{2A1B}&quot;
</span><span class="cx">         RenderText {#text} at (0,0) size 0x0
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacmathmlopentypeopentypestretchyhorizontalexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/mathml/opentype/opentype-stretchy-horizontal-expected.txt (191439 => 191440)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/mathml/opentype/opentype-stretchy-horizontal-expected.txt        2015-10-22 06:10:53 UTC (rev 191439)
+++ trunk/LayoutTests/platform/mac/mathml/opentype/opentype-stretchy-horizontal-expected.txt        2015-10-22 06:45:21 UTC (rev 191440)
</span><span class="lines">@@ -10,7 +10,7 @@
</span><span class="cx">               RenderMathMLOperator {mo} at (0,1) size 16x21
</span><span class="cx">                 RenderMathMLBlock (anonymous, flex) at (2,0) size 11x4
</span><span class="cx">                   RenderBlock (anonymous) at (0,0) size 2x4
</span><del>-                    RenderText at (0,-3) size 2x10
</del><ins>+                    RenderText at (0,-3) size 2x0
</ins><span class="cx">                       text run at (0,-3) width 2: &quot;\x{219C}&quot;
</span><span class="cx">               RenderMathMLSpace {mspace} at (4,0) size 8x1
</span><span class="cx">         RenderText {#text} at (0,0) size 0x0
</span><span class="lines">@@ -21,7 +21,7 @@
</span><span class="cx">               RenderMathMLOperator {mo} at (0,1) size 26x21
</span><span class="cx">                 RenderMathMLBlock (anonymous, flex) at (2,0) size 22x4
</span><span class="cx">                   RenderBlock (anonymous) at (0,0) size 2x4
</span><del>-                    RenderText at (0,-3) size 2x10
</del><ins>+                    RenderText at (0,-3) size 2x0
</ins><span class="cx">                       text run at (0,-3) width 2: &quot;\x{219C}&quot;
</span><span class="cx">               RenderMathMLSpace {mspace} at (5,0) size 16x1
</span><span class="cx">         RenderText {#text} at (0,0) size 0x0
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx">               RenderMathMLOperator {mo} at (0,1) size 156x41
</span><span class="cx">                 RenderMathMLBlock (anonymous, flex) at (2,0) size 151x4
</span><span class="cx">                   RenderBlock (anonymous) at (0,0) size 2x4
</span><del>-                    RenderText at (0,-3) size 2x10
</del><ins>+                    RenderText at (0,-3) size 2x0
</ins><span class="cx">                       text run at (0,-3) width 2: &quot;\x{219C}&quot;
</span><span class="cx">               RenderMathMLSpace {mspace} at (2,0) size 151x1
</span><span class="cx">         RenderText {#text} at (0,0) size 0x0
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacmavericksmathmlopentypeopentypestretchyhorizontalexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac-mavericks/mathml/opentype/opentype-stretchy-horizontal-expected.txt (191439 => 191440)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-mavericks/mathml/opentype/opentype-stretchy-horizontal-expected.txt        2015-10-22 06:10:53 UTC (rev 191439)
+++ trunk/LayoutTests/platform/mac-mavericks/mathml/opentype/opentype-stretchy-horizontal-expected.txt        2015-10-22 06:45:21 UTC (rev 191440)
</span><span class="lines">@@ -10,7 +10,7 @@
</span><span class="cx">               RenderMathMLOperator {mo} at (0,1) size 16x21
</span><span class="cx">                 RenderMathMLBlock (anonymous, flex) at (2,0) size 11x4
</span><span class="cx">                   RenderBlock (anonymous) at (0,0) size 2x4
</span><del>-                    RenderText at (0,-3) size 2x10
</del><ins>+                    RenderText at (0,-3) size 2x0
</ins><span class="cx">                       text run at (0,-3) width 2: &quot;\x{219C}&quot;
</span><span class="cx">               RenderMathMLSpace {mspace} at (4,0) size 8x1
</span><span class="cx">         RenderText {#text} at (0,0) size 0x0
</span><span class="lines">@@ -21,7 +21,7 @@
</span><span class="cx">               RenderMathMLOperator {mo} at (0,1) size 26x21
</span><span class="cx">                 RenderMathMLBlock (anonymous, flex) at (2,0) size 22x4
</span><span class="cx">                   RenderBlock (anonymous) at (0,0) size 2x4
</span><del>-                    RenderText at (0,-3) size 2x10
</del><ins>+                    RenderText at (0,-3) size 2x0
</ins><span class="cx">                       text run at (0,-3) width 2: &quot;\x{219C}&quot;
</span><span class="cx">               RenderMathMLSpace {mspace} at (5,0) size 16x1
</span><span class="cx">         RenderText {#text} at (0,0) size 0x0
</span><span class="lines">@@ -32,7 +32,7 @@
</span><span class="cx">               RenderMathMLOperator {mo} at (0,1) size 156x41
</span><span class="cx">                 RenderMathMLBlock (anonymous, flex) at (2,0) size 151x4
</span><span class="cx">                   RenderBlock (anonymous) at (0,0) size 2x4
</span><del>-                    RenderText at (0,-3) size 2x10
</del><ins>+                    RenderText at (0,-3) size 2x0
</ins><span class="cx">                       text run at (0,-3) width 2: &quot;\x{219C}&quot;
</span><span class="cx">               RenderMathMLSpace {mspace} at (2,0) size 151x1
</span><span class="cx">         RenderText {#text} at (0,0) size 0x0
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (191439 => 191440)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-10-22 06:10:53 UTC (rev 191439)
+++ trunk/Source/WebCore/ChangeLog        2015-10-22 06:45:21 UTC (rev 191440)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2015-10-21  Frederic Wang  &lt;fred.wang@free.fr&gt;
+
+        [Mac] Add support for the USE_TYPO_METRICS flag
+        https://bugs.webkit.org/show_bug.cgi?id=150394
+
+        Reviewed by Myles C. Maxfield.
+
+        Make the Cocoa backend use the typo metrics for fonts with a MATH table when the OS/2 USE_TYPO_METRICS flag is set.
+
+        No new tests because this is already tested by fonts/use-typo-metrics-1.html
+
+        * platform/graphics/cocoa/FontCocoa.mm:
+        (WebCore::Font::platformInit): Verify whether the OS/2 USE_TYPO_METRICS flag is set and use the typo metrics if that is the case.
+
</ins><span class="cx"> 2015-10-21  Zalan Bujtas  &lt;zalan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Print out the render tree from command line.
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscocoaFontCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cocoa/FontCocoa.mm (191439 => 191440)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cocoa/FontCocoa.mm        2015-10-22 06:10:53 UTC (rev 191439)
+++ trunk/Source/WebCore/platform/graphics/cocoa/FontCocoa.mm        2015-10-22 06:45:21 UTC (rev 191440)
</span><span class="lines">@@ -57,6 +57,10 @@
</span><span class="cx"> @end
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if USE(APPKIT)
+#include &quot;OpenTypeTypes.h&quot;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> static bool fontHasVerticalGlyphs(CTFontRef ctFont)
</span><span class="lines">@@ -170,6 +174,32 @@
</span><span class="cx">     
</span><span class="cx">     float lineGap = scaleEmToUnits(CGFontGetLeading(m_platformData.cgFont()), unitsPerEm) * pointSize;
</span><span class="cx"> 
</span><ins>+    // The Open Font Format describes the OS/2 USE_TYPO_METRICS flag as follows:
+    // &quot;If set, it is strongly recommended to use OS/2.sTypoAscender - OS/2.sTypoDescender+ OS/2.sTypoLineGap as a value for default line spacing for this font.&quot;
+    // We only apply this rule in the important case of fonts with a MATH table.
+    CFArrayRef availableTables = CTFontCopyAvailableTables(m_platformData.cgFont(), kCTFontTableOptionNoOptions);
+    if (CFArrayContainsValue(availableTables, CFRangeMake(0, CFArrayGetCount(availableTables)), kCTFontTableMATH)) {
+        if (CFDataRef os2Table = CGFontCopyTableForTag(kCTFontTableOS2)) {
+            // For the structure of the OS/2 table, see
+            // https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6OS2.html
+            const CFIndex fsSelectionOffset = 16 * 2 + 10 + 4 * 4 + 4 * 1;
+            const CFIndex sTypoAscenderOffset = fsSelectionOffset + 3 * 2;
+            const CFIndex sTypoDescenderOffset = sTypoAscenderOffset + 2;
+            const CFIndex sTypoLineGapOffset = sTypoDescenderOffset + 2;
+            if (CFDataGetLength(os2Table) &gt;= sTypoLineGapOffset + 2) {
+                const UInt8* os2Data = CFDataGetBytePtr(os2Table);
+                const unsigned short useTypoMetricsMask = 1 &lt;&lt; 7;
+                if (*(reinterpret_cast&lt;const OpenType::UInt16*&gt;(os2Data + fsSelectionOffset)) &amp; useTypoMetricsMask) {
+                    ascent = scaleEmToUnits(*(reinterpret_cast&lt;const OpenType::Int16*&gt;(os2Data + sTypoAscenderOffset)), unitsPerEm) * pointSize;
+                    descent = -scaleEmToUnits(*(reinterpret_cast&lt;const OpenType::Int16*&gt;(os2Data + sTypoDescenderOffset)), unitsPerEm) * pointSize;
+                    lineGap = scaleEmToUnits(*(reinterpret_cast&lt;const OpenType::Int16*&gt;(os2Data + sTypoLineGapOffset)), unitsPerEm) * pointSize;
+                }
+            }
+            CFRelease(os2Table);
+        }
+    }
+    CFRelease(availableTables);
+
</ins><span class="cx">     // We need to adjust Times, Helvetica, and Courier to closely match the
</span><span class="cx">     // vertical metrics of their Microsoft counterparts that are the de facto
</span><span class="cx">     // web standard. The AppKit adjustment of 20% is too big and is
</span></span></pre>
</div>
</div>

</body>
</html>