diff --git a/poppler/GfxFont.cc b/poppler/GfxFont.cc index b59ec06..24ede9e 100644 --- a/poppler/GfxFont.cc +++ b/poppler/GfxFont.cc @@ -1695,14 +1695,13 @@ int *Gfx8BitFont::getCodeToGIDMap(FoFiTrueType *ff) { // To match up with the Adobe-defined behaviour, we choose a cmap // like this: // 1. If the PDF font has an encoding: - // 1a. If the PDF font specified MacRomanEncoding and the + // 1a. If the TrueType font has a Microsoft Unicode + // cmap or a non-Microsoft Unicode cmap, use it, and use the + // Unicode indexes, not the char codes. + // 1b. If the PDF font specified MacRomanEncoding and the // TrueType font has a Macintosh Roman cmap, use it, and // reverse map the char names through MacRomanEncoding to // get char codes. - // 1b. If the PDF font is not symbolic or the PDF font is not - // embedded, and the TrueType font has a Microsoft Unicode - // cmap or a non-Microsoft Unicode cmap, use it, and use the - // Unicode indexes, not the char codes. // 1c. If the PDF font is symbolic and the TrueType font has a // Microsoft Symbol cmap, use it, and use char codes // directly (possibly with an offset of 0xf000). @@ -1735,13 +1734,12 @@ int *Gfx8BitFont::getCodeToGIDMap(FoFiTrueType *ff) { useMacRoman = gFalse; useUnicode = gFalse; if (hasEncoding || type == fontType1) { - if (usesMacRomanEnc && macRomanCmap >= 0) { - cmap = macRomanCmap; - useMacRoman = gTrue; - } else if ((!(flags & fontSymbolic) || embFontID.num < 0) && - unicodeCmap >= 0) { + if (unicodeCmap >= 0) { cmap = unicodeCmap; useUnicode = gTrue; + } else if (usesMacRomanEnc && macRomanCmap >= 0) { + cmap = macRomanCmap; + useMacRoman = gTrue; } else if ((flags & fontSymbolic) && msSymbolCmap >= 0) { cmap = msSymbolCmap; } else if ((flags & fontSymbolic) && macRomanCmap >= 0) {