Thanks Chris - simplest solution is often the best:
String fonts[] = 
GraphicsEnvironment.getLocalGraphicsEnvironment().getAvailableFontFamilyNames();
Getting a list of fonts this way does NOT appear to impact memory at all...so 
much better!
I don't have the <use-cache> tag in my config file, so I assume the cache is on 
by default.  I did a test run of creating a PDF:
With no <use-cache> present: memory used 111 MBWith 
<use-cache>false</use-cache> present: memory used 330 MB
I think I'll stick with the default!
Thanks again,
Bernard.

> Date: Thu, 1 Aug 2013 13:58:57 +0100
> From: bowditch_ch...@hotmail.com
> To: fop-users@xmlgraphics.apache.org
> Subject: Re: Getting a list of font names without the memory hit...‏
> 
> The auto-detect feature creates the font cache, to save time on 
> sunsequent calls to FOP, you can disable the cache using the setting: 
> <use-cache>false</use-cache> in your fop.xconf.
> 
> I suspect the reason for the high memory consumption is your use of 
> auto-detect feature. Though I've not replicated the issue. If your 
> intention  is to allow the user to pick any font installed on the 
> Operating System, why not use the java.awt classes to list the available 
> fonts instead? I've not tried it but I suspect it will use less memory 
> as it doesn't need to load the full contents of every font in the system.


                                          

Reply via email to