XHTMLImporterImpl contains:
Using java Syntax Highlighting
/**
* Map a font family, for example "Century Gothic" in:
*
* font-family:"Century Gothic", Helvetica, Arial, sans-serif;
*
* to a w:rFonts object, for example:
*
* <w:rFonts w:ascii="Arial Black" w:hAnsi="Arial Black"/>
*
* Assuming style font-family:"Century Gothic", Helvetica, Arial, sans-serif;
* the first font family for which there is a mapping is the one
* which will be used.
*
* xhtml-renderer's CSSName defaults font-family: serif
*
* It is your responsibility to ensure a suitable font is available
* on the target system (or embedded in the docx package). If we
* (eventually) support CSS @font-face, docx4j could do that
* for you (at least for font formats we can convert to something
* embeddable).
*
* You should set these up once, for all your subsequent
* imports, since some stuff is cached and currently won't get updated
* if you add fonts later.
*
* @since 3.0
*/
public static void addFontMapping
(String cssFontFamily, RFonts rFonts
) {
FontHandler.
addFontMapping(cssFontFamily, rFonts
);
}
public static void addFontMapping
(String cssFontFamily,
String font
) {
FontHandler.
addFontMapping(cssFontFamily, font
);
}
Parsed in 0.015 seconds, using
GeSHi 1.0.8.4
Although the CSS defaults
https://github.com/plutext/docx4j-Impor ... andler.css don't
specify the font for most elements, note the comment above which says defaults font-family: serif is used.
See also
https://github.com/plutext/docx4j-Impor ... ndler.java