Skip to main content

GlyphRun Class

Definition

Namespace:Avalonia.Media
Assembly:Avalonia.Base
Package:Avalonia

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

Inheritance: object -> GlyphRun

Implements: IDisposable

Constructors

NameDescription
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

NameDescription
BuildGeometryObtains geometry for the glyph run.
DisposeNo summary available.
FindGlyphIndexFinds a glyph index for given character index.
FindNearestCharacterHitNo summary available.
GetCharacterHitFromDistanceNo summary available.
GetDistanceFromCharacterHitRetrieves 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.
GetIntersectionsGets the intersections of specified upper and lower limit.
GetNextCaretCharacterHitRetrieves the next valid caret character hit in the logical direction in the Avalonia.Media.GlyphRun.
GetPreviousCaretCharacterHitRetrieves the previous valid caret character hit in the logical direction in the Avalonia.Media.GlyphRun.
TryCreateImmutableGlyphRunReferenceNo summary available.

BuildGeometry Method

Obtains geometry for the glyph run.

public Avalonia.Media.Geometry BuildGeometry()

Returns

Avalonia.Media.Geometry

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

Avalonia.Media.CharacterHit

GetCharacterHitFromDistance Method

public Avalonia.Media.CharacterHit GetCharacterHitFromDistance(double distance, bool& isInside)

Parameters

distance double

isInside bool&

Returns

Avalonia.Media.CharacterHit

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

Avalonia.Media.CharacterHit

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

Avalonia.Media.CharacterHit

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

Avalonia.Media.IImmutableGlyphRunReference

Properties

NameDescription
BaselineOriginGets or sets the baseline origin of theAvalonia.Media.GlyphRun.
BiDiLevelGets or sets the bidirectional nesting level of the Avalonia.Media.GlyphRun.
BoundsGets the conservative bounding box of the Avalonia.Media.GlyphRun.
CharactersGets or sets the list of UTF16 code points that represent the Unicode content of the Avalonia.Media.GlyphRun.
FontRenderingEmSizeGets or sets the em size used for rendering the Avalonia.Media.GlyphRun.
GlyphInfosGets or sets the list of glyphs to use to render this run.
GlyphTypefaceGets the Avalonia.Media.GlyphRun.GlyphTypeface for the Avalonia.Media.GlyphRun.
InkBoundsNo summary available.
IsLeftToRightReturns true if the text direction is left-to-right. Otherwise, returns false.
MetricsNo 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; }