title: why throw java.awt.FontFormatException, however i can open the tff file in windows
body: <p>the code is below:</p>
  
  <pre><code>Font getFont(String fontPath) throws IOException, FontFormatException {
          fis = new FileInputStream(fontPath);
          bis = new java.io.BufferedInputStream(fis);
          Font tmp = null;
          try {
              tmp = Font.createFont(Font.TRUETYPE_FONT, bis);
          } catch (FontFormatException e) {
              e.printStackTrace();
              bis.close();
              fis = new FileInputStream(fontPath);
              bis = new java.io.BufferedInputStream(fis);
              tmp = Font.createFont(Font.TYPE1_FONT, bis);
          }
  
          return tmp.deriveFont(96.0f);
      }
  </code></pre>
  
  <p>this code is not always work!!!.<br>
  it will throw java.awt.FontFormatException for some font file, however, that font file can be open correctly in windows...why </p>
  
  <p>it will first throw:
  java.awt.FontFormatException: Font name not found</p>
  
  <p>and then throw:
  java.awt.FontFormatException: bad pfa font</p>