The Battle for Wesnoth  1.17.0-dev
Namespaces | Macros | Functions | Variables
sdl_ttf_compat.cpp File Reference
#include "font/sdl_ttf_compat.hpp"
#include "font/standard_colors.hpp"
#include "log.hpp"
#include "sdl/point.hpp"
#include "sdl/utils.hpp"
#include "serialization/unicode.hpp"
#include "tooltips.hpp"
#include "video.hpp"
Include dependency graph for sdl_ttf_compat.cpp:

Go to the source code of this file.

Namespaces

 font
 Collection of helper functions relating to Pango formatting.
 

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)
 

Functions

surface font::pango_render_text (const std::string &text, int size, const color_t &color, font::pango_text::FONT_STYLE style=font::pango_text::STYLE_NORMAL, bool use_markup=false, int max_width=-1)
 Returns a SDL surface containing the rendered text. More...
 
std::pair< int, int > font::pango_line_size (const std::string &line, int font_size, font::pango_text::FONT_STYLE font_style=font::pango_text::STYLE_NORMAL)
 Determine the width and height of a line of text given a certain font size. More...
 
std::string font::pango_line_ellipsize (const std::string &text, int font_size, int max_width, font::pango_text::FONT_STYLE font_style=font::pango_text::STYLE_NORMAL)
 If the text exceeds the specified max width, end it with an ellipsis (...) More...
 
std::string font::pango_word_wrap (const std::string &unwrapped_text, int font_size, int max_width, int max_height=-1, int max_lines=-1, bool partial_line=false)
 Uses Pango to word wrap text. More...
 
SDL_Rect font::pango_draw_text (CVideo *gui, const SDL_Rect &area, int size, const color_t &color, const std::string &text, int x, int y, bool use_tooltips=false, pango_text::FONT_STYLE style=pango_text::STYLE_NORMAL)
 Draws text on the screen. More...
 
SDL_Rect font::pango_draw_text (surface &dst, const SDL_Rect &area, int size, const color_t &color, const std::string &text, int x, int y, bool use_tooltips=false, pango_text::FONT_STYLE style=pango_text::STYLE_NORMAL)
 Draws text on a surface. More...
 

Variables

static lg::log_domain log_font ("font")
 

Macro Definition Documentation

◆ DBG_FT

#define DBG_FT   LOG_STREAM(debug, log_font)

Definition at line 26 of file sdl_ttf_compat.cpp.

◆ ERR_FT

#define ERR_FT   LOG_STREAM(err, log_font)

Definition at line 29 of file sdl_ttf_compat.cpp.

◆ LOG_FT

#define LOG_FT   LOG_STREAM(info, log_font)

Definition at line 27 of file sdl_ttf_compat.cpp.

◆ WRN_FT

#define WRN_FT   LOG_STREAM(warn, log_font)

Definition at line 28 of file sdl_ttf_compat.cpp.

Referenced by font::pango_line_ellipsize().

Variable Documentation

◆ log_font

lg::log_domain log_font("font")
static