[]
Represents a collection of FontInfo objects.
public class FontInfoCollection : IReadOnlyCollection<FontInfo>, IEnumerable<FontInfo>, IEnumerable
public int Count { get; }
Gets the document that contains this collection.
public DocumentBase Document { get; }
Gets a value indicating whether the containing document is in reading mode.
public bool IsReadOnly { get; }
Gets a font by its index in this collection.
public FontInfo this[int index] { get; }
index
intThe font index in the collection.
The font with the specified index in the collection.
Gets a font by its primary name.
public FontInfo this[string name] { get; }
name
stringThe font primary name.
The font with the specified primary name.
Adds a new font into the collection.
public FontInfo Add(Font font, bool embed = false)
font
GrapeCity.Documents.Text.FontThe GrapeCity.Documents.Text.Font to add.
embed
boolWhether to embed the specified font.
A newly created FontInfo if embed
is false, otherwise it can be existing FontInfo that now contains the embedded font.
Adds a font with a specified primary name to the collection.
public FontInfo Add(string name)
name
stringThe primary name of the font to add.
Appends a list of GrapeCity.Documents.Text.Font objects to the collection. Fonts that already exist in the collection are ignored.
public void Append(IList<Font> fonts, bool embed = false)
fonts
System.Collections.Generic.IList<T><GrapeCity.Documents.Text.Font>The list of fonts to append.
embed
boolSpecifies whether to embed appended fonts.
Removes all fonts from the collection.
public void Clear()
Checks whether the collection contains a font with the specified primary name.
public bool Contains(string name)
name
stringThe font primary name.
true if the collection contains a font with the specified primary name, false otherwise.
Finds a FontInfo in this collection by its primary or alternate name.
public FontInfo Find(string name)
name
stringThe primary or alternate font name to find.
public IEnumerator<FontInfo> GetEnumerator()
Removes a specified font from the collection.
public bool Remove(FontInfo item)
item
FontInfoThe font to remove.
true if the specified font was found and removed from the collection, false otherwise.
Removes a font with the specified primary name from the collection.
public bool Remove(string name)
name
stringThe primary name of the font to remove.
true if a font with the specified primary name was found and removed from the collection, false otherwise.
Tries to get a font from the collection by its primary name.
public bool TryGetValue(string name, out FontInfo item)
name
stringThe font primary name.
item
FontInfoOUT: if this method returns true, contains the font with the specified primary name, otherwise null.
true if a font with the specified primary name was found, otherwise false.