}
/** {@inheritDoc} */
public void setupFontInfo(IFDocumentHandler documentHandler, FontInfo fontInfo)
throws FOPException {
FontManager fontManager = userAgent.getFactory().getFontManager();
List fontCollections = new java.util.ArrayList();
Configuration cfg = super.getRendererConfig(documentHandler.getMimeType());
if (cfg != null) {
try {
List fontList = buildFontListFromConfiguration(cfg);
fontCollections.add(new AFPFontCollection(
userAgent.getEventBroadcaster(), fontList));
} catch (ConfigurationException e) {
LogUtil.handleException(log, e,
userAgent.getFactory().validateUserConfigStrictly());
}
} else {
fontCollections.add(new AFPFontCollection(userAgent.getEventBroadcaster(), null));
}
fontManager.setup(fontInfo,
(FontCollection[])fontCollections.toArray(
new FontCollection[fontCollections.size()]));
documentHandler.setFontInfo(fontInfo);
}