[Poppler-bugs] [Bug 101855] Embedded TrueType Symbols with accents not rendered correctly

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Jul 21 12:33:44 UTC 2017


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

--- Comment #7 from Adrian Johnson <ajohnson at redneon.com> ---
The first thing I noted is PDF embeds the entire original fonts making the PDF
file size unnecessarily large. The font descriptor for two of the fonts is
incorrect. It lists the encoding as WinAnsiEncoding but flags = 4 (symbolic).
Flags should be 32 (non-symbolic) for WinAnsiEncoding. Changing flags to 32 for
Calibri-Bold and Arial-Narrow causes the PDF to display correctly with poppler.
These two bugs should be reported to who ever is responsible for generating
this PDF.

There is a regression suite that can be to check your patch. The patch doesn't
look correct to me. The useMacRoman flag is for if the encoding if
MacRomanEncoding. When flags = symbolic this means look up the character
directly in the (1,0) subtable without performing any decoding. The problem in
your PDF is flags is symbolic so it maps characters directly to the (1,0)
table. But on a standard (non-subsetted) TTF font the (1,0) subtable is in
MacRoman encoding. The characters in your PDF content are assuming WinAnsi
encoding so outside of the common ASCII subset some characters are going to get
messed up.

I tested with Adobe Reader and it displays correctly. I'm not sure why. Looking
at the PDF32000 spec section 9.6.6.4, this case of an encoding specified and
flags = symbolic is not covered. So the PDF is likely non conforming but Adobe
Reader either has some additional logic to handle it or the default handling
just happens to display it as intended.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/poppler-bugs/attachments/20170721/e9182287/attachment.html>


More information about the Poppler-bugs mailing list