Package org.docx4j.fonts

Examples of org.docx4j.fonts.Mapper


      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) {
View Full Code Here

TOP

Related Classes of org.docx4j.fonts.Mapper

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.