[
https://issues.apache.org/jira/browse/PDFBOX-6279?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18125556#comment-18125556
]
Tilman Hausherr edited comment on PDFBOX-6279 at 10/9/26 3:40 PM:
------------------------------------------------------------------
Thanks, this should solve / improve an old problem. I won't do it immediately
but this is definitively a yes. Btw look at the repository for the 2 new
subprojects which take a different approach to ligatures etc.
was (Author: tilman):
Thanks, this should solve / improve an old problem. I won't do it immediately
this is definitively a yes. Btw look at the repository for the 2 new
subprojects which take a different approach to ligatures etc.
> Missing ToUnicode entries for glyphs produced by GSUB substitutions
> -------------------------------------------------------------------
>
> Key: PDFBOX-6279
> URL: https://issues.apache.org/jira/browse/PDFBOX-6279
> Project: PDFBox
> Issue Type: Bug
> Components: PDModel
> Affects Versions: 3.0.8 PDFBox
> Reporter: Fabrice Calafat
> Priority: Minor
> Fix For: 3.0.9 PDFBox, 4.0.0
>
> Attachments: CormorantInfant-Medium.ttf
>
>
> When text is written with showText() and the font has GSUB ligatures, the
> ligature glyph has no cmap entry, so PDCIDFontType2Embedder writes no
> ToUnicode entry for it. Copy-paste and text extraction then lose those
> letters.
> For example, with a script font that has "er" and "nd" ligatures,
> "Registered" is extracted as "Registed" and "Brandenstein" as "Braenstein".
> The rendering is correct.
> The same happens with Devanagari conjuncts and with letters followed by a
> combining accent.
> *Solution:*
> When a glyph has no cmap entry, use the GSUB table to find the glyphs it
> replaces and write their text in the ToUnicode map.
> *Testing:*
> Unit tests added using Lohit-Devanagari.ttf and the IPA Gothic font
> (ipag.ttf) that is already downloaded for the tests. I've also attached
> CormorantInfant-Medium.ttf (OFL, cut down to ASCII), which has Latin
> ligatures ("Th", "ft", "gg") with no cmap entry, if you want a Latin ligature
> test.
> *Related:*
> PDFBOX-5599 (comment about "ti" not being extracted correctly with Calibri)
> PDFBOX-5875 (same idea, on the text extraction side)
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]