svn commit: r1573195 - in /pdfbox/branches/1.8/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font: PDCIDFontType0Font.java PDCIDFontType2Font.java PDTrueTypeFont.java PDType1Font.java

2014-03-01 Thread tilman
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

svn commit: r1573194 - /pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfviewer/PageDrawer.java

2014-03-01 Thread tilman
Author: tilman
Date: Sat Mar  1 16:46:19 2014
New Revision: 1573194

URL: http://svn.apache.org/r1573194
Log:
PDFBOX-1664: check for null pointer

Modified:

pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfviewer/PageDrawer.java

Modified: 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfviewer/PageDrawer.java
URL: 
http://svn.apache.org/viewvc/pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfviewer/PageDrawer.java?rev=1573194&r1=1573193&r2=1573194&view=diff
==
--- 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfviewer/PageDrawer.java 
(original)
+++ 
pdfbox/trunk/pdfbox/src/main/java/org/apache/pdfbox/pdfviewer/PageDrawer.java 
Sat Mar  1 16:46:19 2014
@@ -461,7 +461,10 @@ public class PageDrawer extends PDFStrea
 if (fdDictionary.getFontFile() == null)
 {
 // 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)
 {
 type1Font.setIsFontSubstituted(true);