<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
        {font-family:Verdana;
        panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
        {font-family:Georgia;
        panose-1:2 4 5 2 5 4 5 2 3 3;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
p.MsoPlainText, li.MsoPlainText, div.MsoPlainText
        {mso-style-priority:99;
        mso-style-link:"Plain Text Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.PlainTextChar
        {mso-style-name:"Plain Text Char";
        mso-style-priority:99;
        mso-style-link:"Plain Text";
        font-family:"Calibri",sans-serif;}
span.EmailStyle20
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.apple-converted-space
        {mso-style-name:apple-converted-space;}
span.highlight
        {mso-style-name:highlight;}
span.EmailStyle25
        {mso-style-type:personal;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
span.EmailStyle26
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoPlainText">Laurence Penny recently pointed out an issue impeding interoperability of fonts, in particular, static instance fonts generated from a variable font. The issue involves bit 6 in the simple-glyph flags of the ‘glyf’ table. MacOS uses
 that bit in a particular way, though it’s not clearly documented by Apple: Per <a href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdeveloper.apple.com%2Ffonts%2FTrueType-Reference-Manual%2FRM06%2FChap6glyf.html&data=02%7C01%7Cpetercon%40microsoft.com%7C1489fdd1df1545faac7a08d5a645d836%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636597741274402475&sdata=FHamrel3LlvkbkixYUpC%2BdKIhcvdGM5%2BiAwsbiRhWfQ%3D&reserved=0">
Apple’s ‘glyf’ spec</a>, bit 6 is reserved. However, the <a href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdeveloper.apple.com%2Ffonts%2FTrueType-Reference-Manual%2FRM06%2FChap6AATIntro.html&data=02%7C01%7Cpetercon%40microsoft.com%7C1489fdd1df1545faac7a08d5a645d836%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636597741274412488&sdata=Hv%2BR9RZe6BWGQmWf49s%2BKiDEgXB3K6rbXCaOv60VjoQ%3D&reserved=0">
Intro page for Apple’s spec</a> does describe bit 6 being used to enable non-zero-fill rasterization.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">This is something that Adam Twardoch described a couple of years ago:<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><a href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Ftwardoch%2Ftest-fonts%2Ftree%2Fmaster%2Fvaria%2F160413-EvenOddTT&data=02%7C01%7Cpetercon%40microsoft.com%7C1489fdd1df1545faac7a08d5a645d836%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636597741274422501&sdata=wTMYcqw5Wwkh1JXok7WJSwkiMjJukz8fw9KztumRYOE%3D&reserved=0">https://github.com/twardoch/test-fonts/tree/master/varia/160413-EvenOddTT</a><o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">The OT and OFF specs currently are consistent with Apple’s ‘glyf’ documentation, saying that bit 6 is reserved. Some libraries and tools may be following that spec. OT Sanitizer appears to be one particular case of this: it rejects fonts
 if bit 6 is set, which is not surprising given that the OT spec says the bit is reserved and must be set to 0. As a result, fonts that set bit 6 are rejected by browsers such as Firefox and Chrome that integrate OTS. But bit 6 might need to be set in some
 fonts in order for them to work on MacOS. This was discussed some months back in the ots project on GitHub, and the consensus was that this should first be addressed as a spec bug.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><a href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fgithub.com%2Fkhaledhosny%2Fots%2Fissues%2F146&data=02%7C01%7Cpetercon%40microsoft.com%7C1489fdd1df1545faac7a08d5a645d836%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636597741274432510&sdata=lkqKMBrAEE9C1rODq783N5kKgWIBUa3UcZKm7bSi4Oc%3D&reserved=0">https://github.com/khaledhosny/ots/issues/146</a><o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Accordingly, I have drafted this revision for the 'glyf' spec for OT 1.8.3, and suggest it for OFF:<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoNormal" style="margin-left:.5in"><i><span style="font-size:10.0pt;font-family:"Georgia",serif">Simple Glyph Flags</span></i><o:p></o:p></p>
<table class="MsoNormalTable" border="0" cellspacing="3" cellpadding="0" width="804" style="width:602.7pt;margin-left:39.0pt;background:#F0F0F0;background-position:initial initial;background-repeat:initial initial">
<tbody>
<tr>
<td width="33" style="width:24.65pt;background:silver;padding:.75pt .75pt .75pt .75pt;background-position:initial initial;background-repeat:initial initial">
<p class="MsoNormal" align="center" style="text-align:center"><i><span style="font-size:9.0pt;font-family:"Verdana",sans-serif">Mask</span></i><o:p></o:p></p>
</td>
<td width="123" style="width:92.4pt;background:silver;padding:.75pt .75pt .75pt .75pt;background-position:initial initial;background-repeat:initial initial">
<p class="MsoNormal" align="center" style="text-align:center"><i><span style="font-size:9.0pt;font-family:"Verdana",sans-serif">Name</span></i><o:p></o:p></p>
</td>
<td width="640" style="width:479.65pt;background:silver;padding:.75pt .75pt .75pt .75pt;background-position:initial initial;background-repeat:initial initial">
<p class="MsoNormal" align="center" style="text-align:center"><i><span style="font-size:9.0pt;font-family:"Verdana",sans-serif">Description</span></i><o:p></o:p></p>
</td>
</tr>
<tr>
<td colspan="3" valign="top" style="border:none;border-bottom:solid #E0E0E0 1.0pt;background:transparent;padding:.75pt .75pt .75pt .75pt;background-position:initial initial;background-repeat:initial initial">
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Verdana",sans-serif">...</span><o:p></o:p></p>
</td>
</tr>
<tr>
<td valign="top" style="border:none;border-bottom:solid #E0E0E0 1.0pt;background:#FFFF9F;padding:.75pt .75pt .75pt .75pt;background-position:initial initial;background-repeat:initial initial">
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Verdana",sans-serif;color:green">0x40</span><o:p></o:p></p>
</td>
<td valign="top" style="border:none;border-bottom:solid #E0E0E0 1.0pt;background:#FFFF9F;padding:.75pt .75pt .75pt .75pt;background-position:initial initial;background-repeat:initial initial">
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Verdana",sans-serif;color:green">OVERLAP_SIMPLE</span><o:p></o:p></p>
</td>
<td valign="top" style="border:none;border-bottom:solid #E0E0E0 1.0pt;background:#FFFF9F;padding:.75pt .75pt .75pt .75pt;background-position:initial initial;background-repeat:initial initial">
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Verdana",sans-serif;color:green">Bit 6: If set, contours in the glyph description may overlap. Use of this flag is not required in OpenType — that is, it is valid to have contours overlap without
 having this flag set. It may affect behaviors in some platforms, however. (See<span class="apple-converted-space"> </span><a href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdeveloper.apple.com%2Ffonts%2FTrueType-Reference-Manual%2FRM06%2FChap6AATIntro.html&data=02%7C01%7Cpetercon%40microsoft.com%7C6e33be6d40ee4e75827a08d5a63bfd96%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636597699014806755&sdata=XshxBKP0NlvkSx64TZweBj7T4kSZ%2FYCv7eugB5ga%2F0g%3D&reserved=0"><span style="color:#FF5200">Apple’s
 specification</span></a><span class="apple-converted-space"> </span>for details regarding behavior in Apple platforms.) When used, it must be set on the first flag byte for the glyph. See additional details below.</span><o:p></o:p></p>
</td>
</tr>
<tr>
<td valign="top" style="border:none;border-bottom:solid #E0E0E0 1.0pt;background:#FFFF9F;padding:.75pt .75pt .75pt .75pt;background-position:initial initial;background-repeat:initial initial">
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Verdana",sans-serif;color:green">0x80</span><o:p></o:p></p>
</td>
<td valign="top" style="border:none;border-bottom:solid #E0E0E0 1.0pt;background:#FFFF9F;padding:.75pt .75pt .75pt .75pt;background-position:initial initial;background-repeat:initial initial">
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Verdana",sans-serif;color:green">Reserved</span><o:p></o:p></p>
</td>
<td valign="top" style="border:none;border-bottom:solid #E0E0E0 1.0pt;background:#FFFF9F;padding:.75pt .75pt .75pt .75pt;background-position:initial initial;background-repeat:initial initial">
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Verdana",sans-serif;color:green">Bit 7 is reserved: set to zero.</span><o:p></o:p></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoNormal"> <o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:0in;margin-right:0in;margin-bottom:3.0pt;margin-left:.5in;background:#FFFF9F;background-position:initial initial;background-repeat:initial initial">
<span style="font-size:10.0pt;font-family:"Georgia",serif;color:green">A non-zero-fill algorithm is needed to avoid dropouts when contours overlap. This can be particularly relevant for variable fonts, which often make use of overlapping contours. The OVERLAP_SIMPLE
 flag is used by some rasterizer implementations to ensure that a non-zero-fill algorithm is used rather than an even-odd-fill algorithm. Note that some implementations might use this flag specifically in non-variable fonts, but not in variable fonts. Implementations
 that always use a non-zero-fill algorithm will ignore this flag. This flag can be used in order to provide broad interoperability of fonts — particularly non-variable fonts — when glyphs have overlapping contours. Tools that generate static-font data for a
 specific instance of a variable font should either set this flag when contours in the derived glyph data are overlapping, or else should merge contours to remove overlap of separate contours.</span><o:p></o:p></p>
<p class="MsoPlainText" style="margin-left:1.0in"><em><span style="font-size:10.0pt;font-family:"Georgia",serif;color:green"><o:p> </o:p></span></em></p>
<p class="MsoPlainText" style="margin-left:1.0in"><em><span style="font-size:10.0pt;font-family:"Georgia",serif;color:green">Note:
</span></em><span style="font-size:10.0pt;font-family:"Georgia",serif;color:green;background:#FFFF9F">The OVERLAP_COMPOUND flag, described below, has a similar purpose in relation to composite glyphs. The same considerations described for the OVERLAP_SIMPLE
 flag also apply to the OVERLAP_COMPOUND flag.</span><o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">And later:<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p style="mso-margin-top-alt:0in;margin-right:0in;margin-bottom:0in;margin-left:.5in;margin-bottom:.0001pt">
<em><span style="font-size:10.0pt;font-family:"Georgia",serif;color:black">Composite Glyph Flags</span></em><span style="font-size:10.0pt;font-family:"Georgia",serif;color:black"><o:p></o:p></span></p>
<table class="MsoNormalTable" border="0" cellspacing="3" cellpadding="0" width="804" style="width:602.7pt;margin-left:39.0pt;background:#F0F0F0;border-spacing: 1.33px 1.33px;caption-side: bottom;font-size-adjust: none;font-stretch: 100%;orphans: 2;-webkit-text-stroke-width: 0px;word-spacing:0px">
<tbody>
<tr style="border-spacing: 1.33px 1.33px;caption-side: bottom;font-size-adjust: none;font-stretch: 100%">
<td width="47" style="width:35.35pt;background:silver;padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal" align="center" style="text-align:center"><i><span style="font-size:9.0pt;font-family:"Verdana",sans-serif;color:black">Mask<o:p></o:p></span></i></p>
</td>
<td width="141" style="width:106.05pt;background:silver;padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal" align="center" style="text-align:center"><i><span style="font-size:9.0pt;font-family:"Verdana",sans-serif;color:black">Name<o:p></o:p></span></i></p>
</td>
<td width="607" style="width:455.3pt;background:silver;padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal" align="center" style="text-align:center"><i><span style="font-size:9.0pt;font-family:"Verdana",sans-serif;color:black">Description<o:p></o:p></span></i></p>
</td>
</tr>
<tr style="border-spacing: 1.33px 1.33px;caption-side: bottom;font-size-adjust: none;font-stretch: 100%" id="compositeGlyphFlags_0001">
<td colspan="3" valign="top" style="border:none;border-bottom:solid #E0E0E0 1.0pt;background:transparent;padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Verdana",sans-serif;color:black">...<o:p></o:p></span></p>
</td>
</tr>
<tr style="border-spacing: 1.33px 1.33px;caption-side: bottom;font-size-adjust: none;font-stretch: 100%" id="compositeGlyphFlags_0400">
<td valign="top" style="border:none;border-bottom:solid #E0E0E0 1.0pt;background:transparent;padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Verdana",sans-serif;color:black">0x0400<o:p></o:p></span></p>
</td>
<td valign="top" style="border:none;border-bottom:solid #E0E0E0 1.0pt;background:transparent;padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Verdana",sans-serif;color:black">OVERLAP_COMPOUND<o:p></o:p></span></p>
</td>
<td valign="top" style="border:none;border-bottom:solid #E0E0E0 1.0pt;background:transparent;padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Verdana",sans-serif;color:black">Bit 10: If set, the components of the compound glyph overlap. Use of this flag is not required in OpenType — that is, it is valid to have components overlap without
 having this flag set. It may affect behaviors in some platforms, however. (See <a href="https://na01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdeveloper.apple.com%2Ffonts%2FTrueType-Reference-Manual%2FRM06%2FChap6glyf.html&data=02%7C01%7Cpetercon%40microsoft.com%7C1489fdd1df1545faac7a08d5a645d836%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C636597741274442518&sdata=tfjYTNh8WFP2xpO2U%2BnAyeXWC5VgSnbcVzZ%2BMqf1QpM%3D&reserved=0">
<span style="color:#FF5200">Apple’s specification</span></a> for details regarding behavior in Apple platforms.)
</span><span class="highlight"><span style="font-size:9.0pt;font-family:"Verdana",sans-serif;color:green;background:#FFFF9F">When used, it must be set on the flag word for the first component. See additional remarks, above, for the similar OVERLAP_SIMPLE flag
 used in simple-glyph descriptions.</span></span><span style="font-size:9.0pt;font-family:"Verdana",sans-serif;color:black"><o:p></o:p></span></p>
</td>
</tr>
<tr style="border-spacing: 1.33px 1.33px;caption-side: bottom;font-size-adjust: none;font-stretch: 100%" id="compositeGlyphFlags_0800">
<td colspan="3" valign="top" style="border:none;border-bottom:solid #E0E0E0 1.0pt;background:transparent;padding:.75pt .75pt .75pt .75pt">
<p class="MsoNormal"><span style="font-size:9.0pt;font-family:"Verdana",sans-serif;color:black">...<o:p></o:p></span></p>
</td>
</tr>
</tbody>
</table>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Comments are welcome.<o:p></o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText"><o:p> </o:p></p>
<p class="MsoPlainText">Peter<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>