System.out.println("Loading file from " + inputfilepath);
wordMLPackage = WordprocessingMLPackage.load(new java.io.File(inputfilepath));
}
// Set up font mapper (optional)
Mapper fontMapper = new IdentityPlusMapper();
wordMLPackage.setFontMapper(fontMapper);
// .. example of mapping font Times New Roman which doesn't have certain Arabic glyphs
// eg Glyph "ي" (0x64a, afii57450) not available in font "TimesNewRomanPS-ItalicMT".
// eg Glyph "ج" (0x62c, afii57420) not available in font "TimesNewRomanPS-ItalicMT".
// to a font which does
PhysicalFont font
= PhysicalFonts.get("Arial Unicode MS");
// make sure this is in your regex (if any)!!!
if (font!=null) {
fontMapper.put("Times New Roman", font);
fontMapper.put("Arial", font);
}
fontMapper.put("Libian SC Regular", PhysicalFonts.get("SimSun"));
// FO exporter setup (required)
// .. the FOSettings object
FOSettings foSettings = Docx4J.createFOSettings();
if (saveFO) {