java.lang.Object
com.aspose.words.ExportFontFormat
public class ExportFontFormat
- extends java.lang.Object
Utility class containing constants.
Indicates the format that is used to export fonts while rendering to HTML fixed format.
Example:
Shows how use fonts only from the target machine when saving a document to HTML.
Document doc = new Document(getMyDir() + "Bullet points with alternative font.docx");
HtmlFixedSaveOptions saveOptions = new HtmlFixedSaveOptions();
{
saveOptions.setExportEmbeddedCss(true);
saveOptions.setUseTargetMachineFonts(useTargetMachineFonts);
saveOptions.setFontFormat(ExportFontFormat.TTF);
saveOptions.setExportEmbeddedFonts(false);
}
doc.save(getArtifactsDir() + "HtmlFixedSaveOptions.UsingMachineFonts.html", saveOptions);
String outDocContents = FileUtils.readFileToString(new File(getArtifactsDir() + "HtmlFixedSaveOptions.UsingMachineFonts.html"), StandardCharsets.UTF_8);
if (useTargetMachineFonts)
Assert.assertFalse(Pattern.compile("@font-face").matcher(outDocContents).find());
else
Assert.assertTrue(Pattern.compile(
"@font-face [{] font-family:'Arial'; font-style:normal; font-weight:normal; src:local[(]'☺'[)], " +
"url[(]'HtmlFixedSaveOptions.UsingMachineFonts/font001.ttf'[)] format[(]'truetype'[)]; [}]").matcher(outDocContents).find());
- See Also:
- HtmlFixedSaveOptions.FontFormat
Field Summary |
static final int | WOFF = 0 | |
WOFF (Web Open Font Format).
|
static final int | TTF = 1 | |
TTF (TrueType Font format).
|
WOFF = 0 | |
public static final int WOFF |
-
WOFF (Web Open Font Format).
TTF = 1 | |
public static final int TTF |
-
TTF (TrueType Font format).
See Also:
Aspose.Words Documentation - the home page for the Aspose.Words Product Documentation.
Aspose.Words Support Forum - our preferred method of support.