Jump to content
Changes to the Jaspersoft community edition download ×

How do I refer to an embedded font extension from Java?


keeely

Recommended Posts

I have managed to set the global PDF font property by referencing the absolute path to a TTF with code like this:

JRPropertiesUtil.getInstance(jrContext).setProperty("net.sf.jasperreports.default.pdf.font.name","C:\fonts\arialuni.ttf");

I would now like to switch to using a font in a .jar file.  I've generated the font using the export from the studio and put it in my classpath.  How to I reference it from within the Java code?

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

What you need to do is to set the net.sf.jasperreports.default.font.name property to the family name as defined in the font extension/Jaspersoft Studio (which is not necessarily the same as the name of the physical font).

Regards,

Lucian

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...