Class FontsSubsystem

Class FontsSubsystem

Namespace: Aspose.Note.Fonts
Assembly: Aspose.Note.dll (24.12.0)

Base class implementing Aspose.Note.Fonts.IFontsSubsystem interface. Provides functionality for default font and font’s substitutions. Override Aspose.Note.Fonts.FontsSubsystem.FetchFontFamily protected member function in a derived class to implement logic for retrieving of System.Drawing.FontFamily object.

public abstract class FontsSubsystem : IFontsSubsystem

Inheritance

objectFontsSubsystem

Derived

DocumentFontsSubsystem

Implements

IFontsSubsystem

Inherited Members

object.GetType(), object.MemberwiseClone(), object.ToString(), object.Equals(object?), object.Equals(object?, object?), object.ReferenceEquals(object?, object?), object.GetHashCode()

Constructors

FontsSubsystem(Stream, Dictionary<string, string="">)

Initializes a new instance of the Aspose.Note.Fonts.FontsSubsystem class.

protected FontsSubsystem(Stream defaultFont, Dictionary<string, string=""> fontsSubstitutions = null)

Parameters

defaultFont Stream

The stream containing default Font.

fontsSubstitutions Dictionary<string, string&gt;

The fonts substitutions.

FontsSubsystem(string, Dictionary<string, string="">)

Initializes a new instance of the Aspose.Note.Fonts.FontsSubsystem class.

protected FontsSubsystem(string defaultFontFile, Dictionary<string, string=""> fontsSubstitutions = null)

Parameters

defaultFontFile string

The stream containing default Font.

fontsSubstitutions Dictionary<string, string&gt;

The fonts substitutions.

FontsSubsystem()

Initializes a new instance of the Aspose.Note.Fonts.FontsSubsystem class.

protected FontsSubsystem()

Properties

DefaultFont

Gets or sets default font.

public FontFamily DefaultFont { get; protected set; }

Property Value

FontFamily

Methods

AddFont(Stream, string)

Add the font.

public void AddFont(Stream stream, string tempFolder)

Parameters

stream Stream

The stream containing the font.

tempFolder string

The temp Folder.

AddFont(Stream)

Add the font.

public void AddFont(Stream stream)

Parameters

stream Stream

The stream containing the font.

AddFont(string)

Add the font.

public void AddFont(string file)

Parameters

file string

The path to the file containing the font.

AddFontSubstitution(string, string)

Adds font substitution.

public void AddFontSubstitution(string substituted, string substitution)

Parameters

substituted string

The substituted font name.

substitution string

The substitution font name.

FetchFontFamily(string)

Fetches font family as a candidate for GetFontFamily.

protected abstract FontFamily FetchFontFamily(string fontName)

Parameters

fontName string

The font name.

Returns

FontFamily

The System.Drawing.FontFamily.

FindFontFamilyInInternalCollection(string)

Tries to find font family in internal collection of GDI fonts.

protected FontFamily FindFontFamilyInInternalCollection(string fontFamilyName)

Parameters

fontFamilyName string

The font family name.

Returns

FontFamily

The System.Drawing.FontFamily.

GetFontFamily(string)

Gets font family.

public virtual FontFamily GetFontFamily(string fontName)

Parameters

fontName string

The font name.

Returns

FontFamily

The System.Drawing.FontFamily.

LoadFontsFromFolder(string)

Loads all TrueType fonts from specified folder to internal collection.

public void LoadFontsFromFolder(string folder)

Parameters

folder string

The folder containing fonts.

Exceptions

NullReferenceException

Parameter ‘folder’ is null or empty.

DirectoryNotFoundException

There directory specified by folder does not exist.

InvalidDataException

The file from folder does not contain TrueType font.

TranslateFontName(string)

Tries to translate font name to its substitution via internal table.

protected string TranslateFontName(string fontName)

Parameters

fontName string

The font name.

Returns

string

The name of substitution font if it is specified otherwise the specified font name itself. </string,></string,></string,></string,>