title: Font extensions maven project does not work for JasperReports
body: <p>Don't mark duplicate with this question: <a href="https://stackoverflow.com/questions/28274197/font-extensions-does-not-work-for-jasperreports">Font extensions does not work for JasperReports</a>. It's a different case, I'm using a maven project apart.</p>
  
  <p>I am trying to add Open Sans font to jasper report in my web app. I use <a href="http://jasperreports.sourceforge.net/sample.reference/fonts/index.html#fontextensions" rel="nofollow noreferrer">font extension mechanism</a>.</p>
  
  <blockquote>
    <p><strong>This exception was thrown:</strong></p>
    
    <p>net.sf.jasperreports.engine.util.JRFontNotFoundException: Font "Open
    Sans " is not available to the JVM. See the Javadoc for more details.</p>
  </blockquote>
  
  <p><strong>I'm creating a maven project to generate the font-extension:</strong></p>
  
  <p>Here is my font.xml file:</p>
  
  
  
  <pre class="lang-html prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;fontFamilies&gt;
      &lt;fontFamily name="Open Sans"&gt;
          &lt;normal&gt;&lt;![CDATA[fonts/OpenSans/OpenSans-Regular.ttf]]&gt;&lt;/normal&gt;
          &lt;bold&gt;&lt;![CDATA[fonts/OpenSans/OpenSans-Bold.ttf]]&gt;&lt;/bold&gt;
          &lt;italic&gt;&lt;![CDATA[fonts/OpenSans/OpenSans-Italic.ttf]]&gt;&lt;/italic&gt;
          &lt;boldItalic&gt;&lt;![CDATA[fonts/OpenSans/OpenSans-BoldItalic.ttf]]&gt;&lt;/boldItalic&gt;
          &lt;pdfEncoding&gt;&lt;![CDATA[Identity-H]]&gt;&lt;/pdfEncoding&gt;
          &lt;pdfEmbedded&gt;&lt;![CDATA[true]]&gt;&lt;/pdfEmbedded&gt;
          &lt;exportFonts/&gt;
      &lt;/fontFamily&gt;
  &lt;/fontFamilies&gt;
  </code></pre>
  
  
  
  <p>and here is my <strong>jasperreports_extension.properties</strong> file : </p>
  
  
  
  <pre class="lang-html prettyprint-override"><code>net.sf.jasperreports.extension.registry.factory.fonts=net.sf.jasperreports.engine.fonts.SimpleFontExtensionsRegistryFactory
  net.sf.jasperreports.extension.simple.font.families.opensans=fonts/fonts.xml
  </code></pre>
  
  
  
  <p>Also, I have put <em>Open Sans</em> ttf files in a folder named <strong>OpenSans</strong>.</p>
  
  <p>Finally, I added the dependency, this way, to my final project (where it executes the report properly)</p>
  
  <pre><code>    &lt;dependency&gt;
          &lt;groupId&gt;com.myfonts&lt;/groupId&gt;
          &lt;artifactId&gt;myfont&lt;/artifactId&gt;
          &lt;version&gt;1.0&lt;/version&gt;
          &lt;scope&gt;compile&lt;/scope&gt;
      &lt;/dependency&gt;
  </code></pre>
  
  <p>For some reason, my report can't show the font correctly. Please let me know where I am going wrong. Thanks in advance.</p>