public class FontSettings
extends java.lang.Object
Aspose.Words uses font settings to resolve the fonts in the document. Fonts are resolved mostly when building document layout or rendering to fixed page formats. But when loading some formats, Aspose.Words also may require to resolve the fonts. For example, when loading HTML documents Aspose.Words may resolve the fonts to perform font fallback. So it is recommended that you set the font settings in LoadOptions when loading the document. Or at least before building the layout or rendering the document to the fixed-page format.
By default all documents uses single static font settings instance. It could be accessed by getDefaultInstance() property.
Changing font settings is safe at any time from any thread. But it is recommended that you do not change the font settings while processing some documents which uses this settings. This can lead to the fact that the same font will be resolved differently in different parts of the document.
| Constructor and Description |
|---|
FontSettings()
Initializes a new instance of this class.
|
| Modifier and Type | Method and Description |
|---|---|
static FontSettings |
getDefaultInstance()
Static default font settings.
|
FontFallbackSettings |
getFallbackSettings()
Settings related to font fallback mechanism.
|
FontSourceBase[] |
getFontsSources()
Gets a copy of the array that contains the list of sources where Aspose.Words looks for TrueType fonts.
|
FontSubstitutionSettings |
getSubstitutionSettings()
Settings related to font substitution mechanism.
|
void |
resetFontSources()
Resets the fonts sources to the system default.
|
void |
saveSearchCache(java.io.OutputStream outputStream) |
void |
setFontsFolder(java.lang.String fontFolder,
boolean recursive)
Sets the folder where Aspose.Words looks for TrueType fonts when rendering documents or embedding fonts.
|
void |
setFontsFolders(java.lang.String[] fontsFolders,
boolean recursive)
Sets the folders where Aspose.Words looks for TrueType fonts when rendering documents or embedding fonts.
|
void |
setFontsSources(FontSourceBase[] sources)
Sets the sources where Aspose.Words looks for TrueType fonts when rendering documents or embedding fonts.
|
void |
setFontsSources(FontSourceBase[] sources,
java.io.InputStream cacheInputStream) |
public void setFontsFolder(java.lang.String fontFolder,
boolean recursive)
setFontsFolders(java.lang.String[], boolean) for setting only one font directory.fontFolder - The folder that contains TrueType fonts.recursive - True to scan the specified folders for fonts recursively.public void setFontsFolders(java.lang.String[] fontsFolders,
boolean recursive)
By default, Aspose.Words looks for fonts installed to the system.
Setting this property resets the cache of all previously loaded fonts.
fontsFolders - An array of folders that contain TrueType fonts.recursive - True to scan the specified folders for fonts recursively.public void setFontsSources(FontSourceBase[] sources)
By default, Aspose.Words looks for fonts installed to the system.
Setting this property resets the cache of all previously loaded fonts.
sources - An array of sources that contain TrueType fonts.public FontSourceBase[] getFontsSources()
The returned value is a copy of the data that Aspose.Words uses. If you change the entries in the returned array, it will have no effect on document rendering. To specify new font sources use the setFontsSources(com.aspose.words.FontSourceBase[]) method.
public void resetFontSources()
public void saveSearchCache(java.io.OutputStream outputStream)
throws java.lang.Exception
java.lang.Exceptionpublic void setFontsSources(FontSourceBase[] sources, java.io.InputStream cacheInputStream) throws java.lang.Exception
java.lang.Exceptionpublic static FontSettings getDefaultInstance()
Document.getFontSettings() / Document.setFontSettings(com.aspose.words.FontSettings) is specified.FontSettings value.public FontFallbackSettings getFallbackSettings()
FontFallbackSettings value.public FontSubstitutionSettings getSubstitutionSettings()
FontSubstitutionSettings value.