Table of Contents

Struct FontGlyph

Namespace
Icy.Rendering.Fonts
Assembly
IcyUI.dll

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

Codepoint int

The Unicode character codepoint that represents this glyph.

GlyphIndex uint

The index of the glyph within the font.

PageIndex uint

Number of the texture page that stores current glyph.

Advance float

The horizontal advance width of the glyph.

Bearing Vector2

The offsets of the glyph's bitmap relative to the origin.

Size Size

The dimensions of the glyph's bounding box.

TextureRegion Rectangle

The region of the glyph in the texture atlas.

Properties

Advance

The horizontal advance width of the glyph.

public float Advance { get; init; }

Property Value

float

Bearing

The offsets of the glyph's bitmap relative to the origin.

public Vector2 Bearing { get; init; }

Property Value

Vector2

Codepoint

The Unicode character codepoint that represents this glyph.

public int Codepoint { get; init; }

Property Value

int

GlyphIndex

The index of the glyph within the font.

public uint GlyphIndex { get; init; }

Property Value

uint

IsEmpty

Gets a value indicating whether the glyph is empty-sized so can't be rendered.

public bool IsEmpty { get; }

Property Value

bool

None

Gets a value representing an empty glyph that should not be rendered.

public static FontGlyph None { get; }

Property Value

FontGlyph

PageIndex

Number of the texture page that stores current glyph.

public uint PageIndex { get; init; }

Property Value

uint

Size

The dimensions of the glyph's bounding box.

public Size Size { get; init; }

Property Value

Size

TextureRegion

The region of the glyph in the texture atlas.

public Rectangle TextureRegion { get; init; }

Property Value

Rectangle

Methods

GetRenderRectangle(Vector2)

Gets a rectangle that represents local render glyph bounds.

public Rectangle GetRenderRectangle(Vector2 position)

Parameters

position Vector2

The position where the glyph will be rendered.

Returns

Rectangle

A rectangle representing the render bounds of the glyph.