final boolean strict = false;
FontResolver fontResolver = FontManager.createMinimalFontResolver(useComplexScriptFeatures);
//TODO The following could be optimized by retaining the FontManager somewhere
FontManager fontManager = new FontManager();
if (cfg != null) {
FontManagerConfigurator fmConfigurator = new FontManagerConfigurator(cfg);
fmConfigurator.configure(fontManager, strict);
}
List fontCollections = new java.util.ArrayList();
fontCollections.add(new Base14FontCollection(fontManager.isBase14KerningEnabled()));