Author: msahyoun
Date: Sun Mar 11 19:41:52 2018
New Revision: 1826457

URL: http://svn.apache.org/viewvc?rev=1826457&view=rev
Log:
PDFBOX-4134: use Float.compare

Modified:
    
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/PostScriptTable.java

Modified: 
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/PostScriptTable.java
URL: 
http://svn.apache.org/viewvc/pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/PostScriptTable.java?rev=1826457&r1=1826456&r2=1826457&view=diff
==============================================================================
--- 
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/PostScriptTable.java 
(original)
+++ 
pdfbox/trunk/fontbox/src/main/java/org/apache/fontbox/ttf/PostScriptTable.java 
Sun Mar 11 19:41:52 2018
@@ -69,7 +69,7 @@ public class PostScriptTable extends TTF
         mimMemType1 = data.readUnsignedInt();
         maxMemType1 = data.readUnsignedInt();
 
-        if (formatType == 1.0f)
+        if (Float.compare(formatType, 1.0f) == 0)
         {
             /*
              * This TrueType font file contains exactly the 258 glyphs in the 
standard Macintosh TrueType.
@@ -77,7 +77,7 @@ public class PostScriptTable extends TTF
             glyphNames = new String[WGL4Names.NUMBER_OF_MAC_GLYPHS];
             System.arraycopy(WGL4Names.MAC_GLYPH_NAMES, 0, glyphNames, 0, 
WGL4Names.NUMBER_OF_MAC_GLYPHS);
         }
-        else if (formatType == 2.0f)
+        else if (Float.compare(formatType, 2.0f) == 0)
         {
             int numGlyphs = data.readUnsignedShort();
             int[] glyphNameIndex = new int[numGlyphs];
@@ -123,7 +123,7 @@ public class PostScriptTable extends TTF
                 }
             }
         }
-        else if (formatType == 2.5f)
+        else if (Float.compare(formatType, 2.5f) == 0)
         {
             int[] glyphNameIndex = new int[ttf.getNumberOfGlyphs()];
             for (int i = 0; i < glyphNameIndex.length; i++)
@@ -142,7 +142,7 @@ public class PostScriptTable extends TTF
             }
 
         }
-        else if (formatType == 3.0f)
+        else if (Float.compare(formatType, 3.0f) == 0)
         {
             // no postscript information is provided.
             LOG.debug("No PostScript name information is provided for the font 
" + font.getName());


Reply via email to