the template, the class CFreetypeFont
performs rendering of text.
: the class works by
- Loading a particular font (and size)
- It then creates small bitmap images for
each character with codes 0 to 128
- Each image is sent to the GPU as a 2D
- Spacing for each character is stored
- Position and texture coordinate data for
all characters is stored in a VBO
: Each character is rendered separately.
- The character’s texture is bound
- A modelview matrix is translated based on
the current position, and scaled based on the font size
- A character is rendered as a quad using a
- The current position is advanced