[ 
https://issues.apache.org/jira/browse/PDFBOX-5094?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17277753#comment-17277753
 ] 

Andreas Lehmkühler commented on PDFBOX-5094:
--------------------------------------------

The current implementation uses the an internal font cmap for a symbolic font 
which maps the wrong glyph.

Excerpt of the spec (9.6.6.4 Encodings for TrueType Fonts)
{quote}If the font has a named Encoding entry of either MacRomanEncoding or 
WinAnsiEncoding, or if the font
 descriptor’s Nonsymbolic flag (see Table 123) is set, the conforming reader 
shall create a table that maps from
 character codes to glyph names:
 * If the Encoding entry is one of the names MacRomanEncoding or 
WinAnsiEncoding, the table shall be initialized
 with the mappings described in Annex D.{quote}

I've changed the implementation in 
{{org.apache.pdfbox.pdmodel.font.PDTrueTypeFont.codeToGID(int)}} and it works. 
But the described procedure was introduced in PDF 1.3 and I'm not sure if my 
changes have some unwanted effects if it comes to PDFs < 1.3. WDYT?




> Wrong glyph when rendering a symbolic TTF font with WinANSIEncoding
> -------------------------------------------------------------------
>
>                 Key: PDFBOX-5094
>                 URL: https://issues.apache.org/jira/browse/PDFBOX-5094
>             Project: PDFBox
>          Issue Type: Bug
>          Components: Rendering
>    Affects Versions: 2.0.22, 3.0.0 PDFBox
>            Reporter: Andreas Lehmkühler
>            Assignee: Andreas Lehmkühler
>            Priority: Major
>             Fix For: 2.0.23, 3.0.0 PDFBox
>
>         Attachments: DokumentAusVorlage_Test_PdfBox-1.pdf
>
>
> The attached PDF uses a TTF font which isn't embedded. It's marked as 
> symbolic but uses a WinANSIEncoding. Instead of the german umlaut "ü" another 
> special character is rendered



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to