--- a/poppler/CairoFontEngine.cc +++ b/poppler/CairoFontEngine.cc @@ -458,6 +458,20 @@ CairoFreeTypeFont *CairoFreeTypeFont::cr codeToGID[i] = 0; if ((name = enc[i])) { codeToGID[i] = FT_Get_Name_Index(face, name); + // if ligature glyph cannot be found, try alternative naming convention + if (!codeToGID[i]) + { + if (!strcmp(name, "fi")) + codeToGID[i] = FT_Get_Name_Index(face, "f_i"); + else if (!strcmp(name, "ff")) + codeToGID[i] = FT_Get_Name_Index(face, "f_f"); + else if (!strcmp(name, "ffi")) + codeToGID[i] = FT_Get_Name_Index(face, "f_f_i"); + else if (!strcmp(name, "ffl")) + codeToGID[i] = FT_Get_Name_Index(face, "f_f_l"); + else if (!strcmp(name, "fl")) + codeToGID[i] = FT_Get_Name_Index(face, "f_l"); + } } } break;