FontConfigs

FontConfigs class

Specifies font settings

class FontConfigs;

Constructors

NameDescription
constructor()Default Constructor.

Methods

MethodDescription
static getDefaultFontName()Gets or sets the default font name.
static setDefaultFontName(string)Gets or sets the default font name.
static getPreferSystemFontSubstitutes()Indicate whether to use system font substitutes first or not when a font is not presented and the substitute of this font is not set. e.g. On Ubuntu, “Arial” font is generally substituted by “Liberation Sans”. Default value is false.
static setPreferSystemFontSubstitutes(boolean)Indicate whether to use system font substitutes first or not when a font is not presented and the substitute of this font is not set. e.g. On Ubuntu, “Arial” font is generally substituted by “Liberation Sans”. Default value is false.
static isFontAvailable(string)Indicate whether the font is available.
static setFontSubstitutes(string, string[])Font substitute names for given original font name.
static getFontSubstitutes(string)Returns array containing font substitute names to be used if original font is not presented.
static setFontFolder(string, boolean)Sets the fonts folder
static setFontFolders(string[], boolean)Sets the fonts folders
static setFontSources(FontSourceBase[])Sets the fonts sources.
static getFontSources()Gets a copy of the array that contains the list of sources

constructor()

Default Constructor.

constructor();

getDefaultFontName()

Gets or sets the default font name.

static getDefaultFontName() : string;

setDefaultFontName(string)

Gets or sets the default font name.

static setDefaultFontName(value: string) : void;

Parameters:

ParameterTypeDescription
valuestringThe value to set.

getPreferSystemFontSubstitutes()

Indicate whether to use system font substitutes first or not when a font is not presented and the substitute of this font is not set. e.g. On Ubuntu, “Arial” font is generally substituted by “Liberation Sans”. Default value is false.

static getPreferSystemFontSubstitutes() : boolean;

setPreferSystemFontSubstitutes(boolean)

Indicate whether to use system font substitutes first or not when a font is not presented and the substitute of this font is not set. e.g. On Ubuntu, “Arial” font is generally substituted by “Liberation Sans”. Default value is false.

static setPreferSystemFontSubstitutes(value: boolean) : void;

Parameters:

ParameterTypeDescription
valuebooleanThe value to set.

isFontAvailable(string)

Indicate whether the font is available.

static isFontAvailable(fontName: string) : boolean;

Parameters:

ParameterTypeDescription
fontNamestringfont name

Returns

true if font is available, otherwise false.

setFontSubstitutes(string, string[])

Font substitute names for given original font name.

static setFontSubstitutes(originalFontName: string, substituteFontNames: string[]) : void;

Parameters:

ParameterTypeDescription
originalFontNamestringOriginal font name.
substituteFontNamesstring[]List of font substitute names to be used if original font is not presented.

getFontSubstitutes(string)

Returns array containing font substitute names to be used if original font is not presented.

static getFontSubstitutes(originalFontName: string) : string[];

Parameters:

ParameterTypeDescription
originalFontNamestringoriginalFontName

Returns

An array containing font substitute names to be used if original font is not presented.

setFontFolder(string, boolean)

Sets the fonts folder

static setFontFolder(fontFolder: string, recursive: boolean) : void;

Parameters:

ParameterTypeDescription
fontFolderstringThe folder that contains TrueType fonts.
recursivebooleanDetermines whether or not to scan subfolders.

setFontFolders(string[], boolean)

Sets the fonts folders

static setFontFolders(fontFolders: string[], recursive: boolean) : void;

Parameters:

ParameterTypeDescription
fontFoldersstring[]The folders that contains TrueType fonts.
recursivebooleanDetermines whether or not to scan subfolders.

setFontSources(FontSourceBase[])

Sets the fonts sources.

static setFontSources(sources: FontSourceBase[]) : void;

Parameters:

ParameterTypeDescription
sourcesFontSourceBase[]An array of sources that contain TrueType fonts.

getFontSources()

Gets a copy of the array that contains the list of sources

static getFontSources() : FontSourceBase[];

Returns

FontSourceBase[]