title: Issue with loading font using JaspersReport
body: <p>I have an issue with loading my own font.</p>
  
  <p>I've exported the font using iReports and this <a href="http://community.jaspersoft.com/wiki/adding-fonts-embedding-pdf" rel="nofollow noreferrer">tutorial</a>.</p>
  
  <p>This resulted in having the files:</p>
  
  <pre><code>/resources/jasperreports_extension.properties
  /resources/fonts/fontsfamily1480698239543.xml
  /resources/fonts/Lato-Bold.ttf
  /resources/fonts/Lato-BoldItalic.ttf
  /resources/fonts/Lato-Italic.ttf
  /resources/fonts/Lato-Regular.ttf
  </code></pre>
  
  <p>Where <code>jasperreports_extension.properties</code>:</p>
  
  <pre><code>net.sf.jasperreports.extension.registry.factory.fonts=net.sf.jasperreports.engine.fonts.SimpleFontExtensionsRegistryFactory
  net.sf.jasperreports.extension.registry.factory.simple.font.families=net.sf.jasperreports.engine.fonts.SimpleFontExtensionsRegistryFactory
  net.sf.jasperreports.extension.simple.font.families.Lato=fonts/fontsfamily1480698239543.xml
  </code></pre>
  
  <p>And <code>fontsfamily1480698239543.xml</code>:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;fontFamilies&gt;
     &lt;fontFamily name="Lato"&gt;
         &lt;normal&gt;&lt;![CDATA[fonts/Lato-Regular.ttf]]&gt;&lt;/normal&gt;
         &lt;bold&gt;&lt;![CDATA[fonts/Lato-Bold.ttf]]&gt;&lt;/bold&gt;
         &lt;italic&gt;&lt;![CDATA[fonts/Lato-Italic.ttf]]&gt;&lt;/italic&gt;
         &lt;boldItalic&gt;&lt;![CDATA[fonts/Lato-BoldItalic.ttf]]&gt;&lt;/boldItalic&gt;
         &lt;pdfEncoding&gt;&lt;![CDATA[Cp1250]]&gt;&lt;/pdfEncoding&gt;
         &lt;pdfEmbedded&gt;&lt;![CDATA[true]]&gt;&lt;/pdfEmbedded&gt;
     &lt;/fontFamily&gt;
  &lt;/fontFamilies&gt;
  </code></pre>
  
  <p>In my report.jrxml I use the following for text:</p>
  
  <pre><code>        &lt;staticText&gt;
              &lt;reportElement style="Colored" x="119" y="93" width="161" height="15" uuid="724f085b-cb64-4d11-ac64-dc23e6f04553"/&gt;
              &lt;textElement markup="none"&gt;
                  &lt;font fontName="Lato" size="10" pdfEncoding="Cp1250" isPdfEmbedded="true"/&gt;
              &lt;/textElement&gt;
              &lt;text&gt;&lt;![CDATA[Whatever]]&gt;&lt;/text&gt;
          &lt;/staticText&gt;
  
          &lt;staticText&gt;
              &lt;reportElement x="198" y="200" width="154" height="24" uuid="95b310d8-19bf-4485-840f-f3f5076b225e"/&gt;
              &lt;textElement markup="none"&gt;
                  &lt;font size="14" isItalic="false" isUnderline="false" pdfFontName="Lato" pdfEncoding="Cp1250" isPdfEmbedded="true"/&gt;
              &lt;/textElement&gt;
              &lt;text&gt;&lt;![CDATA[Address:]]&gt;&lt;/text&gt;
          &lt;/staticText&gt;
  </code></pre>
  
  <p>When I am trying to generate the file, I get the following error:</p>
  
  <pre><code>net.sf.jasperreports.engine.JRRuntimeException: Could not load the following font: 
  pdfFontName: Lato
  pdfEncoding: Cp1250
  isPdfEmbedded : true] with root cause
  net.sf.jasperreports.engine.JRRuntimeException: Could not load the following font: 
  pdfFontName: Lato
  pdfEncoding: Cp1250
  isPdfEmbedded : true
      at net.sf.jasperreports.engine.export.JRPdfExporter.getFont(JRPdfExporter.java:2176) ~[jasperreports-6.1.0.jar:6.1.0]
  </code></pre>
  
  <p>What am I doing wrong?</p>
  
  <p><strong>Update</strong></p>
  
  <p>I've applied changes with accordance to comment by AlexK and dada67, but this still didn't changed the font that is generated in the PDF. However, I can see the font in iReports application. I now use:</p>
  
  <pre><code>        &lt;staticText&gt;
              &lt;reportElement x="198" y="200" width="154" height="24" uuid="95b310d8-19bf-4485-840f-f3f5076b225e"/&gt;
              &lt;textElement markup="none"&gt;
                  &lt;font size="14" fontName="Lato"/&gt;
              &lt;/textElement&gt;
              &lt;text&gt;&lt;![CDATA[Address:]]&gt;&lt;/text&gt;
          &lt;/staticText&gt;
  </code></pre>
  
  <p>Which doesn't throw any error.</p>
  
  <p>Here is how I generate the pdf in java:</p>
  
  <pre><code>ClassLoader classLoader = getClass().getClassLoader();
  JasperReport jasperReportSpec = JasperCompileManager.compileReport(classLoader.getResourceAsStream("reporting/Example.jrxml"));
  JasperPrint jasperPrintSpec = JasperFillManager.fillReport(jasperReportSpec, parameters, new JREmptyDataSource());
  files.put("generatedFile", JasperExportManager.exportReportToPdf(jasperPrintSpec));
  </code></pre>