Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

JasperReports - specifying multiple fonts?

I need UTF8-capable reports, and I need to be able to run on CentOS, Windows, and Mac. This is particularly tricky, as the set of shared UTF-8 fonts seems to be non-existent.

In iReport, you can set a single font via a drop-down box, and there doesn't seem to be a way to specify multiple fonts. Is there any way I can use a list of arial fonts to try for a given field? Or is there a better way to support running on multiple platforms?

like image 943
Stefan Kendall Avatar asked Sep 12 '11 20:09

Stefan Kendall


1 Answers

Normally the correct answer to cross-platform font problems is "use font extensions", and Stefan's link provides the solution.

In your case the requirement for "CentOS, Windows, and Mac" is really a bit of a red herring. Your real requirement seems to be "a free True Type Font that covers all of the characters you will use". If you had that, you could use use font extensions on any platform and life would be perfect.

MS Arial Unicode would probably meet the requirement... except that it's not free.

There's really only one Arial font. It's owned by Monotype Imaging. There are subsets and families and styles... but they are all part of the one Arial. So I don't think the phrase "a list of arial fonts" is strictly meaningful.

But you would probably be happy with a set of N fonts that are all sufficiently similar to Arial for your needs, and between them they cover all of the characters you need. Maybe start with Liberation Fonts, throw in UMing, a little of this, a little of that... Assuming you can find all the fonts you need... you're still stuck. Sorry. You need this feature enhancement to have a way to tell JasperReports to link different physical fonts to one logical font defined as a font extension. It actually came up in a different context (as indicated in the request), but I think it would perfectly meet your needs. Please vote it up.

Until that's available, sites like unifont have quite a few fonts available. Maybe one is good enough for your needs.

like image 196
mdahlman Avatar answered Oct 23 '22 16:10

mdahlman