Class FontManager
Contains font management methods and properties.
Inheritance
Namespace: FastReport
Assembly: FastReport.Base.dll
Syntax
public static class FontManager
Properties
AllFamilies
Gets all installed font families.
Declaration
public static FontFamily[] AllFamilies { get; }
Property Value
Type | Description |
---|---|
FontFamily[] |
Remarks
This method enumerates all font collections (PrivateFontCollection, TemporaryFontCollection, InstalledFontCollection) and sorts the result.
Methods
AddFont(IntPtr, Int32)
Adds a font contained in system memory to this collection.
Declaration
public static void AddFont(IntPtr memory, int length)
Parameters
Type | Name | Description |
---|---|---|
System.IntPtr | memory | The memory address of the font to add. |
System.Int32 | length | The memory length of the font to add. |
AddFont(String)
Adds a font from the specified file to this collection.
Declaration
public static bool AddFont(string filename)
Parameters
Type | Name | Description |
---|---|---|
System.String | filename | A System.String that contains the file name of the font to add. |
Returns
Type | Description |
---|---|
System.Boolean | true if the font is registered by application. |
AddSubstituteFont(String, String[])
Adds a new substitute font item.
Declaration
public static void AddSubstituteFont(string originalFontName, params string[] substituteFonts)
Parameters
Type | Name | Description |
---|---|---|
System.String | originalFontName | The original font name, e.g. "Arial" |
System.String[] | substituteFonts | The alternatives list, e.g. "Ubuntu Sans", "Liberation Sans", "Helvetica" |
Remarks
Substitute font replaces the original font if it is not present on a machine. For example, you may define "Helvetica Neue" substitute for "Arial".
CheckFontIsInstalled(String)
Checks whether the font from the specified file is installed in the system.
Declaration
public static bool CheckFontIsInstalled(string filename)
Parameters
Type | Name | Description |
---|---|---|
System.String | filename | The path to the font file. |
Returns
Type | Description |
---|---|
System.Boolean | Returns true if the font is installed on the system, otherwise false. |
ClearSubstituteFonts()
Clears all substitute fonts.
Declaration
public static void ClearSubstituteFonts()
RemoveSubstituteFont(String)
Removes substitute fonts for the given font.
Declaration
public static void RemoveSubstituteFont(string originalFontName)
Parameters
Type | Name | Description |
---|---|---|
System.String | originalFontName | The original font name, e.g. "Arial" |