You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pdfbox.apache.org by ti...@apache.org on 2019/04/22 10:28:34 UTC
svn commit: r1857941 -
/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1Font.java
Author: tilman
Date: Mon Apr 22 10:28:34 2019
New Revision: 1857941
URL: http://svn.apache.org/viewvc?rev=1857941&view=rev
Log:
PDFBOX-4017: avoid NPE with euro symbol; clarify comment
Modified:
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1Font.java
Modified: pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1Font.java
URL: http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1Font.java?rev=1857941&r1=1857940&r2=1857941&view=diff
==============================================================================
--- pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1Font.java (original)
+++ pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1Font.java Mon Apr 22 10:28:34 2019
@@ -601,17 +601,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
+ // names are not found in Symbol font. 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))
+ Integer code = SymbolEncoding.INSTANCE.getNameToCodeMap().get(name);
+ if (code != null)
{
- return uniName;
+ uniName = getUniNameOfCodePoint(code + 0xF000);
+ if (genericFont.hasGlyph(uniName))
+ {
+ return uniName;
+ }
}
}
}