Skip to content

GraphicsAPI reference

Struct ShapedGlyph

Namespace: MicroEngine.Graphics
Assembly: MicroEngine.Text.Shaping.dll
Guide: Graphics

One glyph of a shaped line.

C#
public readonly struct ShapedGlyph : IEquatable<ShapedGlyph>

Implements

IEquatable<ShapedGlyph>

Constructors

ShapedGlyph(int, int, int, Vector2, float, float)

One glyph of a shaped line.

C#
public ShapedGlyph(int Face, int Glyph, int Cluster, Vector2 Position, float Pen, float Advance)

Parameters

Face int

Which face of the font it comes from: 0 the main face, then the fallbacks in order.

Glyph int

The glyph’s index in that face (0 is the face’s missing-glyph box).

Cluster int

The index in the line’s text of the first character the glyph shows; glyphs of one letter, or letters merged into one glyph, share it.

Position Vector2

The glyph’s origin, relative to the line’s top-left corner: its y is the baseline, moved by any offset the font gives (marks).

Pen float

How far along the line, from its left edge, this glyph’s advance starts.

Advance float

How far the glyph moves the pen.

Properties

Advance

How far the glyph moves the pen.

C#
public float Advance { get; init; }

Property Value

float

Cluster

The index in the line’s text of the first character the glyph shows; glyphs of one letter, or letters merged into one glyph, share it.

C#
public int Cluster { get; init; }

Property Value

int

Face

Which face of the font it comes from: 0 the main face, then the fallbacks in order.

C#
public int Face { get; init; }

Property Value

int

Glyph

The glyph’s index in that face (0 is the face’s missing-glyph box).

C#
public int Glyph { get; init; }

Property Value

int

Pen

How far along the line, from its left edge, this glyph’s advance starts.

C#
public float Pen { get; init; }

Property Value

float

Position

The glyph’s origin, relative to the line’s top-left corner: its y is the baseline, moved by any offset the font gives (marks).

C#
public Vector2 Position { get; init; }

Property Value

Vector2

Methods

Deconstruct(out int, out int, out int, out Vector2, out float, out float)

C#
public void Deconstruct(out int Face, out int Glyph, out int Cluster, out Vector2 Position, out float Pen, out float Advance)

Parameters

Face int

Glyph int

Cluster int

Position Vector2

Pen float

Advance float

Equals(object)

C#
public override bool Equals(object obj)

Parameters

obj object

Returns

bool

Equals(ShapedGlyph)

C#
public bool Equals(ShapedGlyph other)

Parameters

other ShapedGlyph

Returns

bool

GetHashCode()

C#
public override int GetHashCode()

Returns

int

ToString()

C#
public override string ToString()

Returns

string

Operators

operator ==(ShapedGlyph, ShapedGlyph)

C#
public static bool operator ==(ShapedGlyph left, ShapedGlyph right)

Parameters

left ShapedGlyph

right ShapedGlyph

Returns

bool

operator !=(ShapedGlyph, ShapedGlyph)

C#
public static bool operator !=(ShapedGlyph left, ShapedGlyph right)

Parameters

left ShapedGlyph

right ShapedGlyph

Returns

bool