Gorgon
Show / Hide Table of Contents

Class GorgonGlyphCollection

A collection of glyphs for a GorgonFont.

Inheritance
object
GorgonGlyphCollection
Implements
IReadOnlyList<GorgonGlyph>
IReadOnlyCollection<GorgonGlyph>
IEnumerable<GorgonGlyph>
IEnumerable
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
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 Source

Count

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>.

| Edit this page View Source

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
| Edit this page View Source

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 Source

Contains(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 glyph is found in the ICollection<T>; otherwise, false.

Exceptions
Type Condition
ArgumentNullException

Thrown when the glyph parameter is null.

| Edit this page View Source

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.

| Edit this page View Source

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.

| Edit this page View Source

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.

| Edit this page View Source

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 glyph parameter is null.

| Edit this page View Source

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.

| Edit this page View Source

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.

Implements

IReadOnlyList<T>
IReadOnlyCollection<T>
IEnumerable<T>
IEnumerable

Extension Methods

GorgonDebugExtensions.ValidateObject<T>(T, string)
GorgonTreeLinqExtensions.TraverseDepthFirst<T>(IEnumerable<T>, Func<T, IEnumerable<T>>)
GorgonTreeLinqExtensions.Traverse<T>(IEnumerable<T>, Func<T, IEnumerable<T>>)
GorgonIReadOnlyListExtensions.Contains<T>(IReadOnlyList<T>, T)
GorgonIReadOnlyListExtensions.CopyTo<T>(IReadOnlyList<T>, T[])
GorgonIReadOnlyListExtensions.FirstIndexOf<T>(IReadOnlyList<T>, Predicate<T>)
GorgonIReadOnlyListExtensions.IndexOf<T>(IReadOnlyList<T>, T)
GorgonIReadOnlyListExtensions.LastIndexOf<T>(IReadOnlyList<T>, Predicate<T>)
GorgonNullExtensions.AsNullable<T>(object)
GorgonNullExtensions.IfNull<T>(object, T)
GorgonNullExtensions.IsNull(object)
  • Edit this page
  • View Source
In this article
Back to top Copyright 2023 - Licensed under the MIT license by Michael Winsor (Tape_Worm).
Send comments on this topic to the author