pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1857922 - /pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1Font.java
Date Sun, 21 Apr 2019 19:02:48 GMT
Author: tilman
Date: Sun Apr 21 19:02:48 2019
New Revision: 1857922

URL: http://svn.apache.org/viewvc?rev=1857922&view=rev
Log:
PDFBOX-4017: workaround to missing Symbol font glyph names on Windows 10 since fall 2017 creators
update

Modified:
    pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1Font.java

Modified: pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1Font.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1Font.java?rev=1857922&r1=1857921&r2=1857922&view=diff
==============================================================================
--- pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1Font.java
(original)
+++ pdfbox/branches/issue45/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1Font.java
Sun Apr 21 19:02:48 2019
@@ -603,6 +603,20 @@ public class PDType1Font extends PDSimpl
                     {
                         return uniName;
                     }
+                    // PDFBOX-4017: no postscript table on Windows 10, and the low uni00NN
+                    // names are not found. What works is using the PDF code plus 0xF000
+                    // while disregarding encoding from the PDF (because of file from PDFBOX-1606;
+                    // makes sense because this segment is about finding the name in a standard
font)
+                    //TODO bring up better solution than this
+                    if ("SymbolMT".equals(genericFont.getName()))
+                    {
+                        int code = SymbolEncoding.INSTANCE.getNameToCodeMap().get(name);
+                        uniName = getUniNameOfCodePoint(code + 0xF000);
+                        if (genericFont.hasGlyph(uniName))
+                        {
+                            return uniName;
+                        }
+                    }
                 }
             }
         }



Mime
View raw message