xmlgraphics-fop-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bernard Giannetti <thebernmeis...@hotmail.com>
Subject RE: Still having trouble loading fonts at runtime - suggestions?
Date Tue, 12 Jun 2012 22:29:48 GMT

Hi Phillip,
I have written a desktop application which, on start up, refreshes a cache of fonts (using
FOP code) and subsequently allows the user to refresh that cache by hitting a button (again,
calls the same FOP code).
See attached.
When the application starts up I call FOPManager.refreshFonts( false );

Before allowing the user to initiate a print, I call FOPManager.isReady()
 When the user forces a cache update, I call FOPManager.refreshFonts( true );
My fopConfiguration.xml is standard and doesn't do anything fancy.


> From: phillip.oldham@gmail.com
> Date: Tue, 12 Jun 2012 16:58:49 +0100
> Subject: Still having trouble loading fonts at runtime - suggestions?
> To: fop-users@xmlgraphics.apache.org
> Hi All
> I'm still having trouble loading & using fonts while my app is
> running. I can load fonts without issue when configuring them via the
> XML config, but unfortunately the fonts are provided by a 3rd party at
> runtime and I therefore need to find a way to load them via java.
> Here's my current process (not working):
> 1. create a new FOP instance
> 2. load a number of default settings from an XML file
> 3. override some of these settings (eg. resolution) based on certain
> preferences passed in at runtime
> then, specifically regarding fonts:
> 4. create a temporary directory to store the font(s) that the 3rd
> party is providing
> 5. write each font to the temp directory
> 6. pass the temp dir to FontManager.getFontBaseURL()
> 7. process the FO file
> However, even though the FontBaseURL is changed, the fonts aren't
> loaded/used during processing. Is there a way to tell FOP/the
> FontManager to refresh it's cache/search the new directory and load
> the fonts? Is there a better approach to this?
> -- 
> Phillip B Oldham
> phillip.oldham@gmail.com
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: fop-users-unsubscribe@xmlgraphics.apache.org
> For additional commands, e-mail: fop-users-help@xmlgraphics.apache.org
View raw message