Unable to use custom TTF-font in maven project

0

Hi all! 

I try to use Jasper in my project, and I am able to generate a pdf with some text. This text should use my custom TTF-font, and in iReport it uses it.

But when I generate a PDF from my maven-java-project, the text appears with some kind of default font - not with my custom font.

I have created a system-scope dependency in my POM:

   <dependency>
     <groupId>gcFonts</groupId>
     <artifactId>testFont</artifactId>
     <version>2.0</version>
     <scope>system</scope>
     <systemPath>/home/myself/myapp/reports/fonts/testfont.jar</systemPath>
   </dependency>

It does not work. What should I do?

The application shows me this stacktrace: 

апр 05, 2015 10:56:34 PM net.sf.jasperreports.extensions.DefaultExtensionsRegistry loadRegistries
SEVERE: Error instantiating extensions registry for fonts
net.sf.jasperreports.engine.JRRuntimeException: Could not load class net.sf.jasperreports.engine.fonts.SimpleFontExtensionsRegistryFactory
at net.sf.jasperreports.engine.util.ClassUtils.instantiateClass(ClassUtils.java:68)
at net.sf.jasperreports.extensions.DefaultExtensionsRegistry.instantiateRegistry(DefaultExtensionsRegistry.java:202)
at net.sf.jasperreports.extensions.DefaultExtensionsRegistry.loadRegistries(DefaultExtensionsRegistry.java:179)
at net.sf.jasperreports.extensions.DefaultExtensionsRegistry.loadRegistries(DefaultExtensionsRegistry.java:139)
at net.sf.jasperreports.extensions.DefaultExtensionsRegistry.getRegistries(DefaultExtensionsRegistry.java:125)
at net.sf.jasperreports.extensions.DefaultExtensionsRegistry.getExtensions(DefaultExtensionsRegistry.java:102)
at net.sf.jasperreports.engine.component.ComponentsEnvironment.findComponentBundles(ComponentsEnvironment.java:94)
at net.sf.jasperreports.engine.component.ComponentsEnvironment.getCachedComponentBundles(ComponentsEnvironment.java:82)
at net.sf.jasperreports.engine.component.ComponentsEnvironment.getComponentBundles(ComponentsEnvironment.java:70)
at net.sf.jasperreports.engine.xml.JRReportSaxParserFactory.getSchemaLocations(JRReportSaxParserFactory.java:162)
at net.sf.jasperreports.engine.xml.JRReportSaxParserFactory.configureParser(JRReportSaxParserFactory.java:143)
at net.sf.jasperreports.engine.xml.JRReportSaxParserFactory.createParser(JRReportSaxParserFactory.java:108)
at net.sf.jasperreports.engine.xml.JRXmlDigesterFactory.createParser(JRXmlDigesterFactory.java:1324)
at net.sf.jasperreports.engine.xml.JRXmlDigesterFactory.createDigester(JRXmlDigesterFactory.java:1299)
at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:203)
at gemcenter.utility.JasperReportsProcessor.main(JasperReportsProcessor.java:35)
Caused by: java.lang.ClassNotFoundException: net.sf.jasperreports.engine.fonts.SimpleFontExtensionsRegistryFactory
at java.net.URLClassLoader$1.run(URLClassLoader.java:366)
at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:274)
at net.sf.jasperreports.engine.util.JRClassLoader.loadClassForRealName(JRClassLoader.java:179)
at net.sf.jasperreports.engine.util.JRClassLoader.loadClassForName(JRClassLoader.java:119)
at net.sf.jasperreports.engine.util.ClassUtils.instantiateClass(ClassUtils.java:57)
... 15 more
hentai.exe's picture
Joined: Apr 4 2015 - 8:50am
Last seen: 4 years 7 months ago

0 Answers:

No answers yet
Feedback
randomness