[tex-live] XeTeX Complete Success

Jiang Jiang gzjjgod at gmail.com
Sun Apr 26 22:22:24 CEST 2015


On Sun, Apr 26, 2015 at 9:00 PM, Jiang Jiang <gzjjgod at gmail.com> wrote:
> Hi Werner,
>
> Do you aware of any problem with FreeType's TTC support in regards to
> Hannotate.ttc and HanziPen.ttc added in OS X 10.9?
>
> XeTeX has the following code:
>
> error = FT_New_Face(gFreeTypeLibrary, (char *) pathname, 0, &face);
> if (!error) {
>     if (face->num_faces > 1) {
>         int num_faces = face->num_faces;
>         char *ps_name1 = getNameFromCTFont(ctFontRef, kCTFontPostScriptNameKey);
>         int i;
>         *index = -1;
>         FT_Done_Face (face);
>         for (i = 0; i < num_faces; i++) {
>             error = FT_New_Face (gFreeTypeLibrary, (char *) pathname, i, &face);
>             if (!error) {
>                 const char *ps_name2 = FT_Get_Postscript_Name(face);
>                 if (strcmp(ps_name1, ps_name2) == 0) {
>                     *index = i;
>                     break;
>                 }
>                 FT_Done_Face (face);
>             }
>         }
>         free(ps_name1);
>     }
> }
>
> to read a font from ttc and find out the index, for HanziPen.ttc for
> instance there should be 4 faces, which face->num_faces reported
> correctly. However, FT_Get_Postscript_Name() returned: HanziPenSC-W3,
> HanziPenSC-W3, HanziPenSC-W5, HanziPenSC-W5 for these 4 faces, while
> the correct ones should be: HanziPenSC-W3, HanziPenTC-W3,
> HanziPenSC-W5, HanziPenTC-W5.

Looks like that's because for CFF fonts, we use the CFFFontName stored
in 'CFF ' table as the PostScript name instead of using the 'name'
table.

Unfortunately for these two fonts, the CFFFontName in 'CFF ' aren't
always correct for the TC variants.

I'm not sure if there is anything we can do here. Force getting
PostScript name from 'name' table?

- Jiang


More information about the tex-live mailing list