25 #include <yaml-cpp/yaml.h> 36 int width, height, spacing;
49 std::vector<FontImage> _images;
50 std::map< UCode, std::pair<size_t, SDL_Rect> > _chars;
53 void init(
size_t index,
const UString &str);
61 void load(
const YAML::Node& node);
77 void setPalette(SDL_Color *colors,
int firstcolor,
int ncolors);
void setPalette(SDL_Color *colors, int firstcolor, int ncolors)
Sets the font's palette.
Definition: Font.cpp:259
~Font()
Cleans up the font.
Definition: Font.cpp:38
int getHeight() const
Gets the font's character height.
Definition: Font.cpp:193
SDL_Color * getPalette() const
Gets the font's palette.
Definition: Font.cpp:248
void loadTerminal()
Generate the terminal font.
Definition: Font.cpp:74
Takes care of loading and storing each character in a sprite font.
Definition: Font.h:46
int getWidth() const
Gets the font's character width.
Definition: Font.cpp:184
SDL_Rect getCharSize(UCode c)
Gets the size of a particular character;.
Definition: Font.cpp:214
Element that is blit (rendered) onto the screen.
Definition: Surface.h:38
int getSpacing() const
Gets the spacing between characters.
Definition: Font.cpp:204
Font()
Creates a blank font.
Definition: Font.cpp:31
void load(const YAML::Node &node)
Loads the font from YAML.
Definition: Font.cpp:50
Surface * getChar(UCode c)
Gets a particular character from the font, with its real size.
Definition: Font.cpp:171
Definition: BaseInfoState.cpp:40