Package org.docx4j.fonts
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 Summary
Fields Modifier and Type Field Description protected static org.slf4j.LoggerlogFields inherited from class org.docx4j.fonts.Mapper
boldForms, boldItalicForms, FONT_FALLBACK, fontMappings, italicForms, regularForms -
Constructor Summary
Constructors Constructor Description IdentityPlusMapper() -
Method Summary
Modifier and Type Method Description static voidmain(java.lang.String[] args)voidpopulateFontMappings(java.util.Set<java.lang.String> documentFontNames, Fonts wmlFonts)Populate the fontMappings object.Methods inherited from class org.docx4j.fonts.Mapper
get, getBoldForm, getBoldItalicForm, getFontMappings, getItalicForm, getRegularForm, getSubstituteFontXsltExtension, getSubstituteFontXsltExtension, put, registerBoldForm, registerBoldItalicForm, registerItalicForm, registerRegularForm, size
-
Field Details
-
log
protected static org.slf4j.Logger log
-
-
Constructor Details
-
IdentityPlusMapper
public IdentityPlusMapper()
-
-
Method Details
-
populateFontMappings
public void populateFontMappings(java.util.Set<java.lang.String> documentFontNames, Fonts wmlFonts) throws java.lang.ExceptionPopulate the fontMappings object. We make an entry for each of the documentFontNames.- Specified by:
populateFontMappingsin classMapper- Parameters:
documentFontNames- - the fonts used in the documentwmlFonts- - 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
-