[tex-live] XeTeX Complete Success

Jiang Jiang gzjjgod at gmail.com
Sun Apr 26 23:08:39 CEST 2015

On Sun, Apr 26, 2015 at 10:57 PM, Khaled Hosny <khaledhosny at eglug.org> wrote:
> On Sun, Apr 26, 2015 at 10:22:24PM +0200, Jiang Jiang wrote:
>> On Sun, Apr 26, 2015 at 9:00 PM, Jiang Jiang <gzjjgod at gmail.com> wrote:
>> 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?
> Given that the CFF table can be shared between multiple fonts in the
> collection, I think the answer is yes. IIRC, OpenType spec used to say
> that both names must match, but that requirement was dropped in the
> latest version for this reason.

Yeah, it's possible to do something like this as a fallback in XeTeX
font matching:

FT_ULong count = FT_Get_Sfnt_Name_Count(face);
for (FT_UInt j = 0; j < count; j++) {
    FT_SfntName sfnt_name;
    error = FT_Get_Sfnt_Name(face, j, &sfnt_name);
    if (!error && sfnt_name->name_id == 6) {
        char name_str[1024];
        memcpy(name_str, sfnt_name.string, sfnt_name.string_len);
        name_str[sfnt_name.string_len] = '\0';
        if (strcmp(ps_name1, name_str) == 0) {
            *index = i;

but xdvipdfmx still has trouble handling it.

- Jiang

More information about the tex-live mailing list