Skip to content
Browse files

PDFBOX-2957: omit the CID2GID mapping if the embedded font is replace…

…d by an external font

git-svn-id: https://svn.apache.org/repos/asf/pdfbox/trunk@1728988 13f79535-47bb-0310-9956-ffa450edef68
1 parent 4d9c94f commit 094edc30c623ed6e35adc4d0b48fd8fdc4a0f3ff @lehmi lehmi committed
Showing with 2 additions and 2 deletions.
  1. +2 −2 pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType2.java
View
4 pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType2.java
@@ -286,8 +286,8 @@ public int codeToGID(int code) throws IOException
// encoding specified by the predefined CMap to one of the encodings in the TrueType
// font's 'cmap' table. The means by which this is accomplished are implementation-
// dependent.
-
- if (cid2gid != null)
+ // omit the CID2GID mapping if the embedded font is replaced by an external font
+ if (cid2gid != null && !isDamaged)
{
// Acrobat allows non-embedded GIDs - todo: can we find a test PDF for this?
LOG.warn("Using non-embedded GIDs in font " + getName());

0 comments on commit 094edc3

Please sign in to comment.
Something went wrong with that request. Please try again.