title: How to install and use a font in my maven project?
body: <p>I'm working with <em>JasperSoft</em> to generate <code>.pdf</code> files and <em>Java</em> as my <code>backend</code> to generate my dynamic data to fill the <code>pdf</code>. I need to add my new font as a dependency in my <code>pom.xml</code> and be able to use it in my Java code like:</p>
  
  <pre><code>new Font("Font Family Name", Font.PLAIN, 7);
  </code></pre>
  
  <p>How can I do that, please ?</p>
  
  <p><strong>EDIT</strong>
  More information about my problem. I can't get my family name correctly in Java. Debugging I found that always come with the wrong family name:</p>
  
  <pre><code>"java.awt.Font[family=Dialog,name=GothamNarrow,style=plain,size=8]"
  </code></pre>
  
  <p>This is my dependency in my <code>pom.xml:</code>    </p>
  
  <pre><code>&lt;dependency&gt;
      &lt;groupId&gt;com.company&lt;/groupId&gt;
      &lt;artifactId&gt;jFreeChartFontsCobaGothamNarrow&lt;/artifactId&gt;
      &lt;version&gt;0.0.1&lt;/version&gt;
  &lt;/dependency&gt;
  </code></pre>
  
  <p>And this is my folder structure in the <code>maven-repo</code> folder:</p>
  
  <pre><code>valter@company:$ ls -lthaR jFreeChartFontsCobaGothamNarrow/
  jFreeChartFontsCobaGothamNarrow/:
  total 16K
  drwxrwxr-x 30 valter valter 4,0K Okt 23 09:30 ..
  -rw-rw-r--  1 valter valter  331 Okt 23 09:23 maven-metadata-local.xml
  drwxrwxr-x  3 valter valter 4,0K Okt 23 09:16 .
  drwxrwxr-x  2 valter valter 4,0K Okt 23 09:16 0.0.1
  
  jFreeChartFontsCobaGothamNarrow/0.0.1:
  total 224K
  -rw-rw-r-- 1 valter valter  215 Okt 23 09:23 _maven.repositories
  drwxrwxr-x 2 valter valter 4,0K Okt 23 09:16 .
  drwxrwxr-x 3 valter valter 4,0K Okt 23 09:16 ..
  -rw-rw-r-- 1 valter valter  495 Okt 23 09:16 jFreeChartFontsCobaGothamNarrow-0.0.1.pom
  -rw-rw-r-- 1 valter valter 197K Okt 23 09:09 jFreeChartFontsCobaGothamNarrow-0.0.1.jar
  -rw-rw-r-- 1 valter valter  554 Okt 23 08:45 jFreeChartFontsCobaGothamNarrow-0.0.1.jar.lastUpdated
  -rw-rw-r-- 1 valter valter  554 Okt 23 08:45 jFreeChartFontsCobaGothamNarrow-0.0.1.pom.lastUpdated
  </code></pre>