开发者

JasperReports - specifying multiple fonts?

开发者 https://www.devze.com 2023-04-04 04:15 出处:网络
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.

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 开发者_如何学Cdrop-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?


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.


JasperReports Font Documentation - This document describes how to package fonts so you can use the same font on multiple platforms.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号