EkType / Mukta

Mukta is a Unicode compliant, contemporary, mono-linear font family available in seven weights, supporting Devanagari, Gujarati, Gurumukhi, Tamil and Latin scripts.
Other
149 stars 21 forks source link

Duplicate character name makes fonts not installable on OS X #1

Closed codeman38 closed 10 years ago

codeman38 commented 10 years ago

There seems to be an issue in the table of the Ek Mukta fonts which causes an error to be reported when installing the fonts on OS X 10.9.2. Specifically, the issue is that some character names are defined twice-- once as an alias, and once as an actual character name.

For instance, take the following from 03 Ek Mukta Regular.ttx:

<psNames>
  [...]
  <psName name="periodcentered#1" psName="periodcentered"/>
</psNames>
<extraNames>
  <!-- following are the name that are not taken from the standard Mac glyph order -->
  [...]
  <psName name="periodcentered"/>
  [...]
</extraNames>

The problem is that the name periodcentered is already defined as a glyph name in itself (and even has its own entry in the glyf table!), but periodcentered#1 is also aliased to periodcentered, thus causing a conflict.

I was able to make the font installable by removing the tag for periodcentered#1, though probably a better idea would be to move it inside (changing the tag to remove the psName attribute - i.e., <psName name="periodcentered#1"> - in the process).

davelab6 commented 10 years ago

Hmm! :) I looked into this, and the full XML in the post table is,

    <psNames>
      <!-- This file uses unique glyph names based on the information
           found in the 'post' table. Since these names might not be unique,
           we have to invent artificial names in case of clashes. In order to
           be able to retain the original information, we need a name to
           ps name mapping for those cases where they differ. That's what
           you see below.
            -->
      <psName name=".notdef#1" psName=".notdef"/>
      <psName name="periodcentered#1" psName="periodcentered"/>
    </psNames>

And then problem seems to be that the font has 2 glyphs that are named using the same pattern that fontTools uses for its mapping, which is <glyphname>#<int>:

    <GlyphID id="347" name="periodcentered"/>
    <GlyphID id="430" name="periodcentered#1"/>

So when the ttx file is compiled, fontTools gets confused. I fixed this in my branch, and installed the resulting files in Mac OS X 10.9.2