fcalafat opened a new pull request, #537: URL: https://github.com/apache/pdfbox/pull/537
When `showText()` applies GSUB substitutions, a ligature glyph (like "er" or "nd" in a script font) has no cmap entry, so `PDCIDFontType2Embedder` writes no ToUnicode entry for it and text extraction drops those letters: "Registered" is extracted as "Registed". **Fix:** * When a glyph has no cmap entry, look it up in the font's GSUB table and write the text of the glyphs it replaces. (`pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType2Embedder.java`) **Testing:** * Added two tests that write text, extract it, and compare: Devanagari conjuncts with `Lohit-Devanagari.ttf`, and Latin letters with a combining accent with the IPA Gothic font already downloaded for the tests. Both fail without the fix. (`pdfbox/src/test/java/org/apache/pdfbox/pdmodel/font/TestFontEmbedding.java`) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
