Skip to main content

Glyph Struct

Represents a single rendered glyph (character) from a font. More...

Declaration

struct helios::rendering::text::Glyph { ... }

Public Member Attributes Index

unsigned inttextureId

GPU texture ID containing the rendered glyph bitmap. More...

helios::math::vec2uisize

Size of the glyph in pixels (width, height). More...

helios::math::vec2ibearing

Offset from baseline to left/top of glyph (bearingX, bearingY). More...

intadvance

Horizontal offset to advance to the next glyph position. More...

Description

Represents a single rendered glyph (character) from a font.

A `Glyph` contains all the information needed to render a single character: the texture ID, size, bearing (offset from baseline), and advance width.

## Glyph Metrics

The following diagram illustrates the glyph metrics:

``` +———–+ | | | Glyph | <– size.y (height) | | +———–+ <– baseline ^ ^ | | bearing.x | advance (to next glyph) ```

  • **bearing.x:** Horizontal offset from the cursor position to the left edge of the glyph.
  • **bearing.y:** Vertical offset from the baseline to the top of the glyph.
  • **advance:** Horizontal distance to move the cursor after rendering this glyph.
See Also

TextRenderer

See Also

OpenGLGlyphTextRenderer

Definition at line 42 of file Glyph.ixx.

Public Member Attributes

advance

int helios::rendering::text::Glyph::advance

Horizontal offset to advance to the next glyph position.

The value is stored in 1/64th of a pixel (FreeType format). Use `advance >> 6` to convert to pixels.

Definition at line 68 of file Glyph.ixx.

68 int advance;

bearing

helios::math::vec2i helios::rendering::text::Glyph::bearing

Offset from baseline to left/top of glyph (bearingX, bearingY).

  • `bearing.x`: Horizontal offset from cursor to left edge of glyph.
  • `bearing.y`: Vertical offset from baseline to top of glyph.

Definition at line 60 of file Glyph.ixx.

Referenced by helios::rendering::text::TypeSetter::layout.

size

helios::math::vec2ui helios::rendering::text::Glyph::size

Size of the glyph in pixels (width, height).

Definition at line 52 of file Glyph.ixx.

textureId

unsigned int helios::rendering::text::Glyph::textureId

GPU texture ID containing the rendered glyph bitmap.

Definition at line 47 of file Glyph.ixx.

47 unsigned int textureId;

The documentation for this struct was generated from the following file:


Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.