title: add .ttf file to java project
body: <p>I have downloaded akshar.ttf file and want to add it to my java project. I have tried the following ways by searching online but nothing worked so far.</p>
  
  <p>Try 1:</p>
  
  <pre><code>Font ttfBase = null;
          Font ttfReal = null;
          try {
              InputStream myStream = new BufferedInputStream(new FileInputStream("akshar.TTF"));
              ttfBase = Font.createFont(Font.TRUETYPE_FONT, myStream);
              ttfReal = ttfBase.deriveFont(Font.PLAIN, 24);
          } catch (Exception ex) {
              ex.printStackTrace();
              System.err.println("akshar font not loaded.");
          }
  </code></pre>
  
  <p>Try 2:</p>
  
  <pre><code>Font font = new Font("akshar",Font.PLAIN,15);
  </code></pre>
  
  <p>I have the akshar.ttf file at the following places:-</p>
  
  <ol>
  <li>java/jre/lib/fonts</li>
  <li>bin folder of my project</li>
  <li>src folder of my project</li>
  </ol>
  
  <p>I am new to java and have tried all these by following various links online. Please help me where am i going wrong. </p>