Comment 9 for bug 1531508

Revision history for this message
Dave Crossland (davelab6) wrote :

If you "ttx -s font.ttf" then font.G_S_U_B_.ttx you'll see something like,

<?xml version="1.0" encoding="UTF-8"?>
<ttFont ttLibVersion="3.0">

  <GSUB>
    <Version value="1.0"/>
    <ScriptList>
      <!-- ScriptCount=1 -->
      <ScriptRecord index="0">
        <ScriptTag value="DFLT"/>
        <Script>
          <DefaultLangSys>
            <ReqFeatureIndex value="65535"/>
            <!-- FeatureCount=4 -->
            <FeatureIndex index="0" value="0"/>
            <FeatureIndex index="1" value="1"/>
            <FeatureIndex index="2" value="2"/>
            <FeatureIndex index="3" value="4"/>
          </DefaultLangSys>
          <!-- LangSysCount=1 -->
          <LangSysRecord index="0">
            <LangSysTag value="TRK "/>
            <LangSys>
              <ReqFeatureIndex value="65535"/>
              <!-- FeatureCount=1 -->
              <FeatureIndex index="0" value="3"/>
            </LangSys>
          </LangSysRecord>
        </Script>

This is wrong, in that it contains actual LangSysRecords in the DFLT script. According to the spec at https://www.microsoft.com/typography/otspec/chapter2.htm:

"If a Script table with the script tag 'DFLT' (default) is present in the ScriptList table, it must have a non-NULL DefaultLangSys and LangSysCount must be equal to 0."

Therefore you can removed those lines, making the top of the file as follows

<?xml version="1.0" encoding="UTF-8"?>
<ttFont ttLibVersion="3.0">

  <GSUB>
    <Version value="1.0"/>
    <ScriptList>
      <!-- ScriptCount=1 -->
      <ScriptRecord index="0">
        <ScriptTag value="DFLT"/>
        <Script>
          <DefaultLangSys>
            <ReqFeatureIndex value="65535"/>
            <!-- FeatureCount=4 -->
            <FeatureIndex index="0" value="0"/>
            <FeatureIndex index="1" value="1"/>
            <FeatureIndex index="2" value="2"/>
            <FeatureIndex index="3" value="4"/>
          </DefaultLangSys>
          <!-- LangSysCount=0 -->
        </Script>

And that will hot-fix it.