I'm making a call to org.apache.fop.tools.fontlist.FontListGenerator.listFonts( ... ) to get a list of font names for my desktop application. To get the font names, I take the keys from the returned fontFamilies SortedMap; the actual data is junked.
I hadn't realised just how much memory is used by listfont( ... ) - on some platforms such as Windows 7, in excess of 250 MB. In this case I'm hitting out of memory errors.
I was wondering if there's a simpler way (uses less memory) to get just the font names (first family names)? As I said, I don't make use of the metrics and other font details...just the first family name for each font. Digging down into listfont( ... ), I was wondering if it's safe to take the firstFamilyName and place it into a list say and then drop the following lines for the containers/sort?
Iterator iter = fontInfo.getFontTriplets().entrySet().iterator();