Font loading and storage: texture atlas, codepoints supported, dimensions of each glyph.
More...
#include <Font.hpp>
|
struct | Glyph |
| A font glyph bounding box, in UV space. More...
|
|
|
enum class | Alignment { LEFT
, CENTER
, RIGHT
} |
| Text alignment.
|
|
|
const Texture * | _atlas |
| The font texture atlas.
|
|
int | _firstCodepoint |
| The integer value of the first supported character.
|
|
int | _lastCodepoint |
| The integer value of the last supported character.
|
|
glm::vec2 | _margins |
| Margin to apply around each characters when generating the geometry.
|
|
std::vector< Glyph > | _glyphs |
| The glyphs informations.
|
|
Font loading and storage: texture atlas, codepoints supported, dimensions of each glyph.
- Note
- Assumes that the supported codepoints form a continuous range.
◆ Font() [1/3]
Font::Font |
( |
std::istream & |
in | ) |
|
|
explicit |
Load font from text stream.
- Parameters
-
in | the input stream containing the metadata |
◆ Font() [2/3]
Font::Font |
( |
const Font & |
| ) |
|
|
delete |
Copy constructor (disabled).
◆ Font() [3/3]
◆ atlas()
const Texture * Font::atlas |
( |
| ) |
const |
|
inline |
Obtain the font atlas.
- Returns
- the font atlas texture.
◆ generateLabel()
void Font::generateLabel |
( |
const std::string & |
text, |
|
|
float |
scale, |
|
|
Mesh & |
mesh, |
|
|
Alignment |
align = Alignment::LEFT |
|
) |
| const |
Generate the label mesh for a given text and font.
- Parameters
-
text | the text do display |
scale | the vertical height of the characters, in absolute units |
mesh | the mesh to populate |
align | the text alignment to apply, will influence the origin placement |
◆ operator=() [1/2]
Copy assignment operator (disabled).
- Returns
- a reference to the object assigned to
◆ operator=() [2/2]
Move assignment operator.
- Returns
- a reference to the object assigned to
The documentation for this class was generated from the following files:
- src/engine/resources/Font.hpp
- src/engine/resources/Font.cpp