if ( fm.getClass().getName().equals("org.docx4j.fonts.BestMatchingMapper") ) {
// 2. For each font, find the closest match on the system (use OO's VCL.xcu to do this)
// - do this in a general way, since docx4all needs this as well to display fonts
FontTablePart fontTablePart= this.getMainDocumentPart().getFontTablePart();
if (fontTablePart==null) {
log.warn("FontTable missing; creating default part.");
fontTablePart= new org.docx4j.openpackaging.parts.WordprocessingML.FontTablePart();
fontTablePart.unmarshalDefaultFonts();
fontTablePart.processEmbeddings();
}
fonts = (org.docx4j.wml.Fonts)fontTablePart.getJaxbElement();
}
if (populate) {
fontMapper.populateFontMappings(fontsInUse, fonts);
}