7 #include <SDL2/SDL_ttf.h> 35 bool loadFont(
char *file,
int fontSize);
TTF_Font * getFont()
Get a pointer to the TTF_Font data.
Definition: Font.hpp:49
A class implemented using the Facade pattern used for loading SDL TTF_Font data.
Definition: Font.hpp:17
const Uint32 & getHinting()
Get the current hinting of the font.
Definition: Font.hpp:93
void setFontStyle(int style)
Set the style for the font. Use Font::style enum flags to combine styles.
Definition: Font.hpp:120
style
Set the style of the font.
Definition: Font.hpp:72
char * m_path
The path to the Font file.
Definition: Font.hpp:138
void setOutline(int outline)
Set the outline for the font (in pixels).
Definition: Font.hpp:113
int m_kerning
Kerning for the font (set to 1, or on, by default.
Definition: Font.hpp:140
const int & getStyle()
Get the current style of the font.
Definition: Font.hpp:127
int m_style
Font style (defaults to style::normal).
Definition: Font.hpp:142
int getOutline()
Get the outline for the font (in pixels).
Definition: Font.hpp:106
Uint32 m_hinting
Hinting for the font.
Definition: Font.hpp:139
int m_outline
Font outline (set to 0, or off, by default).
Definition: Font.hpp:141
Font()
Default constructor.
TTF_Font * m_font
Pointer to TTF_Font data - memory managed outside class.
Definition: Font.hpp:137
void setKerning(int allowed)
Turn on/off font kerning (on by default).
Definition: Font.hpp:99
void setFont(TTF_Font *font)
Set the internal TTF_Font for the Font.
Definition: Font.hpp:42
hinting
From SDL_ttf docs: Hinting Font hinting is the use of mathematical instructions to adjust the display...
Definition: Font.hpp:60
void setFontSize(int s)
Set the size for the font (in pixels).
Definition: Font.hpp:127
bool loadFont(char *file, int fontSize)
Load a font from a file.
void setHinting(Uint32 hinting)
Set the hinting of the font (use Font::hinting enum to set valid values).
Definition: Font.hpp:86