Jump to content
We've recently updated our Privacy Statement, available here ×

How to define a folder for the font files?


cjs1976

Recommended Posts

Hi!

 

I must create my reports with iReport. The reports will only be printed on a real printer, or saved as pdf file.

 

For the creation of a pdf file, I have to define an alternate font file. For example ARIAL.TTF.

 

Now I can create a report and show it in JRViewer. If I print this report an a real printer, there is no problem, but if I want to save the report as pdf file, I get an exception, that the ARIAL.TTF file could not be found.

 

I am not allowed to use an other tool as iReport for creating the jrxml files. I am also not allowed to modify the files manually. I can't use FONT_MAP within my Java classes, because I don't know, what fonts the users of the software will use for their reports.

 

Is it possible to set a directory (e.g. C:WINDOWSFonts for Microsoft Windows platforms) outside of my application? Because I don't know, where the font files of the users are.

 

I tried to do this over a jasperreports.properties file, like the demo, but this didn't work.

 

I must use the JRViewer, I can't use the PDF-Export function directly.

 

Any ideas?

 

Thanks,

Christian.

Link to comment
Share on other sites

  • 3 weeks later...
  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Hi!

 

I am now using the following solution:

 

1. I have a folder called fonts in the folder of my application.

 

2. All used fonts must be in this folder.

 

3. I ship my application as JAR archive, so I have to extend my Class-Path in the Manifest.mf file with the String './fonts/' (without the quotes).

 

This system is ok for me!

 

Annotation: I use eclipse for creating my Java application, so I had to add the fonts folder as additional source folder.

 

Greetings,

Christian.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...