thierry_gesteam Posted August 17, 2011 Share Posted August 17, 2011 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 HauchardGesteam Link to comment Share on other sites More sharing options...
szaharia Posted August 22, 2011 Share Posted August 22, 2011 Hi,Actually, the fonts themselves are not required as part of the font extension jar. But you have to properly set the path to the font files existing on the Windows machine in the font extension xml file.HTH,sanda Link to comment Share on other sites More sharing options...
thierry_gesteam Posted August 25, 2011 Author Share Posted August 25, 2011 Thanks sanda, I suppose i can't use system variable in the path. But the font folder path is not constant on all systems.So, it seem impossible to distribute an application using system font without coping them in the jar. :-( Regards,Thierry Hauchard Link to comment Share on other sites More sharing options...
szaharia Posted August 25, 2011 Share Posted August 25, 2011 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>.CustomFontExtensionsRegistryFactoryFinally, make sure your custom classes are in the app classpath. Hope this helps,sanda Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now