GlyphRun Class
Definition
Represents a sequence of glyphs from a single face of a single font at a single size, and with a single rendering style.
public class GlyphRun
Constructors
| Name | Description |
|---|---|
| GlyphRun (2 overloads) | No summary available. |
GlyphRun overloads
GlyphRun Constructor
public GlyphRun(Avalonia.Media.GlyphTypeface glyphTypeface, double fontRenderingEmSize, ReadOnlyMemory<char> characters, System.Collections.Generic.IReadOnlyList<Avalonia.Media.TextFormatting.GlyphInfo> glyphInfos, Nullable<Avalonia.Point> baselineOrigin, int biDiLevel)
Parameters
glyphTypeface Avalonia.Media.GlyphTypeface
fontRenderingEmSize double
characters ReadOnlyMemory<char>
glyphInfos System.Collections.Generic.IReadOnlyList<Avalonia.Media.TextFormatting.GlyphInfo>
baselineOrigin Nullable<Avalonia.Point>
biDiLevel int
GlyphRun Constructor
public GlyphRun(Avalonia.Media.GlyphTypeface glyphTypeface, double fontRenderingEmSize, ReadOnlyMemory<char> characters, System.Collections.Generic.IReadOnlyList<ushort> glyphIndices, Nullable<Avalonia.Point> baselineOrigin, int biDiLevel)
Parameters
glyphTypeface Avalonia.Media.GlyphTypeface
fontRenderingEmSize double
characters ReadOnlyMemory<char>
glyphIndices System.Collections.Generic.IReadOnlyList<ushort>
baselineOrigin Nullable<Avalonia.Point>
biDiLevel int
Methods
| Name | Description |
|---|---|
| BuildGeometry | Obtains geometry for the glyph run. |
| Dispose | No summary available. |
| FindGlyphIndex | Finds a glyph index for given character index. |
| FindNearestCharacterHit | No summary available. |
| GetCharacterHitFromDistance | No summary available. |
| GetDistanceFromCharacterHit | Retrieves the offset from the leading edge of the Avalonia.Media.GlyphRun to the leading or trailing edge of a caret stop containing the specified character hit. |
| GetIntersections | Gets the intersections of specified upper and lower limit. |
| GetNextCaretCharacterHit | Retrieves the next valid caret character hit in the logical direction in the Avalonia.Media.GlyphRun. |
| GetPreviousCaretCharacterHit | Retrieves the previous valid caret character hit in the logical direction in the Avalonia.Media.GlyphRun. |
| TryCreateImmutableGlyphRunReference | No summary available. |
BuildGeometry Method
Obtains geometry for the glyph run.
public Avalonia.Media.Geometry BuildGeometry()
Returns
The geometry returned contains the combined geometry of all glyphs in the glyph run.
Dispose Method
public void Dispose()
FindGlyphIndex Method
Finds a glyph index for given character index.
public int FindGlyphIndex(int characterIndex)
Parameters
characterIndex int
The character index.
Returns
int
The glyph index.
FindNearestCharacterHit Method
public Avalonia.Media.CharacterHit FindNearestCharacterHit(int index, double& width)
Parameters
index int
width double&
Returns
GetCharacterHitFromDistance Method
public Avalonia.Media.CharacterHit GetCharacterHitFromDistance(double distance, bool& isInside)
Parameters
distance double
isInside bool&
Returns
GetDistanceFromCharacterHit Method
Retrieves the offset from the leading edge of the Avalonia.Media.GlyphRun to the leading or trailing edge of a caret stop containing the specified character hit.
public double GetDistanceFromCharacterHit(Avalonia.Media.CharacterHit characterHit)
Parameters
characterHit Avalonia.Media.CharacterHit
The Avalonia.Media.CharacterHit to use for computing the offset.
Returns
double
A double that represents the offset from the leading edge of the Avalonia.Media.GlyphRun to the leading or trailing edge of a caret stop containing the character hit.
GetIntersections Method
Gets the intersections of specified upper and lower limit.
public System.Collections.Generic.IReadOnlyList<float> GetIntersections(float lowerLimit, float upperLimit)
Parameters
lowerLimit float
Upper limit.
upperLimit float
Lower limit.
Returns
System.Collections.Generic.IReadOnlyList<float>
GetNextCaretCharacterHit Method
Retrieves the next valid caret character hit in the logical direction in the Avalonia.Media.GlyphRun.
public Avalonia.Media.CharacterHit GetNextCaretCharacterHit(Avalonia.Media.CharacterHit characterHit)
Parameters
characterHit Avalonia.Media.CharacterHit
The Avalonia.Media.CharacterHit to use for computing the next hit value.
Returns
A Avalonia.Media.CharacterHit that represents the next valid caret character hit in the logical direction.
If the return value is equal to characterHit, no further navigation is possible in the Avalonia.Media.GlyphRun.
GetPreviousCaretCharacterHit Method
Retrieves the previous valid caret character hit in the logical direction in the Avalonia.Media.GlyphRun.
public Avalonia.Media.CharacterHit GetPreviousCaretCharacterHit(Avalonia.Media.CharacterHit characterHit)
Parameters
characterHit Avalonia.Media.CharacterHit
The Avalonia.Media.CharacterHit to use for computing the previous hit value.
Returns
A cref="CharacterHit"/> that represents the previous valid caret character hit in the logical direction.
If the return value is equal to characterHit, no further navigation is possible in the Avalonia.Media.GlyphRun.
TryCreateImmutableGlyphRunReference Method
public Avalonia.Media.IImmutableGlyphRunReference TryCreateImmutableGlyphRunReference()
Returns
Properties
| Name | Description |
|---|---|
| BaselineOrigin | Gets or sets the baseline origin of theAvalonia.Media.GlyphRun. |
| BiDiLevel | Gets or sets the bidirectional nesting level of the Avalonia.Media.GlyphRun. |
| Bounds | Gets the conservative bounding box of the Avalonia.Media.GlyphRun. |
| Characters | Gets or sets the list of UTF16 code points that represent the Unicode content of the Avalonia.Media.GlyphRun. |
| FontRenderingEmSize | Gets or sets the em size used for rendering the Avalonia.Media.GlyphRun. |
| GlyphInfos | Gets or sets the list of glyphs to use to render this run. |
| GlyphTypeface | Gets the Avalonia.Media.GlyphRun.GlyphTypeface for the Avalonia.Media.GlyphRun. |
| InkBounds | No summary available. |
| IsLeftToRight | Returns true if the text direction is left-to-right. Otherwise, returns false. |
| Metrics | No summary available. |
BaselineOrigin Property
Gets or sets the baseline origin of theAvalonia.Media.GlyphRun.
public Avalonia.Point BaselineOrigin { get; set; }
BiDiLevel Property
Gets or sets the bidirectional nesting level of the Avalonia.Media.GlyphRun.
public int BiDiLevel { get; set; }
Bounds Property
Gets the conservative bounding box of the Avalonia.Media.GlyphRun.
public Avalonia.Rect Bounds { get; set; }
Characters Property
Gets or sets the list of UTF16 code points that represent the Unicode content of the Avalonia.Media.GlyphRun.
public ReadOnlyMemory<char> Characters { get; set; }
FontRenderingEmSize Property
Gets or sets the em size used for rendering the Avalonia.Media.GlyphRun.
public double FontRenderingEmSize { get; set; }
GlyphInfos Property
Gets or sets the list of glyphs to use to render this run.
public System.Collections.Generic.IReadOnlyList<Avalonia.Media.TextFormatting.GlyphInfo> GlyphInfos { get; set; }
GlyphTypeface Property
Gets the Avalonia.Media.GlyphRun.GlyphTypeface for the Avalonia.Media.GlyphRun.
public Avalonia.Media.GlyphTypeface GlyphTypeface { get; set; }
InkBounds Property
public Avalonia.Rect InkBounds { get; set; }
IsLeftToRight Property
Returns true if the text direction is left-to-right. Otherwise, returns false.
public bool IsLeftToRight { get; set; }
Metrics Property
public Avalonia.Media.GlyphRunMetrics Metrics { get; set; }