#include "global.hpp"
#include "font.hpp"
#include "gettext.hpp"
#include "marked-up_text.hpp"
#include "team.hpp"
#include "video.hpp"
#include "wml_exception.hpp"
Go to the source code of this file.
Namespaces | |
namespace | font |
Functions | |
static std::string::const_iterator | font::parse_markup (std::string::const_iterator i1, std::string::const_iterator i2, int *font_size, SDL_Color *colour, int *style) |
Parses the markup-tags at the front of a string. | |
std::string | font::del_tags (const std::string &text) |
Copy string, but without tags at the beginning. | |
std::string | font::nullify_markup (const std::string &text) |
Copy string, but with NULL MARKUP tag at the beginning of each line. | |
std::string | font::color2markup (const SDL_Color color) |
Create string of color-markup, such as "<255,255,0>" for yellow. | |
SDL_Rect | font::text_area (const std::string &text, int size, int style) |
Calculate the size of a text (in pixels) if it were to be drawn. | |
SDL_Rect | font::draw_text (CVideo *gui, const SDL_Rect &area, int size, const SDL_Color &colour, const std::string &txt, int x, int y, bool use_tooltips, int style) |
Draw text on the screen, clip text to area. | |
bool | font::is_format_char (char c) |
Determine if char is one of the special chars used as markup. | |
static void | font::cut_word (std::string &line, std::string &word, int font_size, int style, int max_width) |
bool | font::no_break_after (wchar_t ch) |
bool | font::no_break_before (wchar_t ch) |
bool | font::break_before (wchar_t ch) |
bool | font::break_after (wchar_t ch) |
std::string | font::word_wrap_text (const std::string &unwrapped_text, int font_size, int max_width, int max_height, int max_lines) |
Wrap text. | |
SDL_Rect | font::draw_wrapped_text (CVideo *gui, const SDL_Rect &area, int font_size, const SDL_Color &colour, const std::string &text, int x, int y, int max_width) |
Draw text on the screen, fit text to maximum width, no markup, no tooltips. | |
size_t | font::text_to_lines (std::string &message, size_t max_length) |
Chop up one long string of text into lines. | |
Variables | |
const char | font::LARGE_TEXT = '*' |
Standard markups for color, size, font, images. | |
const char | font::SMALL_TEXT = '`' |
const char | font::BOLD_TEXT = '~' |
const char | font::NORMAL_TEXT = '{' |
const char | font::NULL_MARKUP = '^' |
const char | font::BLACK_TEXT = '}' |
const char | font::GRAY_TEXT = '|' |
const char | font::GOOD_TEXT = '@' |
const char | font::BAD_TEXT = '#' |
const char | font::GREEN_TEXT = '@' |
const char | font::RED_TEXT = '#' |
const char | font::COLOR_TEXT = '<' |
const char | font::IMAGE = '&' |
E.g. "@Victory" will be shown in green.
Definition in file marked-up_text.cpp.
Generated by doxygen 1.5.5 on 23 May 2008 for The Battle for Wesnoth | Gna! | Forum | Wiki | CIA | devdocs |