public final class FontsLoader extends java.lang.Object implements IFontsLoader
Class for loading custom fonts defined by user. Should be used before creating any presentation objects.
| Modifier and Type | Method and Description |
|---|---|
static void |
clearCache()
Releases all custom fonts defined by user
|
static java.lang.String[] |
getFontFolders()
Gets font folders.
|
static void |
loadExternalFont(byte[] data)
Adds font from the binary data
|
static void |
loadExternalFonts(java.lang.String[] directories)
Adds additional folders to seek fonts.
|
public static void loadExternalFonts(java.lang.String[] directories)
Adds additional folders to seek fonts.
The follow examples shows how to load custom fonts from .TTFString dataDir = "C:/Fonts"; // folders to seek fonts String[] folders = new String[] { dataDir }; // Load the custom font directory fonts FontsLoader.loadExternalFonts(folders); // Do Some work and perform presentation/slides rendering Presentation pres = new Presentation("DefaultFonts.pptx"); try { pres.save("NewFonts_out.pptx", SaveFormat.Pptx); // Clear Font Cachce FontsLoader.clearCache(); } finally { if (pres != null) pres.dispose(); }
directories - Directories to read additional fonts.public static void loadExternalFont(byte[] data)
Adds font from the binary data
data - Font's datapublic static java.lang.String[] getFontFolders()
Gets font folders. Returns folders that have been added with LoadExternalFonts method as well as system font folders
public static void clearCache()
Releases all custom fonts defined by user
Copyright © 2004-2025 Aspose Pty Ltd. All Rights Reserved.