Sources in jasperreports reports on wildfly

0

I have a web project in java that runs on linux server. This project has reports created in Ireport with custom fonts, but these fonts are not displayed when I call the reports in this project. I have already followed the tutorial exposed here How to change source in PDF generated by iReport ? But even adding the JAR in the project build path sources are not recognized.

NOTE: I am exporting the reports in pdf, and when I created the font jar in IReport I was careful to mark the option to "embed" the fonts. Home OBS2: I'm using common fonts like Times New Roman (I got the default font from a micro windows).

    
asked by anonymous 16.09.2015 / 03:37

2 answers

0

I was able to solve my problem. I discovered that when creating the jar with the custom fonts by IReport or JasperSoftStudio we can not give names to fonts that have spaces. In my case for example I was creating a font with the name "Times New Roman". When I named the source as "TimesNewRoman" it worked perfectly. This is the tutorial described in How to change source in PDF generated by iReport? is correct, but you should just remember not to place spaces in the font names.

    
30.12.2015 / 22:39
0

In addition to the steps described in the reference included in the question, also include the src / main / resources / fonts folder and copy the sources you need to use in the report from C: \ Windows \ Fonts.

Also include the file in this folder a file called fontsfamily.xml containing:

<?xml version="1.0" encoding="UTF-8"?>
<fontFamilies>
   <fontFamily name="Arial">
       <normal><![CDATA[fonts/arial.ttf]]></normal>
       <bold><![CDATA[fonts/arialbd.ttf]]></bold>
       <italic><![CDATA[fonts/ariali.ttf]]></italic>
       <boldItalic><![CDATA[fonts/arialbi.ttf]]></boldItalic>
       <pdfEmbedded><![CDATA[true]]></pdfEmbedded>
   </fontFamily>
</fontFamilies>
    
25.09.2015 / 22:15