if (fontCache == null) {
fontCache = new FontCache();
}
List fontList = PrintRendererConfigurator.buildFontListFromConfiguration(
cfg, null, fontResolver, false, fontCache);
fontCache.save();
FontInfo fontInfo = new FontInfo();
FontSetup.setup(fontInfo, fontList, fontResolver);
graphics.setFontInfo(fontInfo);
} catch (FOPException e) {
throw new ConfigurationException("Error while setting up fonts", e);