Font Extensions
Problem
When a JasperReport is exported (e.g., as a PDF file), fonts are not formatted correctly. Bold, italic, or bold-italic styles are missing or ignored in the exported output.
In contrast, formatting is correctly displayed when the report is viewed in the ADITO client. This discrepancy is due to missing or incorrect font embedding during PDF generation.
Solution
Fonts used in reports must be embedded in the export context. The font extension must be deployed on the ADITO Server for server-side exports.
Procedure: Creating a Font Extension
Step 1: Start the Designer
Start the JasperReports Designer.
The Designer may need to be launched with administrative privileges to allow writing font data to disk.
Step 2: Open the Font Configuration
Navigate via:
Einstellungen → Install Fonts
)
Figure: Font configuration in the iReport Designer via ADITO Start Button
Click Install Fonts, then Browse.
Step 3: Select Font Files
Start by selecting the normal TrueType font (e.g., SegoeUI.ttf
).
Figure: Selecting the normal font file in the Font Installation step
Click Open and proceed. Then add .ttf
files for:
- Bold
- Italic
- BoldItalic
Figure: Assigning bold, italic, and bold-italic variants in the Family Details step
Step 4: Configure Font Properties
- Set PDF Encoding to
Identity-H
(recommended) - Enable Embed this font in the PDF document
Step 5: Export as Extension
Click Export as Extension to generate a .jar
file.
Step 6: Adjust the font.xml
File
Before deployment, the .jar
must be modified.
- Extract the
.jar
file - Locate the
fonts/font.xml
file - Remove all
<![CDATA[...]]>
sections - Set
<pdfEmbedded>
totrue
Invalid Example
<fontFamily name="Verdana">
<normal><![CDATA[fonts/verdana.ttf]]></normal>
<bold><![CDATA[fonts/verdanab.ttf]]></bold>
<italic><![CDATA[fonts/verdanai.ttf]]></italic>
<boldItalic><![CDATA[fonts/verdanaz.ttf]]></boldItalic>
<pdfEmbedded><![CDATA[false]]></pdfEmbedded>
</fontFamily>
Corrected Example
<fontFamily name="Verdana">
<normal>fonts/verdana.ttf</normal>
<bold>fonts/verdanab.ttf</bold>
<italic>fonts/verdanai.ttf</italic>
<boldItalic>fonts/verdanaz.ttf</boldItalic>
<pdfEmbedded>true</pdfEmbedded>
</fontFamily>
Always set <pdfEmbedded>
to true
. If omitted or set to false
, text formatting may be lost during PDF export.
Deployment
Server-side Export
Copy the .jar
to:
$ADITOHOME\lib\server\ext
Licensing and Legal Considerations
Fonts may not be bundled with ADITO software builds due to licensing restrictions.
They must be installed and licensed by the customer.
If you want to use a non-standard font (e.g. Meta), ensure that:
- The font is legally licensed
- It allows embedding
- The file has the installable permission
Figure: Meta font marked as "Installierbar" (installable) in Windows font properties
If the font is not marked as installable, the PDF export will fail with a runtime error.