PositionedGlyph Struct

A glyph of a font at a position: what a text shaper gives, which DrawingCanvas.FillGlyphs draws.

public readonly struct PositionedGlyph : IEquatable<PositionedGlyph>
Implements

Constructors

NameDescription
PositionedGlyph(int, PointD)Initializes a new instance of the PositionedGlyph struct.

PositionedGlyph(int, PointD)

PositionedGlyph.cs

Initializes a new instance of the PositionedGlyph struct.

public PositionedGlyph(int glyph, PointD origin)

Parameters

glyph int
The index of the glyph in the font.
origin PointD
The origin of the glyph, on its baseline, in the coordinates of the drawing.

Properties

NameDescription
GlyphGets the index of the glyph in the font.
OriginGets the origin of the glyph, on its baseline, in the coordinates of the drawing.

Gets the index of the glyph in the font.

public int Glyph { get; }

Property value

int

Gets the origin of the glyph, on its baseline, in the coordinates of the drawing.

public PointD Origin { get; }

Property value

PointD

Methods

NameDescription
Equals(PositionedGlyph)Indicates whether the current object is equal to another object of the same type.
Equals(object?)Indicates whether this instance and a specified object are equal.
GetHashCode()Returns the hash code for this instance.

Equals overloads

Equals(PositionedGlyph)

PositionedGlyph.cs

Indicates whether the current object is equal to another object of the same type.

public bool Equals(PositionedGlyph other)
Parameters
other PositionedGlyph
An object to compare with this object.
Returns

bool true if the current object is equal to the other parameter; otherwise, false.

Equals(object?)

PositionedGlyph.cs

Indicates whether this instance and a specified object are equal.

public override bool Equals(object? obj)
Parameters
obj object?
The object to compare with the current instance.
Returns

bool true if obj and this instance are the same type and represent the same value; otherwise, false.

GetHashCode()

PositionedGlyph.cs

Returns the hash code for this instance.

public override int GetHashCode()

Returns

int A 32-bit signed integer that is the hash code for this instance.

Operators

NameDescription
operator ==(PositionedGlyph, PositionedGlyph)Compares two glyphs for equality.
operator !=(PositionedGlyph, PositionedGlyph)Compares two glyphs for inequality.

operator ==(PositionedGlyph, PositionedGlyph)

PositionedGlyph.cs

Compares two glyphs for equality.

public static bool operator ==(PositionedGlyph left, PositionedGlyph right)

Parameters

left PositionedGlyph
The first glyph.
right PositionedGlyph
The second glyph.

Returns

bool true if they are the same glyph at the same position; otherwise false.

operator !=(PositionedGlyph, PositionedGlyph)

PositionedGlyph.cs

Compares two glyphs for inequality.

public static bool operator !=(PositionedGlyph left, PositionedGlyph right)

Parameters

left PositionedGlyph
The first glyph.
right PositionedGlyph
The second glyph.

Returns

bool true if they are different glyphs or at different positions; otherwise false.