pdfbox-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From til...@apache.org
Subject svn commit: r1743148 - /pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FontMapperImpl.java
Date Tue, 10 May 2016 10:16:48 GMT
Author: tilman
Date: Tue May 10 10:16:48 2016
New Revision: 1743148

URL: http://svn.apache.org/viewvc?rev=1743148&view=rev
Log:
PDFBOX-3344: replace the instanceof with a not null clause, optimize sort order, as suggested
by Andreas Lehmkühler

Modified:
    pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FontMapperImpl.java

Modified: pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FontMapperImpl.java
URL: http://svn.apache.org/viewvc/pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FontMapperImpl.java?rev=1743148&r1=1743147&r2=1743148&view=diff
==============================================================================
--- pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FontMapperImpl.java
(original)
+++ pdfbox/branches/2.0/pdfbox/src/main/java/org/apache/pdfbox/pdmodel/font/FontMapperImpl.java
Tue May 10 10:16:48 2016
@@ -379,18 +379,18 @@ final class FontMapperImpl implements Fo
             return t1;
         }
 
-        OpenTypeFont otf = (OpenTypeFont) findFont(FontFormat.OTF, postScriptName);
-        if (otf instanceof OpenTypeFont)
-        {
-            return otf;
-        }
-
         TrueTypeFont ttf = (TrueTypeFont)findFont(FontFormat.TTF, postScriptName);
         if (ttf != null)
         {
             return ttf;
         }
 
+        OpenTypeFont otf = (OpenTypeFont) findFont(FontFormat.OTF, postScriptName);
+        if (otf != null)
+        {
+            return otf;
+        }
+
         return null;
     }
 



Mime
View raw message