The Battle for Wesnoth  1.13.10+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Namespaces | Macros | Typedefs | Functions | Variables
sdl_ttf.cpp File Reference
#include "font/sdl_ttf.hpp"
#include "font/error.hpp"
#include "font/font_config.hpp"
#include "font/font_id.hpp"
#include "font/text_cache.hpp"
#include "font/text_surface.hpp"
#include "filesystem.hpp"
#include "game_config.hpp"
#include "log.hpp"
#include "font/marked-up_text.hpp"
#include "preferences/general.hpp"
#include "tooltips.hpp"
#include "sdl/rect.hpp"
#include "sdl/surface.hpp"
#include "serialization/unicode.hpp"
#include <SDL_ttf.h>
#include <map>
#include <string>
#include <vector>
Include dependency graph for sdl_ttf.cpp:

Go to the source code of this file.

Classes

struct  font::ttf_record
 
struct  font::char_block_map
 

Namespaces

 font
 Note: Specific to sdl_ttf.
 

Macros

#define DBG_FT   LOG_STREAM(debug, log_font)
 
#define LOG_FT   LOG_STREAM(info, log_font)
 
#define WRN_FT   LOG_STREAM(warn, log_font)
 
#define ERR_FT   LOG_STREAM(err, log_font)
 

Typedefs

typedef std::map< std::string,
SDL_Rect > 
font::line_size_cache_map
 
typedef std::map< std::pair
< std::string, int >, TTF_Font * > 
font::open_font_cache
 

Functions

static TTF_Font * font::open_font_impl (const std::string &, int)
 
static TTF_Font * font::open_font (const std::string &fname, int size)
 
static surface font::render_text (const std::string &text, int fontsize, const color_t &color, int style, bool use_markup)
 
surface font::get_rendered_text (const std::string &str, int size, const color_t &color, int style)
 
SDL_Rect font::draw_text_line (surface &gui_surface, const SDL_Rect &area, int size, const color_t &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...
 
void font::cache_mode (CACHE mode)
 
static void font::clear_fonts ()
 

Variables

static lg::log_domain log_font ("font")
 
static std::map< font_id,
ttf_record > 
font::font_table
 
static std::vector< std::string > font::font_names
 
static std::vector< std::string > font::bold_names
 
static std::vector< std::string > font::italic_names
 
static char_block_map font::char_blocks
 
static std::map< int, std::map
< int, line_size_cache_map > > 
font::line_size_cache
 
open_font_cache font::open_fonts
 

Macro Definition Documentation

#define DBG_FT   LOG_STREAM(debug, log_font)

Definition at line 41 of file sdl_ttf.cpp.

Referenced by font::open_font_impl(), and font::sdl_ttf::set_font_list().

#define ERR_FT   LOG_STREAM(err, log_font)

Definition at line 44 of file sdl_ttf.cpp.

Referenced by font::open_font_impl(), and font::sdl_ttf::sdl_ttf().

#define LOG_FT   LOG_STREAM(info, log_font)

Definition at line 42 of file sdl_ttf.cpp.

Referenced by font::char_block_map::compress(), and font::sdl_ttf::sdl_ttf().

#define WRN_FT   LOG_STREAM(warn, log_font)

Definition at line 43 of file sdl_ttf.cpp.

Referenced by font::sdl_ttf::split_text().

Variable Documentation

lg::log_domain log_font("font")
static