[]
        
(Showing Draft Content)

GrapeCity.Documents.Text.SystemFontCollection

Class SystemFontCollection

Namespace
GrapeCity.Documents.Text
Assembly
GcDocs.Imaging.dll

Represents a collection of system fonts.

public class SystemFontCollection : ReadOnlyCollection<Font>, IList, ICollection, IReadOnlyList<Font>, IReadOnlyCollection<Font>, IFontCollection, IList<Font>, ICollection<Font>, IEnumerable<Font>, IEnumerable
Inheritance
object
System.Collections.ObjectModel.ReadOnlyCollection<T><Font>
SystemFontCollection
Implements
System.Collections.IList
System.Collections.ICollection
System.Collections.Generic.IReadOnlyList<T><Font>
System.Collections.Generic.IReadOnlyCollection<T><Font>
System.Collections.Generic.IList<T><Font>
System.Collections.Generic.ICollection<T><Font>
System.Collections.Generic.IEnumerable<T><Font>
System.Collections.IEnumerable
Inherited Members
System.Collections.ObjectModel.ReadOnlyCollection<GrapeCity.Documents.Text.Font>.Contains(GrapeCity.Documents.Text.Font)
System.Collections.ObjectModel.ReadOnlyCollection<GrapeCity.Documents.Text.Font>.CopyTo(GrapeCity.Documents.Text.Font[], int)
System.Collections.ObjectModel.ReadOnlyCollection<GrapeCity.Documents.Text.Font>.GetEnumerator()
System.Collections.ObjectModel.ReadOnlyCollection<GrapeCity.Documents.Text.Font>.IndexOf(GrapeCity.Documents.Text.Font)
System.Collections.ObjectModel.ReadOnlyCollection<GrapeCity.Documents.Text.Font>.Count
System.Collections.ObjectModel.ReadOnlyCollection<GrapeCity.Documents.Text.Font>.this[int]
System.Collections.ObjectModel.ReadOnlyCollection<GrapeCity.Documents.Text.Font>.Items
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()

Properties

DefaultFont

Gets or sets the default system font.

If no system fonts were found, this value will be null. You can test for this condition at program startup, and assign a font to it if it is null.

public Font DefaultFont { get; set; }

Property Value

Font

NoSystemFonts

Gets or sets a value indicating whether the automatic loading of system fonts is to be omitted in the static constructor of the FontCollection class.

The default is false, and the FontCollection's static constructor loads all fonts installed in the system. This is usually fast and does not consume significant resources, but sometimes may cause problems (e.g. if an installed font file is corrupt). In such cases set this property to true at program startup, before accessing any members of the FontCollection class.

public static bool NoSystemFonts { get; set; }

Property Value

bool

Methods

AppendFallbackFontFamilies(params string[])

Appends one or more font family names to the internal list of fallback font families.

public void AppendFallbackFontFamilies(params string[] fontFamilyNames)

Parameters

fontFamilyNames string[]

AppendFallbackFonts(params Font[])

Appends one or more fonts to the internal fallback font list.

public void AppendFallbackFonts(params Font[] fonts)

Parameters

fonts Font[]

ChooseFallbackFont(int, Font, bool, bool, bool, bool, bool)

Searches for a fallback font containing the given code point that looks similar to the source font.

public Font ChooseFallbackFont(int codePoint, Font baseFont, bool bold, bool italic, bool vertical = false, bool embeddable = false, bool allowEudc = false)

Parameters

codePoint int

The code point (in UTF-32 format) missing in the source font.

baseFont Font

The source font to be replaced by a fallback font.

bold bool

Indicates if the font should be embolded.

italic bool

Indicates if the font should contain italic characters.

vertical bool

Indicates if the font should be vertical.

embeddable bool

Indicates if the searched font should support embedding.

allowEudc bool

Indicates if the linked EUDC fonts can be searched as well.

Returns

Font

Fallback Font or null.

ClearFallbackFontFamilies()

Clears the internal list of fallback font families.

public void ClearFallbackFontFamilies()

ClearFallbackFonts()

Clears the internal list of fallback fonts.

public void ClearFallbackFonts()

FindFamilyName(string, bool, bool)

Searches for a font with the specified family name and style.

public Font FindFamilyName(string fontFamilyName, bool bold = false, bool italic = false)

Parameters

fontFamilyName string

The font family name. Up to four fonts can share the same font family name.

bold bool

Indicates if the font should be embolded.

italic bool

Indicates if the font should contain Italic characters.

Returns

Font

The corresponding Font or null.

FindFamilyName(string[], bool, bool)

Searches for a font from the set of allowable font family names and the specified style.

public Font FindFamilyName(string[] fontFamilyNames, bool bold = false, bool italic = false)

Parameters

fontFamilyNames string[]

The array of allowable font family name.

bold bool

Indicates if the font should be embolded.

italic bool

Indicates if the font should contain Italic characters.

Returns

Font

The corresponding Font or null.

FindFileName(string)

Searches for the first font having the specified file name.

public Font FindFileName(string fontFileName)

Parameters

fontFileName string

Returns

Font

FindFontPath(string)

Searches for the first font having the specified font path.

public Font FindFontPath(string fontPath)

Parameters

fontPath string

Returns

Font

FindFullName(string)

Searches for the first font with specified full name.

Full font name that reflects all family and relevant subfamily descriptors.

public Font FindFullName(string fullFontName)

Parameters

fullFontName string

Returns

Font

GetFallbackFontFamilies()

Gets a snapshot of the internal list of fallback font families.

public string[] GetFallbackFontFamilies()

Returns

string[]

GetFallbackFonts()

Gets a snapshot of the internal fallback font list.

public Font[] GetFallbackFonts()

Returns

Font[]

RemoveFallbackFontFamilies(params string[])

Removes one or more font family names from the internal list of fallback font families.

public void RemoveFallbackFontFamilies(params string[] fontFamilyNames)

Parameters

fontFamilyNames string[]

RemoveFallbackFonts(params Font[])

Removes one or more fonts from the internal fallback font list.

public void RemoveFallbackFonts(params Font[] fonts)

Parameters

fonts Font[]

SelectByFamilyName(string, List<Font>)

Collects the fonts with the specified family name.

public void SelectByFamilyName(string fontFamilyName, List<Font> res)

Parameters

fontFamilyName string
res System.Collections.Generic.List<T><Font>

SelectByFamilyName(string)

Returns the list of fonts with the specified family name.

public List<Font> SelectByFamilyName(string fontFamilyName)

Parameters

fontFamilyName string

Returns

System.Collections.Generic.List<T><Font>

SelectByFileName(string, List<Font>)

Collects the fonts having the same specified file name.

public void SelectByFileName(string fontFileName, List<Font> res)

Parameters

fontFileName string
res System.Collections.Generic.List<T><Font>

SelectByFileName(string)

Returns the list of fonts having the same specified file name.

public List<Font> SelectByFileName(string fontFileName)

Parameters

fontFileName string

Returns

System.Collections.Generic.List<T><Font>

SelectByFontPath(string, List<Font>)

Collects the fonts having the same specified font path.

public void SelectByFontPath(string fontPath, List<Font> res)

Parameters

fontPath string
res System.Collections.Generic.List<T><Font>

SelectByFontPath(string)

Returns the list of fonts having the same specified font path.

public List<Font> SelectByFontPath(string fontPath)

Parameters

fontPath string

Returns

System.Collections.Generic.List<T><Font>

SelectByFullName(string, List<Font>)

Collects the fonts with the specified full name.

Full font name that reflects all family and relevant subfamily descriptors.

public void SelectByFullName(string fullFontName, List<Font> res)

Parameters

fullFontName string
res System.Collections.Generic.List<T><Font>

SelectByFullName(string)

Returns the list of fonts with the specified full name.

Full font name that reflects all family and relevant subfamily descriptors.

public List<Font> SelectByFullName(string fullFontName)

Parameters

fullFontName string

Returns

System.Collections.Generic.List<T><Font>

SelectByTypographicFamilyName(string, List<Font>)

Collects the fonts with the specified typographic family name.

The typographic family grouping doesn't impose any constraints on the number of faces within it, in contrast with the 4-style family grouping.

public void SelectByTypographicFamilyName(string typographicFamilyName, List<Font> res)

Parameters

typographicFamilyName string
res System.Collections.Generic.List<T><Font>

SelectByTypographicFamilyName(string)

Returns the list of fonts with the specified typographic family name.

The typographic family grouping doesn't impose any constraints on the number of faces within it, in contrast with the 4-style family grouping.

public List<Font> SelectByTypographicFamilyName(string typographicFamilyName)

Parameters

typographicFamilyName string

Returns

System.Collections.Generic.List<T><Font>