Class IdentityPlusMapper

java.lang.Object
org.docx4j.fonts.Mapper
org.docx4j.fonts.IdentityPlusMapper

public class IdentityPlusMapper
extends Mapper
Maps font names used in the document to corresponding fonts physically available on the system. This mapper automatically maps document fonts for which the exact font is physically available. Think of this as an identity mapping. For this reason, it will work best on Windows, or a system on which Microsoft fonts have been installed. You can manually add your own additional mappings if you wish.
Author:
jharrop
  • Field Details

    • log

      protected static org.slf4j.Logger log
  • Constructor Details

  • Method Details

    • populateFontMappings

      public void populateFontMappings​(java.util.Set<java.lang.String> documentFontNames, Fonts wmlFonts) throws java.lang.Exception
      Populate the fontMappings object. We make an entry for each of the documentFontNames.
      Specified by:
      populateFontMappings in class Mapper
      Parameters:
      documentFontNames - - the fonts used in the document
      wmlFonts - - the content model for the fonts part
      Throws:
      java.lang.Exception
    • main

      public static void main​(java.lang.String[] args) throws java.lang.Exception
      Throws:
      java.lang.Exception