FontSettings Class

Summary: General PSD vector formats renderer font settings.

Module: aspose.psd

Full Name: aspose.psd.FontSettings

Aspose.PSD Version: 24.4.0

Properties

NameTypeAccessDescription
default_font_name [static]stringr/wGets or sets the default name of the font.
get_system_alternative_font [static]boolr/wGets or sets a value indicating whether [get alternative font].

Methods

NameDescription
clear_font_replacements()Clears the all fonts replacements
get_adobe_font_name(font_family_name)Gets the adobe font name by font family name.
get_default_fonts_folders()Gets the default fonts folders.
get_font_replacements(font_name)Gets the font replacements array by the font name
get_fonts_folders()Gets a copy of the array that contains the list of folders where Aspose.Words looks for TrueType fonts.
get_replacement_font(font_name)Gets the most suitable replacement font.
If all replacements are not allowed then will returned first allowed and available font.
If there are no available fonts then will be returned font from argument
is_font_allowed(font_name)Determines whether [is font allowed] [the specified font name].
remove_font_cache_file()Removes of the font cache file.
reset()Resets the fonts folder and default font name to the system default.
set_allowed_fonts(font_list)Restricts font using by list of fonts. Please check real font names before restriction
Set Allowed font list to Null to remove restrictrions
set_font_replacements(font_to_replace, font_names)Sets the font replacement list. If font is not allowed then will be find replacement.
The first one font in list will be used first. If it retricted too, then will be selected next font from list.
If font has not replacements or all replacements are not allowed then will be used first allowed font from allowed font list.
If there are no allowed and available fonts then library will try use system default font even if it is not allowed.
set_fonts_folder(font_folder)This is a shortcut to FontSettings.set_fonts_folders(fonts_folders, recursive) for setting only one font directory.
There are no checks performed on the fonts folder.
set_fonts_folders(fonts_folders, recursive)Sets the folders where TrueType fonts are loaded from and clears all loaded fonts.
There are no checks performed on the fonts folders.
update_fonts()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.

Method: get_adobe_font_name(font_family_name) [static]

 get_adobe_font_name(font_family_name) 

Gets the adobe font name by font family name.

Parameters:

ParameterTypeDescription
font_family_namestringThe font family name.

Returns

TypeDescription
stringThe adobe font name by font family name.

Method: get_default_fonts_folders() [static]

 get_default_fonts_folders() 

Gets the default fonts folders.

Returns

TypeDescription
stringReturns system folder

Method: get_font_replacements(font_name) [static]

 get_font_replacements(font_name) 

Gets the font replacements array by the font name

Parameters:

ParameterTypeDescription
font_namestringName of the font.

Returns

TypeDescription
stringArray of names of replacements for provided fonts

Method: get_fonts_folders() [static]

 get_fonts_folders() 

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

Returns

TypeDescription
stringA copy of the current font locations.

Method: get_replacement_font(font_name) [static]

 get_replacement_font(font_name) 

Gets the most suitable replacement font.
If all replacements are not allowed then will returned first allowed and available font.
If there are no available fonts then will be returned font from argument

Parameters:

ParameterTypeDescription
font_namestringName of the font.

Returns

TypeDescription
stringThe name of replaced font

Method: is_font_allowed(font_name) [static]

 is_font_allowed(font_name) 

Determines whether [is font allowed] [the specified font name].

Parameters:

ParameterTypeDescription
font_namestringName of the font.

Returns

TypeDescription
booltrue if [is font allowed] [the specified font name]; otherwise, false.

Method: set_allowed_fonts(font_list) [static]

 set_allowed_fonts(font_list) 

Restricts font using by list of fonts. Please check real font names before restriction
Set Allowed font list to Null to remove restrictrions

Parameters:

ParameterTypeDescription
font_liststringThe font list.

Method: set_font_replacements(font_to_replace, font_names) [static]

 set_font_replacements(font_to_replace, font_names) 

Sets the font replacement list. If font is not allowed then will be find replacement.
The first one font in list will be used first. If it retricted too, then will be selected next font from list.
If font has not replacements or all replacements are not allowed then will be used first allowed font from allowed font list.
If there are no allowed and available fonts then library will try use system default font even if it is not allowed.

Parameters:

ParameterTypeDescription
font_to_replacestringThe font to replace.
font_namesstringThe replacement font names in order of similarity.

Method: set_fonts_folder(font_folder) [static]

 set_fonts_folder(font_folder) 

This is a shortcut to FontSettings.set_fonts_folders(fonts_folders, recursive) for setting only one font directory.
There are no checks performed on the fonts folder.

Parameters:

ParameterTypeDescription
font_folderstringThe font folder.

Method: set_fonts_folders(fonts_folders, recursive) [static]

 set_fonts_folders(fonts_folders, 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
fonts_foldersstringThe fonts folders.
recursiveboolif set to true [recursive].