Struct FontGlyph
Represents a rasterized glyph from a font.
public readonly record struct FontGlyph : IEquatable<FontGlyph>
- Implements
- Inherited Members
- Extension Methods
Constructors
FontGlyph(int, uint, uint, float, Vector2, Size, Rectangle)
Represents a rasterized glyph from a font.
public FontGlyph(int Codepoint, uint GlyphIndex, uint PageIndex, float Advance, Vector2 Bearing, Size Size, Rectangle TextureRegion)
Parameters
CodepointintThe Unicode character codepoint that represents this glyph.
GlyphIndexuintThe index of the glyph within the font.
PageIndexuintNumber of the texture page that stores current glyph.
AdvancefloatThe horizontal advance width of the glyph.
BearingVector2The offsets of the glyph's bitmap relative to the origin.
SizeSizeThe dimensions of the glyph's bounding box.
TextureRegionRectangleThe region of the glyph in the texture atlas.
Properties
Advance
The horizontal advance width of the glyph.
public float Advance { get; init; }
Property Value
Bearing
The offsets of the glyph's bitmap relative to the origin.
public Vector2 Bearing { get; init; }
Property Value
Codepoint
The Unicode character codepoint that represents this glyph.
public int Codepoint { get; init; }
Property Value
GlyphIndex
The index of the glyph within the font.
public uint GlyphIndex { get; init; }
Property Value
IsEmpty
Gets a value indicating whether the glyph is empty-sized so can't be rendered.
public bool IsEmpty { get; }
Property Value
None
Gets a value representing an empty glyph that should not be rendered.
public static FontGlyph None { get; }
Property Value
PageIndex
Number of the texture page that stores current glyph.
public uint PageIndex { get; init; }
Property Value
Size
The dimensions of the glyph's bounding box.
public Size Size { get; init; }
Property Value
TextureRegion
The region of the glyph in the texture atlas.
public Rectangle TextureRegion { get; init; }
Property Value
Methods
GetRenderRectangle(Vector2)
Gets a rectangle that represents local render glyph bounds.
public Rectangle GetRenderRectangle(Vector2 position)
Parameters
positionVector2The position where the glyph will be rendered.
Returns
- Rectangle
A rectangle representing the render bounds of the glyph.