1

I'm working with JasperSoft to generate .pdf files and Java as my backend to generate my dynamic data to fill the pdf. I need to add my new font as a dependency in my pom.xml and be able to use it in my Java code like:

new Font("Font Family Name", Font.PLAIN, 7);

How can I do that, please ?

EDIT More information about my problem. I can't get my family name correctly in Java. Debugging I found that always come with the wrong family name:

"java.awt.Font[family=Dialog,name=GothamNarrow,style=plain,size=8]"

This is my dependency in my pom.xml:

<dependency>
    <groupId>com.company</groupId>
    <artifactId>jFreeChartFontsCobaGothamNarrow</artifactId>
    <version>0.0.1</version>
</dependency>

And this is my folder structure in the maven-repo folder:

valter@company:$ ls -lthaR jFreeChartFontsCobaGothamNarrow/
jFreeChartFontsCobaGothamNarrow/:
total 16K
drwxrwxr-x 30 valter valter 4,0K Okt 23 09:30 ..
-rw-rw-r--  1 valter valter  331 Okt 23 09:23 maven-metadata-local.xml
drwxrwxr-x  3 valter valter 4,0K Okt 23 09:16 .
drwxrwxr-x  2 valter valter 4,0K Okt 23 09:16 0.0.1

jFreeChartFontsCobaGothamNarrow/0.0.1:
total 224K
-rw-rw-r-- 1 valter valter  215 Okt 23 09:23 _maven.repositories
drwxrwxr-x 2 valter valter 4,0K Okt 23 09:16 .
drwxrwxr-x 3 valter valter 4,0K Okt 23 09:16 ..
-rw-rw-r-- 1 valter valter  495 Okt 23 09:16 jFreeChartFontsCobaGothamNarrow-0.0.1.pom
-rw-rw-r-- 1 valter valter 197K Okt 23 09:09 jFreeChartFontsCobaGothamNarrow-0.0.1.jar
-rw-rw-r-- 1 valter valter  554 Okt 23 08:45 jFreeChartFontsCobaGothamNarrow-0.0.1.jar.lastUpdated
-rw-rw-r-- 1 valter valter  554 Okt 23 08:45 jFreeChartFontsCobaGothamNarrow-0.0.1.pom.lastUpdated
Alex K
  • 22,315
  • 19
  • 108
  • 236
Valter Silva
  • 16,446
  • 52
  • 137
  • 218
  • See http://search.maven.org/#search|ga|1|a%3A%22jasperreports-fonts%22. – Aleksandr M Oct 23 '15 at 09:41
  • @AleksandrM sorry, but I don't get it. Can you explain it, please ? I really need help with this. – Valter Silva Oct 23 '15 at 10:06
  • What exact problem do you have? Have you looked at pom/jar file in link? – Aleksandr M Oct 23 '15 at 10:09
  • @AleksandrM I updated my question. The problem is that Java cannot find my font family name correctly. I added the font as my dependency, but still not working. – Valter Silva Oct 23 '15 at 10:42
  • The solution is using font-extensions and the with maven be a Tunaki and do http://stackoverflow.com/questions/35023908/jasperreports-extension-properties-overwritten-by-maven-assembly-plugin/35025718#35025718 – Petter Friberg Jan 26 '16 at 23:30

0 Answers0