}
/** {@inheritDoc} */
public void setupFontInfo(IFDocumentHandler documentHandler, FontInfo fontInfo)
throws FOPException {
final FontManager fontManager = userAgent.getFactory().getFontManager();
final Java2DFontMetrics java2DFontMetrics = new Java2DFontMetrics();
final List fontCollections = new java.util.ArrayList();
fontCollections.add(new Base14FontCollection(java2DFontMetrics));
fontCollections.add(new InstalledFontCollection(java2DFontMetrics));
Configuration cfg = super.getRendererConfig(documentHandler.getMimeType());
if (cfg != null) {
FontResolver fontResolver = new DefaultFontResolver(userAgent);
FontEventListener listener = new FontEventAdapter(
userAgent.getEventBroadcaster());
List fontList = buildFontList(cfg, fontResolver, listener);
fontCollections.add(new ConfiguredFontCollection(fontResolver, fontList,
userAgent.isComplexScriptFeaturesEnabled()));
}
fontManager.setup(fontInfo,
(FontCollection[])fontCollections.toArray(
new FontCollection[fontCollections.size()]));
documentHandler.setFontInfo(fontInfo);
}