Jasper: Font extensions
To support various fonts in PDFs the fonts need to be loaded using a custom classloader. The current thread's classloader needs to be saved:
final ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader();
try {
.. do things with a custom classloader
} finally {
Thread.currentThread().setContextClassLoader(contextClassLoader);
}
The fonts can be exported as jar
by users and uploaded to file repository (e.g. /fonts
folder ?) to be embedded in PDF. This requires a net.sf.jasperreports.engine.fonts.SimpleFontExtensionsRegistryFactory
- https://community.jaspersoft.com/questions/534323/reportclassloader-and-font-extensions-issue
- http://jasperreports.sourceforge.net/sample.reference/fonts/
Note: for the moment I updated Docker to include MS core fonts (Arial). That needs to be removed when font extensions are working.