<font fontName="Great Font" />
<font fontName="Great Font" ispdfembedded="true"/>
<font fontName="Great Font" ispdfembedded="true"
- In the default, root package, create a property file with a magic name: jasperreports_extension.properties
Developers could not name it more elegant, like fonts.properties or, perfectly elegant, having none of it at all.
- Create a package for your fonts. Let's say it is foo.bar.fonts
- In this strange properties file we've made above, you have to put two things at least. One is very magical static property that normally can be hardcoded once and forever somewhere deep in the guts of JasperReports and never ever remembered anymore:
Can you read that wide?
- Another property is to reference the reference to the reference of the actual files, embedded into the JAR:
That's how to let finally Jasper find the fonts.xml file. Please not one very nasty and ugly thing: there is no leading slash prior to "foo". Noticed? If you put it (as it should be), then forget it working.
- Now, in the foo.bar.fonts package create "fonts.xml". You can change its name in step #4.
- Map your fonts there as it is in examples of JasperReports (demo/fonts).
- Compile all this assembly into a JAR file and toss in somewhere in your app $CLASSPATH. Now your PDF should pick up the font finally.