I had the same issue, the fix which seems to work is to change the glyph index parsing code in the WriteGlyphs_ClusterMapping function.
I added a new helper function:
/// <summary> /// Helper method to retrieve the glpyh index from a font cmap for a given character /// </summary> /// <param name="descriptor"></param> /// <param name="ch"></param> /// <returns></returns> private int GetGlyphIndex(OpenTypeDescriptor descriptor, char ch) { int glyphID = 0; if (descriptor.fontData.cmap.symbol) { glyphID = (int)ch + (descriptor.fontData.os2.usFirstCharIndex & 0xFF00); glyphID = descriptor.CharCodeToGlyphIndex((char)glyphID); } else glyphID = descriptor.CharCodeToGlyphIndex(ch); return glyphID; }
Use the function in the code block below (line 463 in the PdfContentWriter-Glyphs.cs file) // get index of current glyph if (mapping.HasGlyphIndex) glyphIndex = mapping.GlyphIndex; else glyphIndex = GetGlyphIndex(descriptor,unicodeString[codeIdx]);
|