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

use system fonts to export pdf without copy them in font extension


thierry_gesteam

Recommended Posts

Hi,

Using font extension (to export pdf)  involve adding jar containing fonts in the application.

This one become big with few fonts.

If systems running application using jasper have already the fonts, this is a crazzy duplicates !

On Windows, system have "standard" fonts (all machine have them)

So, is there a way to use directly these system fonts without copy them in font extension ?

in iReport ?

in jasper application ?

(jasperreport 4.0.2, windows XP, 7... )

Thanks a lot

--

Thierry Hauchard

Gesteam

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Hi,

This portability requirement was the reason font extensions were introduced for.
In the case you need dynamic path definitions try to consider a dynamic font extension approach.

First, create a CustomFontExtensionsRegistry class (which implements net.sf.jasperreports.extensions.ExtensionsRegistry) with a customized getExtensions() method. There you can instantiate and load all your needed FontFamily objects using system path variables.
Second, create a CustomFontExtensionsRegistryFactory class (which implements net.sf.jasperreports.extensions.ExtensionsRegistryFactory) to instantiate a CustomFontExtensionsRegistry object.
Third, in the jasperreports_extension.properties file set the custom registry factory class:

net.sf.jasperreports.extension.registry.factory.custom.font.families=<your_package_here>.CustomFontExtensionsRegistryFactory

Finally, make sure your custom classes are in the app classpath.

Hope this helps,
sanda

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