Skip to main content
Version: 1.0.0-preview.33

Velaptor.Graphics.GlyphMetrics

Velaptor

Velaptor.Graphics

GlyphMetrics Struct

Holds all of the various metrics of a glyph for rendering purposes.

public readonly struct GlyphMetrics :
System.IEquatable<Velaptor.Graphics.GlyphMetrics>

Implements System.IEquatable<GlyphMetrics>

Properties

Ascender

Gets the vertical distance from the horizontal baseline to the highest 'character'
coordinate in a font face.

public float Ascender { get; set; }

Property Value

System.Single

Remarks

Unfortunately, font formats don't define the ascender in a
uniform way. For some formats, it represents the ascent of all capital Latin characters
(without accents). For others it is the ascent of the highest accented character. Finally,
other formats define it as being equal to Y max value of the global bounding box.

CharIndex

Gets the glyph index.

public uint CharIndex { get; set; }

Property Value

System.UInt32

Remarks

The value of 0 means ‘undefined character code’.

Descender

Gets the vertical distance from the horizontal baseline to the lowest ‘character’ coordinate in a font face.

public float Descender { get; set; }

Property Value

System.Single

Remarks

Unfortunately, font formats don't define the descender in a uniform way. For some formats,
it represents the descent of all capital Latin characters (without accents). For others it is
the ascent of the lowest accented character. Finally, other formats define it as being equal
to the Y min value of the global bounding box. This field is negative for values below the baseline.

Glyph

Gets the glyph character.

public char Glyph { get; set; }

Property Value

System.Char

GlyphBounds

Gets the rectangular bounds of where in a font texture
atlas the given Glyph resides.

public System.Drawing.RectangleF GlyphBounds { get; set; }

Property Value

System.Drawing.RectangleF

GlyphHeight

Gets the glyph's height.

public float GlyphHeight { get; set; }

Property Value

System.Single

GlyphWidth

Gets the glyph's width.

public float GlyphWidth { get; set; }

Property Value

System.Single

HoriBearingX

Gets the horizontal distance from the current cursor position to
the leftmost border of the glyph image's bounding box.

public float HoriBearingX { get; set; }

Property Value

System.Single

HoriBearingY

Gets the vertical distance from the current cursor position
(on the baseline) to the top most border of the glyph image's bounding box.

public float HoriBearingY { get; set; }

Property Value

System.Single

HorizontalAdvance

Gets the horizontal distance to increment the pen position when the glyph
is drawn as part of a string of text.

public float HorizontalAdvance { get; set; }

Property Value

System.Single

XMax

Gets the horizontal maximum (right-most).

public float XMax { get; set; }

Property Value

System.Single

XMin

Gets the horizontal minimum (left-most).

public float XMin { get; set; }

Property Value

System.Single

YMax

Gets the vertical maximum (top-most).

public float YMax { get; set; }

Property Value

System.Single

YMin

Gets the vertical minimum (bottom-most).

public float YMin { get; set; }

Property Value

System.Single