FontSettings
Inheritance: java.lang.Object
public class FontSettings
Specifies font settings for a document.
To learn more, visit the Working with Fonts documentation article.
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.
Constructors
Constructor | Description |
---|---|
FontSettings() | Initializes a new instance of this class. |
Methods
Method | Description |
---|---|
equals(Object arg0) | |
getClass() | |
getDefaultInstance() | Static default font settings. |
getFallbackSettings() | Settings related to font fallback mechanism. |
getFontsSources() | Gets a copy of the array that contains the list of sources where Aspose.Words looks for TrueType fonts. |
getSubstitutionSettings() | Settings related to font substitution mechanism. |
hashCode() | |
notify() | |
notifyAll() | |
resetFontSources() | Resets the fonts sources to the system default. |
saveSearchCache(OutputStream outputStream) | |
setFontsFolder(String fontFolder, boolean recursive) | Sets the folder where Aspose.Words looks for TrueType fonts when rendering documents or embedding fonts. |
setFontsFolders(String[] fontsFolders, boolean recursive) | Sets the folders where Aspose.Words looks for TrueType fonts when rendering documents or embedding fonts. |
setFontsSources(FontSourceBase[] sources) | Sets the sources where Aspose.Words looks for TrueType fonts when rendering documents or embedding fonts. |
setFontsSources(FontSourceBase[] sources, InputStream cacheInputStream) | |
toString() | |
wait() | |
wait(long arg0) | |
wait(long arg0, int arg1) |
FontSettings()
public FontSettings()
Initializes a new instance of this class.
equals(Object arg0)
public boolean equals(Object arg0)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | java.lang.Object |
Returns: boolean
getClass()
public final native Class<?> getClass()
Returns: java.lang.Class>
getDefaultInstance()
public static FontSettings getDefaultInstance()
Static default font settings. This instance is used by default in a document unless Document.getFontSettings() / Document.setFontSettings(com.aspose.words.FontSettings) is specified.
Returns: FontSettings - The corresponding FontSettings value.
getFallbackSettings()
public FontFallbackSettings getFallbackSettings()
Settings related to font fallback mechanism.
Returns: FontFallbackSettings - The corresponding FontFallbackSettings value.
getFontsSources()
public FontSourceBase[] getFontsSources()
Gets a copy of the array that contains the list of sources where Aspose.Words looks for TrueType fonts.
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.
Returns: com.aspose.words.FontSourceBase[] - A copy of the current font sources.
getSubstitutionSettings()
public FontSubstitutionSettings getSubstitutionSettings()
Settings related to font substitution mechanism.
Returns: FontSubstitutionSettings - The corresponding FontSubstitutionSettings value.
hashCode()
public native int hashCode()
Returns: int
notify()
public final native void notify()
notifyAll()
public final native void notifyAll()
resetFontSources()
public void resetFontSources()
Resets the fonts sources to the system default.
saveSearchCache(OutputStream outputStream)
public void saveSearchCache(OutputStream outputStream)
Parameters:
Parameter | Type | Description |
---|---|---|
outputStream | java.io.OutputStream |
setFontsFolder(String fontFolder, boolean recursive)
public void setFontsFolder(String fontFolder, boolean recursive)
Sets the folder where Aspose.Words looks for TrueType fonts when rendering documents or embedding fonts. This is a shortcut to setFontsFolders(java.lang.String[], boolean) for setting only one font directory.
Parameters:
Parameter | Type | Description |
---|---|---|
fontFolder | java.lang.String | The folder that contains TrueType fonts. |
recursive | boolean | True to scan the specified folders for fonts recursively. |
setFontsFolders(String[] fontsFolders, boolean recursive)
public void setFontsFolders(String[] fontsFolders, boolean recursive)
Sets the folders where Aspose.Words looks for TrueType fonts when rendering documents or embedding fonts.
By default, Aspose.Words looks for fonts installed to the system.
Setting this property resets the cache of all previously loaded fonts.
Parameters:
Parameter | Type | Description |
---|---|---|
fontsFolders | java.lang.String[] | An array of folders that contain TrueType fonts. |
recursive | boolean | True to scan the specified folders for fonts recursively. |
setFontsSources(FontSourceBase[] sources)
public void setFontsSources(FontSourceBase[] sources)
Sets the sources where Aspose.Words looks for TrueType fonts when rendering documents or embedding fonts.
By default, Aspose.Words looks for fonts installed to the system.
Setting this property resets the cache of all previously loaded fonts.
Parameters:
Parameter | Type | Description |
---|---|---|
sources | FontSourceBase[] | An array of sources that contain TrueType fonts. |
setFontsSources(FontSourceBase[] sources, InputStream cacheInputStream)
public void setFontsSources(FontSourceBase[] sources, InputStream cacheInputStream)
Parameters:
Parameter | Type | Description |
---|---|---|
sources | FontSourceBase[] | |
cacheInputStream | java.io.InputStream |
toString()
public String toString()
Returns: java.lang.String
wait()
public final void wait()
wait(long arg0)
public final native void wait(long arg0)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | long |
wait(long arg0, int arg1)
public final void wait(long arg0, int arg1)
Parameters:
Parameter | Type | Description |
---|---|---|
arg0 | long | |
arg1 | int |