title: JasperReports: How to add font not in the application classpath
body: <p>I am trying to use a font, that is not installed on my local OS, with a <code>JasperReports</code>. The jasper report uses in this way:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;textField&gt;  
    &lt;reportElement x="0" y="0" width="137" height="20"/&gt;  
          &lt;textElement&gt;  
      &lt;font fontName="Corbel" size="12"/&gt;  
      &lt;/textElement&gt;  
      &lt;textFieldExpression class="java.lang.String"&gt;&lt;![CDATA[$F{something}]]&gt;&lt;/textFieldExpression&gt;  
  &lt;/textField&gt;
  </code></pre>
  
  <p>The font named <em><code>Corbel</code></em> was exported as a font extension (using iReport) and is contained in file (Corbel.jar), in folder, on my system.
  I add this extension to the classpath of the application, using a code as follows:</p>
  
  <pre class="lang-java prettyprint-override"><code>ClassLoader cl = new URLClassLoader(new URL[] {new URL("file:///D:/path/to/Corbel_jar_folder/")});  
  param = new HashMap();    
  param.put(JRParameter.REPORT_CLASS_LOADER, cl);  
  jasperReport = JasperCompileManager.compileReport("d:/path/to/Report_with_Corbel_font.jrxml");  
  jasperPrint = JasperFillManager.fillReport(jasperReport, param, new JREmptyDataSource());
  </code></pre>
  
  <p>After the report is filled, I export it using a <code>JRPdfExporter</code>. However, in the result pdf file, the element does not have the <em><code>Corbel</code></em> font applied. I have not included the pdf exporting, because I think that the problem is somewhere with the filling.
  I have searched and read numerous posts and questions related to using/including fonts (i.e.font extensions) in <code>JasperReports</code>; still I am not aware of where the mistake or the problem resides.
  Any help would be greatly appreciated.</p>
  
  <p>Thank you in advance! (sorry for the bad code indentation and I hope I have included enough details)</p>