[Poppler-bugs] [Bug 34522] mapping problem with ligatures and accents

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Wed Feb 23 03:42:41 PST 2011


https://bugs.freedesktop.org/show_bug.cgi?id=34522

--- Comment #13 from Adrian Johnson <ajohnson at redneon.com> 2011-02-23 03:42:41 PST ---
Created an attachment (id=43699)
 View: https://bugs.freedesktop.org/attachment.cgi?id=43699
 Review: https://bugs.freedesktop.org/review?bug=34522&attachment=43699

encoding fix

I had another look at the PDF file to see why it works when the substitute font
is Type 1 but not when it is TrueType. There are two non-embedded fonts in the
PDF named "Optima". One has a modified encoding while the other does not. I was
looking at the wrong font. The PDF file does correctly map the character used
for the fi ligature to the glyph name "/fi".

The problem is a bug in poppler. When Optima is substituted with a TrueType
font, Gfx8BitFont::getCodeToGIDMap() is called to get the mapping from the PDF
character codes to the font GID. This function assumes that the font in the PDF
is always a TrueType font. When the PDF font is a Type 1 font it needs to go
through the glyph names in the enc array to map them to the TrueType GID
numbers. It is not doing this when no /Encoding is defined in the Type 1 font
dictionary.

The attached patch seems to fix this. I have not done much testing with it or
done enough analysis of the code to be confident that this work for all cases
without causing regressions. But so far it has worked on the PDF files I have
tested the patch with.

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the Poppler-bugs mailing list