GraphicsAPI reference
Struct ShapedGlyph
Namespace: MicroEngine.Graphics
Assembly: MicroEngine.Text.Shaping.dll
Guide: Graphics
One glyph of a shaped line.
public readonly struct ShapedGlyph : IEquatable<ShapedGlyph>Implements
Constructors
ShapedGlyph(int, int, int, Vector2, float, float)
One glyph of a shaped line.
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.
public float Advance { get; init; }Property Value
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.
public int Cluster { get; init; }Property Value
Face
Which face of the font it comes from: 0 the main face, then the fallbacks in order.
public int Face { get; init; }Property Value
Glyph
The glyph’s index in that face (0 is the face’s missing-glyph box).
public int Glyph { get; init; }Property Value
Pen
How far along the line, from its left edge, this glyph’s advance starts.
public float Pen { get; init; }Property Value
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).
public Vector2 Position { get; init; }Property Value
Methods
Deconstruct(out int, out int, out int, out Vector2, out float, out float)
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)
public override bool Equals(object obj)Parameters
obj object
Returns
Equals(ShapedGlyph)
public bool Equals(ShapedGlyph other)Parameters
other ShapedGlyph
Returns
GetHashCode()
public override int GetHashCode()Returns
ToString()
public override string ToString()Returns
Operators
operator ==(ShapedGlyph, ShapedGlyph)
public static bool operator ==(ShapedGlyph left, ShapedGlyph right)Parameters
left ShapedGlyph
right ShapedGlyph
Returns
operator !=(ShapedGlyph, ShapedGlyph)
public static bool operator !=(ShapedGlyph left, ShapedGlyph right)Parameters
left ShapedGlyph
right ShapedGlyph