A Font class implementation.
More...
#include <Font.h>
|
| Font ()=default |
| Default constructor does not initialize any members. More...
|
|
| Font (const std::filesystem::path &path) |
|
| ~Font () |
| Destructor handles freeing of the underlying asset handle. More...
|
|
Vector2 | MeasureString (const std::string &text, unsigned int ptSize) |
| Returns the bounding-box the given string would occupy at the given point-size, assuming normal (1) scaling. More...
|
|
A Font class implementation.
Wraps the font's FreeType asset handle and provides helper functions.
◆ Font() [1/2]
Default constructor does not initialize any members.
◆ Font() [2/2]
JGL::Font::Font |
( |
const std::filesystem::path & |
path | ) |
|
◆ ~Font()
Destructor handles freeing of the underlying asset handle.
◆ GetLoadedFonts()
std::vector< Font > JGL::Font::GetLoadedFonts |
( |
| ) |
|
|
static |
◆ LoadTTF()
Font JGL::Font::LoadTTF |
( |
const std::filesystem::path & |
filepath | ) |
|
|
static |
◆ MeasureString()
Vector2 JGL::Font::MeasureString |
( |
const std::string & |
text, |
|
|
unsigned int |
ptSize |
|
) |
| |
Returns the bounding-box the given string would occupy at the given point-size, assuming normal (1) scaling.
- Parameters
-
text | The string to measure. |
ptSize | The font size at which to measure. |
- Returns
- The size-in-pixels that would contain the entire text.
◆ face
◆ index
The documentation for this class was generated from the following files: