Skip to main content

Glyph.ixx File

Glyph data structure for text rendering. More...

Included Headers

#include <helios.math>

Namespaces Index

namespacehelios
namespacerendering

Graphics rendering infrastructure. More...

namespacetext

Text rendering abstractions and data types. More...

Classes Index

structGlyph

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

Description

Glyph data structure for text rendering.

File Listing

The file content with the documentation metadata removed is:

1/**
2 * @file Glyph.ixx
3 * @brief Glyph data structure for text rendering.
4 */
5module;
6
7export module helios.rendering.text.Glyph;
8
9import helios.math;
10
11export namespace helios::rendering::text {
12
13 /**
14 * @brief Represents a single rendered glyph (character) from a font.
15 *
16 * A `Glyph` contains all the information needed to render a single character:
17 * the texture ID, size, bearing (offset from baseline), and advance width.
18 *
19 * ## Glyph Metrics
20 *
21 * The following diagram illustrates the glyph metrics:
22 *
23 * ```
24 * +-----------+
25 * | |
26 * | Glyph | <-- size.y (height)
27 * | |
28 * +-----------+ <-- baseline
29 * ^ ^
30 * | |
31 * bearing.x |
32 * advance (to next glyph)
33 * ```
34 *
35 * - **bearing.x:** Horizontal offset from the cursor position to the left edge of the glyph.
36 * - **bearing.y:** Vertical offset from the baseline to the top of the glyph.
37 * - **advance:** Horizontal distance to move the cursor after rendering this glyph.
38 *
39 * @see TextRenderer
40 * @see OpenGLGlyphTextRenderer
41 */
42 struct Glyph {
43
44 /**
45 * @brief GPU texture ID containing the rendered glyph bitmap.
46 */
47 unsigned int textureId;
48
49 /**
50 * @brief Size of the glyph in pixels (width, height).
51 */
53
54 /**
55 * @brief Offset from baseline to left/top of glyph (bearingX, bearingY).
56 *
57 * - `bearing.x`: Horizontal offset from cursor to left edge of glyph.
58 * - `bearing.y`: Vertical offset from baseline to top of glyph.
59 */
61
62 /**
63 * @brief Horizontal offset to advance to the next glyph position.
64 *
65 * The value is stored in 1/64th of a pixel (FreeType format).
66 * Use `advance >> 6` to convert to pixels.
67 */
68 int advance;
69
70 };
71
72}

Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.