25 #include <yaml-cpp/yaml.h> 35 int width, height, spacing;
48 std::vector<FontImage> _images;
49 std::map< wchar_t, std::pair<size_t, SDL_Rect> > _chars;
52 void init(
size_t index,
const std::wstring &str);
59 static inline bool isLinebreak(
wchar_t c) {
return (c == L
'\n' || c == L
'\x02'); }
61 static inline bool isSpace(
wchar_t c) {
return (c == L
' ' || c == L
'\xA0'); }
63 static inline bool isSeparator(
wchar_t c) {
return (c == L
'-' || c ==
'/'); }
67 void load(
const YAML::Node& node);
75 int getHeight()
const;
77 int getSpacing()
const;
79 SDL_Rect getCharSize(
wchar_t c);
81 SDL_Color *getPalette()
const;
83 void setPalette(SDL_Color *colors,
int firstcolor,
int ncolors);
static bool isNonBreakableSpace(wchar_t c)
Checks if a character is a non-breaking space.
Definition: Font.h:65
static bool isSeparator(wchar_t c)
Checks if a character is a word separator.
Definition: Font.h:63
static bool isSpace(wchar_t c)
Checks if a character is a blank space (includes non-breaking spaces).
Definition: Font.h:61
static bool isLinebreak(wchar_t c)
Checks if a character is a linebreak.
Definition: Font.h:59
Takes care of loading and storing each character in a sprite font.
Definition: Font.h:45
Element that is blit (rendered) onto the screen.
Definition: Surface.h:36
Definition: BaseInfoState.cpp:40