[ https://issues.apache.org/jira/browse/PDFBOX-5384?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17504622#comment-17504622 ]
Oliver Schmidtmer commented on PDFBOX-5384: ------------------------------------------- What about handling it here, in codeToGID: {code:java} --- a/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType2.java +++ b/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType2.java @@ -253,7 +253,7 @@ public class PDCIDFontType2 extends PDCIDFont else { // fallback to the ToUnicode CMap, test with PDFBOX-1422 and PDFBOX-2560 - String unicode = parent.toUnicode(code); + String unicode = parent.getCMap().hasUnicodeMappings() ? parent.toUnicode(code) : null; if (unicode == null) { if (!noMapping.contains(code)) {code} The old implementation before the fix for PDFBOX-4322 returned "null" as there was no unicode mapping, what then caused falling through to codeToCID at this method. > Wrong glyphs used > ----------------- > > Key: PDFBOX-5384 > URL: https://issues.apache.org/jira/browse/PDFBOX-5384 > Project: PDFBox > Issue Type: Bug > Components: Rendering > Affects Versions: 2.0.25 > Reporter: Oliver Schmidtmer > Priority: Major > Labels: regression > Attachments: DOR-EC E-N20_118345.pdf, > image-2022-03-02-23-41-15-844.png > > > The attached PDF uses Tahoma fonts. > It seems the correct font is used, but it uses the wrong glyphs. > For example the "6" from the screenshot is definitely from Tahoma Glyph 25 / > CID 54, where it should be "S" Glyph 54 / CID 83. > The "=" in screenshot is Glyph 32 CID 61 where "Z" Glyph 61 CID 90 should be > used. > !image-2022-03-02-23-41-15-844.png! -- This message was sent by Atlassian Jira (v8.20.1#820001) --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@pdfbox.apache.org For additional commands, e-mail: dev-h...@pdfbox.apache.org