FontSettings

Inheritance: java.lang.Object

public final class FontSettings

General imaging vector formats renderer font settings.

Methods

MethodDescription
getGetSystemAlternativeFont()Gets a value indicating whether [get alternative font].
setGetSystemAlternativeFont(boolean value)Sets a value indicating whether [get alternative font].
getDefaultFontName()Gets the default font name.
setDefaultFontName(String fontName)Sets the default font name.
getFontsFolders()Gets a copy of the array that contains the list of folders where Aspose.Imaging looks for TrueType fonts.
getDefaultFontsFolders()Gets the default fonts folders.
setFontsFolder(String folder)Override font folder list for folder
setFontsFolders(String[] folders)Override font folder list for folders
setFontsFolders(String[] folders, boolean recursive)Sets the folders where TrueType fonts are loaded from and clears all loaded fonts.
reset()Resets the fonts folder and default font name to the system default.
updateFonts()Updates fonts cache for PSD files that contain text layers.
addFontsFolder(String fontFolder)Adds the fontFolder into font directory list and marks it as first folder for font searching
removeFontsFolder(String folder)Removes folder from folder list

getGetSystemAlternativeFont()

public static boolean getGetSystemAlternativeFont()

Gets a value indicating whether [get alternative font].

Value: true if [get alternative font]; otherwise, false.

Returns: boolean - a value indicating whether [get alternative font].

setGetSystemAlternativeFont(boolean value)

public static void setGetSystemAlternativeFont(boolean value)

Sets a value indicating whether [get alternative font].

Value: true if [get alternative font]; otherwise, false.

Parameters:

ParameterTypeDescription
valuebooleana value indicating whether [get alternative font].

getDefaultFontName()

public static String getDefaultFontName()

Gets the default font name.

Returns: java.lang.String - default font’s name

setDefaultFontName(String fontName)

public static void setDefaultFontName(String fontName)

Sets the default font name.

Parameters:

ParameterTypeDescription
fontNamejava.lang.StringThe default name of the font.

getFontsFolders()

public static String[] getFontsFolders()

Gets a copy of the array that contains the list of folders where Aspose.Imaging looks for TrueType fonts.

The returned value is a copy of the data that Aspose.Imaging uses. If you change the entries in the returned array, it will have no effect on document rendering. To specify new font locations use the setFontsFolders method.

Returns: java.lang.String[] - A copy of the current font locations.

getDefaultFontsFolders()

public static String[] getDefaultFontsFolders()

Gets the default fonts folders.

Returns: java.lang.String[] - Returns system folder

setFontsFolder(String folder)

public static void setFontsFolder(String folder)

Override font folder list for folder

Parameters:

ParameterTypeDescription
folderjava.lang.StringFolder with TrueType fonts.

setFontsFolders(String[] folders)

public static void setFontsFolders(String[] folders)

Override font folder list for folders

Parameters:

ParameterTypeDescription
foldersjava.lang.String[]Array of folder

setFontsFolders(String[] folders, boolean recursive)

public static void setFontsFolders(String[] folders, boolean recursive)

Sets the folders where TrueType fonts are loaded from and clears all loaded fonts. There are no checks performed on the fonts folders.

Parameters:

ParameterTypeDescription
foldersjava.lang.String[]The fonts folders.
recursivebooleanif set to true [recursive].

reset()

public static void reset()

Resets the fonts folder and default font name to the system default.

updateFonts()

public static void updateFonts()

Updates fonts cache for PSD files that contain text layers. This method guarantees that fonts from folder fontsFolder using method FontSettings.setFontsFolder(fontsFolder) or after reset fonts using FontSettings.reset() will be taken into consideration when processing PSD files. Please use this method each time when FontSettings.setFontsFolder(fontsFolder) or FontSettings.reset() called for PSD images. Without calling this Method there is no guarantee that fonts will be updated.

addFontsFolder(String fontFolder)

public static void addFontsFolder(String fontFolder)

Adds the fontFolder into font directory list and marks it as first folder for font searching

Parameters:

ParameterTypeDescription
fontFolderjava.lang.StringThe folder contains the TrueType fonts or single font file path.

removeFontsFolder(String folder)

public static void removeFontsFolder(String folder)

Removes folder from folder list

Parameters:

ParameterTypeDescription
folderjava.lang.StringThe folder to remove