Class GorgonGlyphCollection
A collection of glyphs for a GorgonFont.
Implements
Inherited Members
Namespace: Gorgon.Graphics.Fonts
Assembly: Gorgon.Graphics.Fonts.dll
Syntax
public sealed class GorgonGlyphCollection : IReadOnlyList<GorgonGlyph>, IReadOnlyCollection<GorgonGlyph>, IEnumerable<GorgonGlyph>, IEnumerable
Properties
| Edit this page View SourceCount
Gets the number of elements contained in the ICollection<T>.
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
int | The number of elements contained in the ICollection<T>. |
this[char]
Property to set or return a glyph in the collection by its character representation.
Declaration
public GorgonGlyph this[char character] { get; }
Parameters
Type | Name | Description |
---|---|---|
char | character |
Property Value
Type | Description |
---|---|
GorgonGlyph |
this[int]
Gets the element at the specified index.
Declaration
public GorgonGlyph this[int index] { get; }
Parameters
Type | Name | Description |
---|---|---|
int | index |
Property Value
Type | Description |
---|---|
GorgonGlyph |
Exceptions
Type | Condition |
---|---|
NotSupportedException | Thrown when an attempt to set this property is made. |
Methods
| Edit this page View SourceContains(GorgonGlyph)
Determines whether the ICollection<T> contains a specific value.
Declaration
public bool Contains(GorgonGlyph glyph)
Parameters
Type | Name | Description |
---|---|---|
GorgonGlyph | glyph | The object to locate in the ICollection<T>. |
Returns
Type | Description |
---|---|
bool | true if |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the |
Contains(char)
Function to return whether the character exists in this collection.
Declaration
public bool Contains(char character)
Parameters
Type | Name | Description |
---|---|---|
char | character | The character to find. |
Returns
Type | Description |
---|---|
bool | true if found, false if not. |
GetEnumerator()
Returns an enumerator that iterates through the collection.
Declaration
public IEnumerator<GorgonGlyph> GetEnumerator()
Returns
Type | Description |
---|---|
IEnumerator<GorgonGlyph> | A IEnumerator<T> that can be used to iterate through the collection. |
GetGlyphsByTexture()
Function to retrieve the glyphs in this collection grouped by their respective textures.
Declaration
public IReadOnlyDictionary<GorgonTexture2D, IReadOnlyList<GorgonGlyph>> GetGlyphsByTexture()
Returns
Type | Description |
---|---|
IReadOnlyDictionary<GorgonTexture2D, IReadOnlyList<GorgonGlyph>> | A grouping containing the texture and the list of glyphs associated with it. |
Remarks
This will only return glyphs that are associated with a texture. Glyphs that do not have a texture (e.g. the glyph representing a space character) will not be included in this list.
IndexOf(GorgonGlyph)
Function to return the index of a glyph in the collection.
Declaration
public int IndexOf(GorgonGlyph glyph)
Parameters
Type | Name | Description |
---|---|---|
GorgonGlyph | glyph | Glyph to find. |
Returns
Type | Description |
---|---|
int | The index of the glyph if found, -1 if not. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | Thrown when the |
IndexOf(char)
Function to return the index of a character in the collection.
Declaration
public int IndexOf(char character)
Parameters
Type | Name | Description |
---|---|---|
char | character | Character to find. |
Returns
Type | Description |
---|---|
int | The index of the character if found, -1 if not. |
TryGetValue(char, out GorgonGlyph)
Function to attempt to retrieve a glyph from the list.
Declaration
public bool TryGetValue(char character, out GorgonGlyph glyph)
Parameters
Type | Name | Description |
---|---|---|
char | character | Character for the glyph. |
GorgonGlyph | glyph | The glyph in the list. |
Returns
Type | Description |
---|---|
bool | true if found, false if not. |