Author: tilman
Date: Sat Mar 1 16:48:54 2014
New Revision: 1573195
URL: http://svn.apache.org/r1573195
Log:
PDFBOX-1664: check for null pointer
Modified:
pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType0Font.java
pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType2Font.java
pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDTrueTypeFont.java
pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1Font.java
Modified:
pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType0Font.java
URL:
http://svn.apache.org/viewvc/pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType0Font.java?rev=1573195&r1=1573194&r2=1573195&view=diff
==
---
pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType0Font.java
(original)
+++
pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType0Font.java
Sat Mar 1 16:48:54 2014
@@ -64,8 +64,11 @@ public class PDCIDFontType0Font extends
public Font getawtFont() throws IOException
{
PDFontDescriptor fd = getFontDescriptor();
-Font awtFont = FontManager.getAwtFont(fd.getFontName());
-
+Font awtFont = null;
+if (fd.getFontName() != null)
+{
+awtFont = FontManager.getAwtFont(fd.getFontName());
+}
if (awtFont == null && fd instanceof PDFontDescriptorDictionary) {
PDFontDescriptorDictionary fdd = (PDFontDescriptorDictionary) fd;
if (fdd.getFontFile3() != null) {
Modified:
pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType2Font.java
URL:
http://svn.apache.org/viewvc/pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType2Font.java?rev=1573195&r1=1573194&r2=1573195&view=diff
==
---
pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType2Font.java
(original)
+++
pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDCIDFontType2Font.java
Sat Mar 1 16:48:54 2014
@@ -87,7 +87,10 @@ public class PDCIDFontType2Font extends
}
if (awtFont == null)
{
-awtFont = FontManager.getAwtFont(fd.getFontName());
+if (fd.getFontName() != null)
+{
+awtFont = FontManager.getAwtFont(fd.getFontName());
+}
if (awtFont != null)
{
LOG.info("Using font "+awtFont.getName()+ " instead");
Modified:
pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDTrueTypeFont.java
URL:
http://svn.apache.org/viewvc/pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDTrueTypeFont.java?rev=1573195&r1=1573194&r2=1573195&view=diff
==
---
pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDTrueTypeFont.java
(original)
+++
pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDTrueTypeFont.java
Sat Mar 1 16:48:54 2014
@@ -468,7 +468,10 @@ public class PDTrueTypeFont extends PDSi
}
if (awtFont == null)
{
-awtFont = FontManager.getAwtFont(fd.getFontName());
+if (fd.getFontName() != null)
+{
+awtFont = FontManager.getAwtFont(fd.getFontName());
+}
if (awtFont != null)
{
log.info("Using font "+awtFont.getName()+ " instead");
@@ -479,7 +482,10 @@ public class PDTrueTypeFont extends PDSi
else
{
// check if the font is part of our environment
-awtFont = FontManager.getAwtFont(fd.getFontName());
+if (fd.getFontName() != null)
+{
+awtFont = FontManager.getAwtFont(fd.getFontName());
+}
if (awtFont == null)
{
log.info("Can't find the specified font " +
fd.getFontName() );
Modified:
pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1Font.java
URL:
http://svn.apache.org/viewvc/pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1Font.java?rev=1573195&r1=1573194&r2=1573195&view=diff
==
---
pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/PDType1Font.java
(original)
+++
pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdm