title: Java Can't Read font
body: <p>Ok, so I have a problem using a custom font. Basically I get a custom font I downloaded off the internet and use it in my program. When I run the program in Eclipse (the editor I use), everything works fine, and there is no problem. BUT, whenever I export it to a jar from eclipse, or try to run it from the command prompt I get this very annoying error:</p>
  
  <pre><code>java.io.IOException: Can't read REVOLUTION.ttf
      at java.awt.Font.createFont(Unknown Source)
      at TowerDefense.&lt;init&gt;(TowerDefense.java:55)
      at TowerDefense.main(TowerDefense.java:302)
  </code></pre>
  
  <p>I get that along with a bunch of null pointer exceptions because of where I use the font. But I don't know why it says it can't read it. Here is  the code that creates the font:</p>
  
  <pre><code>try {
          revolution = Font.createFont(Font.TRUETYPE_FONT, new File("REVOLUTION.ttf"));
          GraphicsEnvironment ge = GraphicsEnvironment.getLocalGraphicsEnvironment();
          ge.registerFont(revolution);
      }
      catch (Exception e) {
          e.printStackTrace();
      }
  </code></pre>
  
  <p><strong>FOLDER LAYOUT</strong></p>
  
  <p>TowerDefense</p>
  
  <pre><code>src
      default package
          TowerDefense.java
          Game.java
          DragTest.java
  JRE System Library
  REVOLUTION.ttf
  neuropol.ttf
  </code></pre>