The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Namespaces | Enumerations | Functions | Variables
font.hpp File Reference
#include "exceptions.hpp"
#include "font_options.hpp"
#include "sdl/utils.hpp"
#include "sdl/image.hpp"
#include <SDL_ttf.h>
Include dependency graph for font.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  font::manager
 
struct  font::manager::error
 

Namespaces

 font
 Graphical text output.
 

Enumerations

enum  font::CACHE { font::CACHE_LOBBY, font::CACHE_GAME }
 

Functions

int font::relative_size (int size)
 
surface font::get_rendered_text (const std::string &str, int size, const SDL_Color &color, int style)
 
SDL_Rect font::draw_text_line (surface &gui_surface, const SDL_Rect &area, int size, const SDL_Color &color, const std::string &text, int x, int y, bool use_tooltips, int style)
 
int font::get_max_height (int size)
 
int font::line_width (const std::string &line, int font_size, int style=TTF_STYLE_NORMAL)
 Determine the width of a line of text given a certain font size. More...
 
SDL_Rect font::line_size (const std::string &line, int font_size, int style=TTF_STYLE_NORMAL)
 Determine the size of a line of text given a certain font size. More...
 
std::string font::make_text_ellipsis (const std::string &text, int font_size, int max_width, int style=TTF_STYLE_NORMAL)
 If the text exceeds the specified max width, end it with an ellipsis (...) More...
 
bool font::load_font_config ()
 
const t_stringfont::get_font_families (family_class fclass=FONT_SANS_SERIF)
 Returns the currently defined fonts. More...
 
void font::cache_mode (CACHE mode)
 

Variables

const int font::SIZE_NORMAL = 14
 
const int font::SIZE_TINY = 10 * SIZE_NORMAL / 14
 
const int font::SIZE_SMALL = 12 * SIZE_NORMAL / 14
 
const int font::SIZE_15 = 15 * SIZE_NORMAL / 14
 
const int font::SIZE_PLUS = 16 * SIZE_NORMAL / 14
 
const int font::SIZE_LARGE = 18 * SIZE_NORMAL / 14
 
const int font::SIZE_TITLE = 20 * SIZE_NORMAL / 14
 
const int font::SIZE_XLARGE = 24 * SIZE_NORMAL / 14