Graphical text output. More...
Classes | |
struct | decode_table |
class | floating_label |
struct | floating_label_context |
structure which will hide all current floating labels, and cause floating labels instantiated after it is created to be displayed More... | |
struct | manager |
struct | subset_descriptor |
class | ttext |
Text class. More... | |
Enumerations | |
enum | ALIGN { LEFT_ALIGN, CENTER_ALIGN, RIGHT_ALIGN } |
enum | LABEL_SCROLL_MODE { ANCHOR_LABEL_SCREEN, ANCHOR_LABEL_MAP } |
enum | CACHE { CACHE_LOBBY, CACHE_GAME } |
enum | family_class { FONT_SANS_SERIF, FONT_MONOSPACE } |
Font classes for get_font_families(). More... | |
Functions | |
int | add_floating_label (const floating_label &flabel) |
add a label floating on the screen above everything else. More... | |
void | move_floating_label (int handle, double xmove, double ymove) |
moves the floating label given by 'handle' by (xmove,ymove) More... | |
void | scroll_floating_labels (double xmove, double ymove) |
moves all floating labels that have 'scroll_mode' set to ANCHOR_LABEL_MAP More... | |
void | remove_floating_label (int handle) |
removes the floating label given by 'handle' from the screen More... | |
void | show_floating_label (int handle, bool show) |
hides or shows a floating label More... | |
SDL_Rect | get_floating_label_rect (int handle) |
void | draw_floating_labels (surface screen) |
void | undraw_floating_labels (surface screen) |
static bool | check_font_file (std::string name) |
static void | set_font_list (const std::vector< subset_descriptor > &fontlist) |
static surface | render_text (const std::string &text, int fontsize, const SDL_Color &color, int style, bool use_markup) |
surface | get_rendered_text (const std::string &str, int size, const SDL_Color &color, int style) |
SDL_Rect | 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 | get_max_height (int size) |
int | 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 | 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 | 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 | load_font_config () |
const t_string & | get_font_families (family_class fclass=FONT_SANS_SERIF) |
Returns the currently defined fonts. More... | |
void | cache_mode (CACHE mode) |
int | relative_size (int size) |
family_class | str_to_family_class (const std::string &str) |
std::string::const_iterator | parse_markup (std::string::const_iterator i1, std::string::const_iterator i2, int *font_size, SDL_Color *color, int *style) |
Parses the markup-tags at the front of a string. More... | |
std::string | del_tags (const std::string &text) |
Copy string, but without tags at the beginning. More... | |
std::string | color2markup (const SDL_Color &color) |
Create string of color-markup, such as "<255,255,0>" for yellow. More... | |
std::string | color2hexa (const SDL_Color &color) |
Creates the hexadecimal string of a color, such as "#ffff00" for yellow. More... | |
std::string | span_color (const SDL_Color &color) |
Creates pango markup of a color. More... | |
SDL_Rect | text_area (const std::string &text, int size, int style=0) |
Calculate the size of a text (in pixels) if it were to be drawn. More... | |
SDL_Rect | draw_text (surface &dst, const SDL_Rect &area, int size, const SDL_Color &color, const std::string &text, int x, int y, bool use_tooltips=false, int style=0) |
Function to draw text on a surface. More... | |
SDL_Rect | draw_text (CVideo *gui, const SDL_Rect &area, int size, const SDL_Color &color, const std::string &text, int x, int y, bool use_tooltips=false, int style=0) |
wrapper of the previous function, gui can also be nullptr More... | |
bool | is_format_char (char c) |
Determine if char is one of the special chars used as markup. More... | |
bool | is_cjk_char (const ucs4::char_t ch) |
Determine if a ucs4::char_t is a CJK character. More... | |
static void | cut_word (std::string &line, std::string &word, int font_size, int style, int max_width) |
std::string | word_wrap_text (const std::string &unwrapped_text, int font_size, int max_width, int max_height=-1, int max_lines=-1, bool partial_line=false) |
Wrap text. More... | |
SDL_Rect | draw_wrapped_text (CVideo *gui, const SDL_Rect &area, int font_size, const SDL_Color &color, 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. More... | |
static bool | looks_like_url (const std::string &token) |
std::string | escape_text (const std::string &text) |
Escapes the markup characters in a text. More... | |
static void | decode_pixel (unsigned char *p) |
Converts from premultiplied alpha to plain alpha. More... | |
Variables | |
const SDL_Color | NORMAL_COLOR = {0xDD,0xDD,0xDD,0} |
const SDL_Color | GRAY_COLOR = {0x77,0x77,0x77,0} |
const SDL_Color | LOBBY_COLOR = {0xBB,0xBB,0xBB,0} |
const SDL_Color | GOOD_COLOR = {0x00,0xFF,0x00,0} |
const SDL_Color | BAD_COLOR = {0xFF,0x00,0x00,0} |
const SDL_Color | BLACK_COLOR = {0x00,0x00,0x00,0} |
const SDL_Color | YELLOW_COLOR = {0xFF,0xFF,0x00,0} |
const SDL_Color | BUTTON_COLOR = {0xBC,0xB0,0x88,0} |
const SDL_Color | PETRIFIED_COLOR = {0xA0,0xA0,0xA0,0} |
const SDL_Color | TITLE_COLOR = {0xBC,0xB0,0x88,0} |
const SDL_Color | LABEL_COLOR = {0x6B,0x8C,0xFF,0} |
const SDL_Color | BIGMAP_COLOR = {0xFF,0xFF,0xFF,0} |
const SDL_Color | DISABLED_COLOR = inverse(PETRIFIED_COLOR) |
const int | SIZE_NORMAL = 14 |
const int | SIZE_TINY = 10 * SIZE_NORMAL / 14 |
const int | SIZE_SMALL = 12 * SIZE_NORMAL / 14 |
const int | SIZE_15 = 15 * SIZE_NORMAL / 14 |
const int | SIZE_PLUS = 16 * SIZE_NORMAL / 14 |
const int | SIZE_LARGE = 18 * SIZE_NORMAL / 14 |
const int | SIZE_TITLE = 20 * SIZE_NORMAL / 14 |
const int | SIZE_XLARGE = 24 * SIZE_NORMAL / 14 |
const char | LARGE_TEXT ='*' |
Standard markups for color, size, font, images. More... | |
const char | SMALL_TEXT ='`' |
const char | BOLD_TEXT ='~' |
const char | NORMAL_TEXT ='{' |
const char | NULL_MARKUP ='^' |
const char | BLACK_TEXT ='}' |
const char | GRAY_TEXT ='|' |
const char | GOOD_TEXT ='@' |
const char | BAD_TEXT ='#' |
const char | GREEN_TEXT ='@' |
const char | RED_TEXT ='#' |
const char | COLOR_TEXT ='<' |
const char | IMAGE ='&' |
const std::string | weapon = "<245,230,193>" |
const std::string | weapon_details = "<166,146,117>" |
const std::string | unit_type = "<245,230,193>" |
const std::string | race = "<166,146,117>" |
const SDL_Color | weapon_color = { 245, 230, 193, SDL_ALPHA_OPAQUE } |
const SDL_Color | good_dmg_color = { 130, 240, 50, SDL_ALPHA_OPAQUE } |
const SDL_Color | bad_dmg_color = { 250, 140, 80, SDL_ALPHA_OPAQUE } |
const SDL_Color | weapon_details_color = { 166, 146, 117, SDL_ALPHA_OPAQUE } |
const SDL_Color | inactive_details_color = { 146, 146, 146, SDL_ALPHA_OPAQUE } |
const SDL_Color | inactive_ability_color = { 146, 146, 146, SDL_ALPHA_OPAQUE } |
const SDL_Color | unit_type_color = { 245, 230, 193, SDL_ALPHA_OPAQUE } |
const SDL_Color | race_color = { 166, 146, 117, SDL_ALPHA_OPAQUE } |
const std::string | weapon_numbers_sep = "×" |
const std::string | weapon_details_sep = "–" |
static struct decode_table | decode_table |
Graphical text output.
This module is used to display and measure text. Text can optionally contain special characters, which may change specified display properties such as colour or font size. If special characters are turned on, they can be escaped, C-style, using backslashes.
enum font::ALIGN |
Enumerator | |
---|---|
LEFT_ALIGN | |
CENTER_ALIGN | |
RIGHT_ALIGN |
Definition at line 32 of file floating_label.hpp.
enum font::CACHE |
enum font::family_class |
Font classes for get_font_families().
Enumerator | |
---|---|
FONT_SANS_SERIF | |
FONT_MONOSPACE |
Definition at line 26 of file font_options.hpp.
Enumerator | |
---|---|
ANCHOR_LABEL_SCREEN | |
ANCHOR_LABEL_MAP |
Definition at line 34 of file floating_label.hpp.
int font::add_floating_label | ( | const floating_label & | flabel | ) |
add a label floating on the screen above everything else.
Definition at line 316 of file floating_label.cpp.
Referenced by display_chat_manager::add_chat_message(), display::announce(), terrain_label::draw(), game_display::float_label(), game_lua_kernel::intf_print(), playmp_controller::play_human_turn(), display::set_diagnostic(), CVideo::set_help_string(), show_tooltip(), display::update_display(), and gui::floating_textbox::update_location().
void font::cache_mode | ( | CACHE | mode | ) |
Definition at line 1120 of file font.cpp.
References CACHE_LOBBY.
Referenced by mp::run_lobby_loop().
|
static |
Definition at line 503 of file font.cpp.
References filesystem::file_exists(), game_config::path, and WRN_FT.
Referenced by set_font_list().
std::string font::color2hexa | ( | const SDL_Color & | color | ) |
Creates the hexadecimal string of a color, such as "#ffff00" for yellow.
Definition at line 176 of file marked-up_text.cpp.
Referenced by span_color().
std::string font::color2markup | ( | const SDL_Color & | color | ) |
Create string of color-markup, such as "<255,255,0>" for yellow.
Definition at line 164 of file marked-up_text.cpp.
Referenced by dialogs::units_list_preview_pane::get_details(), dialogs::recall_dialog(), and dialogs::show_unit_list().
|
static |
Definition at line 322 of file marked-up_text.cpp.
References ucs4::iterator_base< string_type, update_implementation >::end(), preferences::font_scaled(), line_size(), and ucs4::iterator_base< string_type, update_implementation >::substr().
Referenced by word_wrap_text().
|
static |
Converts from premultiplied alpha to plain alpha.
p | pointer to a 4-byte endian-dependent color. |
Definition at line 714 of file text.cpp.
References DECODE, and font::decode_table::values.
Referenced by font::ttext::rerender().
std::string font::del_tags | ( | const std::string & | text | ) |
Copy string, but without tags at the beginning.
Definition at line 153 of file marked-up_text.cpp.
References utils::join(), parse_markup(), and utils::split().
Referenced by gui::menu::basic_sorter::less().
Definition at line 458 of file floating_label.cpp.
References i.
Referenced by gui2::twindow::draw(), display::flip(), and font::floating_label_context::floating_label_context().
SDL_Rect font::draw_text | ( | surface & | dst, |
const SDL_Rect & | area, | ||
int | size, | ||
const SDL_Color & | color, | ||
const std::string & | text, | ||
int | x, | ||
int | y, | ||
bool | use_tooltips = false , |
||
int | style = 0 |
||
) |
Function to draw text on a surface.
The text will be clipped to area. If the text runs outside of area horizontally, an ellipsis will be displayed at the end of it.
If use_tooltips is true, then text with an ellipsis will have a tooltip set for it equivalent to the entire contents of the text.
Some very basic 'markup' will be done on the text:
The above special characters can be quoted using a C-style backslash.
A bounding rectangle of the text is returned. If dst is nullptr, then the text will not be drawn, and a bounding rectangle only will be returned.
Definition at line 194 of file marked-up_text.cpp.
References draw_text_line(), gui2::event::find(), parse_markup(), and utils::unescape().
Referenced by gui::button::calculate_size(), gui::progress_bar::draw_contents(), gui::label::draw_contents(), location_palette_item::draw_contents(), mp::wait::leader_preview_pane::draw_contents(), gui::button::draw_contents(), gui::tristate_button::draw_contents(), dialogs::unit_preview_pane::draw_contents(), mp::gamebrowser::draw_contents(), draw_label(), draw_text(), gui::dialog_frame::draw_title(), battle_prediction_pane::draw_unit(), draw_wrapped_text(), gui::menu::style::item_size(), about::show_about(), hotkey::show_binding_dialog(), text_area(), the_end(), and default_map_generator::user_config().
SDL_Rect font::draw_text | ( | CVideo * | gui, |
const SDL_Rect & | area, | ||
int | size, | ||
const SDL_Color & | color, | ||
const std::string & | txt, | ||
int | x, | ||
int | y, | ||
bool | use_tooltips, | ||
int | style | ||
) |
wrapper of the previous function, gui can also be nullptr
Definition at line 241 of file marked-up_text.cpp.
References draw_text(), and CVideo::getSurface().
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 | ||
) |
Definition at line 892 of file font.cpp.
References tooltips::add_tooltip(), sdl::create_rect(), gui2::event::find(), preferences::font_scaled(), line_width(), make_text_ellipsis(), surface::null(), render_text(), and sdl_blit().
Referenced by draw_text(), battle_prediction_pane::draw_unit(), and battle_prediction_pane::get_hp_distrib_surface().
SDL_Rect font::draw_wrapped_text | ( | CVideo * | gui, |
const SDL_Rect & | area, | ||
int | font_size, | ||
const SDL_Color & | color, | ||
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.
This method makes sure that the text fits within a given maximum width. If a line exceeds this width, it will be wrapped on a word basis if possible, otherwise on a char basis. This method is otherwise similar to the draw_text method, but it doesn't support special markup or tooltips.
Definition at line 557 of file marked-up_text.cpp.
References draw_text(), and word_wrap_text().
Referenced by mp::wait::leader_preview_pane::draw_contents().
std::string font::escape_text | ( | const std::string & | text | ) |
Escapes the markup characters in a text.
The markups escaped are the ones used in the pango markup. The special characters are:
<>'"&
The escaping is the same as for HTML.
text | The text to escape. |
Definition at line 75 of file text.cpp.
References c.
Referenced by gui2::tlobby_main::add_active_window_message(), gui2::tlobby_main::add_active_window_whisper(), gui2::tlobby_main::add_chat_message(), gui2::tlua_interpreter::lua_model::add_dialog_message(), gui2::tlobby_main::add_room_window_message(), gui2::tformula_debugger::pre_show(), gui2::tchat_log::model::stream_log(), and unit_name().
SDL_Rect font::get_floating_label_rect | ( | int | handle | ) |
Definition at line 365 of file floating_label.cpp.
References sdl::create_rect(), sdl::empty_rect, and i.
Referenced by display_chat_manager::add_chat_message(), display_chat_manager::prune_chat_messages(), CVideo::set_help_string(), show_tooltip(), and gui::floating_textbox::update_location().
const t_string & font::get_font_families | ( | family_class | fclass = FONT_SANS_SERIF | ) |
Returns the currently defined fonts.
Definition at line 1110 of file font.cpp.
References FONT_MONOSPACE.
Referenced by font::ttext::recalculate().
Definition at line 960 of file font.cpp.
References get_font().
Referenced by gui::textbox::add_text_line(), gui::textbox::textbox(), gui::dialog_frame::top_padding(), and gui2::ttext_box::update_offsets().
surface font::get_rendered_text | ( | const std::string & | str, |
int | size, | ||
const SDL_Color & | color, | ||
int | style | ||
) |
Definition at line 886 of file font.cpp.
References render_text().
Referenced by help::help_text_area::add_text_item(), gui::textbox::add_text_line(), display::draw_hex(), mp::gamebrowser::draw_row(), display::draw_text_in_hex(), and help::help_text_area::set_items().
bool font::is_cjk_char | ( | const ucs4::char_t | ch | ) |
Determine if a ucs4::char_t is a CJK character.
true | Input-char is a CJK char |
false | Input-char is a not CJK char. |
You can check these range at http://unicode.org/charts/ see the "East Asian Scripts" part. Notice that not all characters in that part is still in use today, so don't list them all here. Below are characters that I guess may be used in wesnoth translations.
Definition at line 268 of file marked-up_text.cpp.
Referenced by help::get_first_word().
bool font::is_format_char | ( | char | c | ) |
Determine if char is one of the special chars used as markup.
true | Input-char is a markup-char. |
false | Input-char is a normal char. |
Definition at line 250 of file marked-up_text.cpp.
References BAD_TEXT, BLACK_TEXT, BOLD_TEXT, GOOD_TEXT, GRAY_TEXT, NORMAL_TEXT, NULL_MARKUP, and SMALL_TEXT.
Referenced by word_wrap_text().
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.
Similar to line_width, but for both coordinates.
Definition at line 974 of file font.cpp.
References gui2::cache, gui::font_size, and i.
Referenced by cut_word(), GetShaderSource_RW(), GetShaderSourceSize_RW(), line_width(), and word_wrap_text().
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.
The font type used is the default wesnoth font type.
Definition at line 969 of file font.cpp.
References line_size().
Referenced by help::help_text_area::add_text_item(), gui::textbox::add_text_line(), battle_prediction_pane::battle_prediction_pane(), gui::file_menu::display_current_files(), draw_text_line(), dialogs::file_dialog::format_dirname(), battle_prediction_pane::get_hp_distrib_surface(), battle_prediction_pane::get_strings_max_length(), make_text_ellipsis(), help::unit_topic_generator::operator()(), help::unit_topic_generator::push_header(), help::push_tab_pair(), CVideo::set_help_string(), and word_wrap_text().
bool font::load_font_config | ( | ) |
Definition at line 1048 of file font.cpp.
References add_font_to_fontlist(), config::child(), config::child_range(), e, ERR_FT, filesystem::get_wml_location(), game::error::message, preprocess_file(), read(), set_font_list(), and utils::split().
Referenced by do_gameloop(), and test_utils::game_config_manager::game_config_manager().
|
static |
Definition at line 842 of file text.cpp.
Referenced by font::ttext::get_link(), and font::ttext::handle_token().
std::string font::make_text_ellipsis | ( | const std::string & | text, |
int | font_size, | ||
int | max_width, | ||
int | style | ||
) |
If the text exceeds the specified max width, end it with an ellipsis (...)
Definition at line 996 of file font.cpp.
References game_config::images::ellipsis, ucs4::iterator_base< string_type, update_implementation >::end(), itor, line_width(), and ucs4::iterator_base< string_type, update_implementation >::substr().
Referenced by gui::button::calculate_size(), mp::gamebrowser::draw_row(), gui::menu::draw_row(), draw_text_line(), and help::help_text_area::set_items().
moves the floating label given by 'handle' by (xmove,ymove)
Definition at line 328 of file floating_label.cpp.
References i.
Referenced by display_chat_manager::prune_chat_messages(), CVideo::set_help_string(), and show_tooltip().
std::string::const_iterator font::parse_markup | ( | std::string::const_iterator | i1, |
std::string::const_iterator | i2, | ||
int * | font_size, | ||
SDL_Color * | color, | ||
int * | style | ||
) |
Parses the markup-tags at the front of a string.
Definition at line 65 of file marked-up_text.cpp.
References BAD_COLOR, BAD_TEXT, BLACK_COLOR, BLACK_TEXT, BOLD_TEXT, COLOR_TEXT, GOOD_COLOR, GOOD_TEXT, GRAY_COLOR, GRAY_TEXT, int(), lexical_cast(), NORMAL_COLOR, NORMAL_TEXT, NULL_MARKUP, and SMALL_TEXT.
Referenced by gui::button::calculate_size(), mp::chat::color_message(), del_tags(), gui::menu::draw_row(), draw_text(), mp::chat::format_message(), render_text(), and word_wrap_text().
Definition at line 72 of file font.hpp.
Referenced by help::help_browser::adjust_layout(), help::help_browser::help_browser(), gui::dialog::layout(), dialogs::recall_dialog(), dialogs::recruit_dialog(), help::show_help(), and dialogs::unit_preview_pane::unit_preview_pane().
removes the floating label given by 'handle' from the screen
Definition at line 345 of file floating_label.cpp.
References i.
Referenced by terrain_label::clear(), CVideo::clear_help_string(), clear_tooltip(), gui::floating_textbox::close(), game_lua_kernel::intf_print(), display_chat_manager::prune_chat_messages(), display::set_diagnostic(), CVideo::set_help_string(), display::update_display(), gui::floating_textbox::update_location(), and font::floating_label_context::~floating_label_context().
|
static |
Definition at line 813 of file font.cpp.
References create_compatible_surface(), sdl::create_rect(), gui2::event::find(), i, surface::null(), parse_markup(), sdl_blit(), SDL_SetAlpha(), SDL_SRCALPHA, utils::split(), and surf.
Referenced by draw_text_line(), get_rendered_text(), gui::label::label(), gui::label::set_color(), and gui::label::set_text().
void font::scroll_floating_labels | ( | double | xmove, |
double | ymove | ||
) |
moves all floating labels that have 'scroll_mode' set to ANCHOR_LABEL_MAP
Definition at line 336 of file floating_label.cpp.
References ANCHOR_LABEL_MAP, and i.
Referenced by display::scroll().
|
static |
Definition at line 525 of file font.cpp.
References check_font_file(), clear_fonts(), char_block_map::compress(), DBG_FT, i, char_block_map::insert(), and itor.
Referenced by load_font_config().
hides or shows a floating label
Definition at line 357 of file floating_label.cpp.
References i.
Referenced by terrain_label::calculate_shroud().
std::string font::span_color | ( | const SDL_Color & | color | ) |
Creates pango markup of a color.
Don't forget to close it with a </span>
.
Definition at line 183 of file marked-up_text.cpp.
References color2hexa().
Referenced by attack_info(), editor::editor_palette< Item >::draw_contents(), gui2::format_stats(), gray_inactive(), REPORT_GENERATOR(), gui2::set_weapon_info(), gui2::tmp_change_control::controller::show_sides_list(), unit_abilities(), unit_alignment(), unit_defense(), unit_hp(), unit_moves(), unit_weapons(), and unit_xp().
|
inline |
Definition at line 32 of file font_options.hpp.
References FONT_MONOSPACE, and FONT_SANS_SERIF.
SDL_Rect font::text_area | ( | const std::string & | text, |
int | size, | ||
int | style = 0 |
||
) |
Calculate the size of a text (in pixels) if it were to be drawn.
Definition at line 188 of file marked-up_text.cpp.
References draw_text(), and NORMAL_COLOR.
Referenced by gui::progress_bar::draw_contents(), dialogs::unit_preview_pane::draw_contents(), gui::menu::draw_row(), gui::dialog::layout(), the_end(), and gui::label::update_label_size().
Definition at line 475 of file floating_label.cpp.
References i.
Referenced by display::flip(), gui2::twindow::show(), and font::floating_label_context::~floating_label_context().
std::string font::word_wrap_text | ( | const std::string & | unwrapped_text, |
int | font_size, | ||
int | max_width, | ||
int | max_height = -1 , |
||
int | max_lines = -1 , |
||
bool | partial_line = false |
||
) |
Wrap text.
Definition at line 440 of file marked-up_text.cpp.
References _(), cut_word(), ucs4::iterator_base< string_type, update_implementation >::end(), preferences::font_scaled(), gui::font_size, is_format_char(), line_size(), line_width(), ucs4::iterator_base< string_type, update_implementation >::next_is_end(), parse_markup(), ucs4::iterator_base< string_type, update_implementation >::substr(), and VALIDATE.
Referenced by display_chat_manager::add_chat_message(), gui::dialog::dialog(), draw_wrapped_text(), and help::split_in_width().
const SDL_Color font::BAD_COLOR = {0xFF,0x00,0x00,0} |
Definition at line 568 of file font.cpp.
Referenced by help::help_text_area::add_text_item(), editor::editor_palette< Item >::draw_contents(), game_display::draw_hex(), mp::gamebrowser::draw_row(), parse_markup(), REPORT_GENERATOR(), string_to_color(), and display::update_display().
const SDL_Color font::bad_dmg_color = { 250, 140, 80, SDL_ALPHA_OPAQUE } |
Definition at line 56 of file marked-up_text.cpp.
Referenced by attack_info(), unit_alignment(), and unit_weapons().
const char font::BAD_TEXT ='#' |
Definition at line 44 of file marked-up_text.cpp.
Referenced by is_format_char(), parse_markup(), and events::menu_handler::status_table().
const SDL_Color font::BIGMAP_COLOR = {0xFF,0xFF,0xFF,0} |
Definition at line 575 of file font.cpp.
Referenced by string_to_color().
const SDL_Color font::BLACK_COLOR = {0x00,0x00,0x00,0} |
Definition at line 569 of file font.cpp.
Referenced by gui::progress_bar::draw_contents(), display::draw_text_in_hex(), parse_markup(), and string_to_color().
const char font::BLACK_TEXT ='}' |
Definition at line 43 of file marked-up_text.cpp.
Referenced by is_format_char(), and parse_markup().
const char font::BOLD_TEXT ='~' |
Definition at line 41 of file marked-up_text.cpp.
Referenced by statistics_dialog::display_stats(), dialogs::unit_preview_pane::draw_contents(), is_format_char(), parse_markup(), dialogs::recall_dialog(), and dialogs::show_unit_list().
const SDL_Color font::BUTTON_COLOR = {0xBC,0xB0,0x88,0} |
Definition at line 571 of file font.cpp.
Referenced by gui::button::calculate_size(), gui::button::draw_contents(), and gui::tristate_button::draw_contents().
const char font::COLOR_TEXT ='<' |
Definition at line 46 of file marked-up_text.cpp.
Referenced by parse_markup().
|
static |
const SDL_Color font::DISABLED_COLOR = inverse(PETRIFIED_COLOR) |
Definition at line 576 of file font.cpp.
Referenced by gui::slider::draw_contents(), mp::gamebrowser::draw_row(), and gui::label::get_color().
const SDL_Color font::GOOD_COLOR = {0x00,0xFF,0x00,0} |
Definition at line 567 of file font.cpp.
Referenced by mp::gamebrowser::draw_row(), parse_markup(), and string_to_color().
const SDL_Color font::good_dmg_color = { 130, 240, 50, SDL_ALPHA_OPAQUE } |
Definition at line 55 of file marked-up_text.cpp.
Referenced by attack_info(), unit_alignment(), and unit_weapons().
const char font::GOOD_TEXT ='@' |
Definition at line 44 of file marked-up_text.cpp.
Referenced by is_format_char(), and parse_markup().
const SDL_Color font::GRAY_COLOR = {0x77,0x77,0x77,0} |
Definition at line 565 of file font.cpp.
Referenced by gui::button::draw_contents(), mp::gamebrowser::draw_row(), gray_inactive(), parse_markup(), and REPORT_GENERATOR().
const char font::GRAY_TEXT ='|' |
Definition at line 43 of file marked-up_text.cpp.
Referenced by is_format_char(), and parse_markup().
const char font::GREEN_TEXT ='@' |
Definition at line 45 of file marked-up_text.cpp.
Referenced by dialogs::show_unit_list().
const char font::IMAGE ='&' |
Definition at line 46 of file marked-up_text.cpp.
Referenced by gui::file_menu::display_current_files(), mp::wait::leader_preview_pane::draw_contents(), and mp::wait::generate_menu().
const SDL_Color font::inactive_ability_color = { 146, 146, 146, SDL_ALPHA_OPAQUE } |
Definition at line 59 of file marked-up_text.cpp.
Referenced by unit_abilities().
const SDL_Color font::inactive_details_color = { 146, 146, 146, SDL_ALPHA_OPAQUE } |
Definition at line 58 of file marked-up_text.cpp.
Referenced by attack_info().
const SDL_Color font::LABEL_COLOR = {0x6B,0x8C,0xFF,0} |
Definition at line 574 of file font.cpp.
Referenced by mp::chat::color_message(), terrain_label::draw(), game_lua_kernel::intf_float_label(), game_lua_kernel::intf_print(), events::menu_handler::label_terrain(), and terrain_label::read().
const char font::LARGE_TEXT ='*' |
Standard markups for color, size, font, images.
Definition at line 40 of file marked-up_text.cpp.
Referenced by about::show_about().
const SDL_Color font::NORMAL_COLOR = {0xDD,0xDD,0xDD,0} |
Definition at line 564 of file font.cpp.
Referenced by mp::chat::color_message(), mp::configure::configure(), gui::dialog::dialog(), location_palette_item::draw_contents(), mp::wait::leader_preview_pane::draw_contents(), dialogs::unit_preview_pane::draw_contents(), mp::gamebrowser::draw_contents(), wb::move::draw_hex(), display::draw_hex(), draw_label(), game_display::draw_movement_info(), mp::gamebrowser::draw_row(), gui::menu::draw_row(), battle_prediction_pane::draw_unit(), battle_prediction_pane::get_hp_distrib_surface(), gui::menu::style::item_size(), parse_markup(), gui::dialog::set_image(), help::help_text_area::set_items(), gui::dialog::set_textbox(), about::show_about(), hotkey::show_binding_dialog(), show_tooltip(), string_to_color(), text_area(), play_controller::hotkey_handler::toggle_accelerated_speed(), editor::mouse_action_map_label::up_left(), display::update_display(), default_map_generator::user_config(), and playsingle_controller::hotkey_handler::whiteboard_toggle().
const char font::NORMAL_TEXT ='{' |
Definition at line 41 of file marked-up_text.cpp.
Referenced by is_format_char(), parse_markup(), dialogs::recall_dialog(), and dialogs::show_unit_list().
const char font::NULL_MARKUP ='^' |
Definition at line 42 of file marked-up_text.cpp.
Referenced by gui::file_menu::display_current_files(), ng::create_engine::extras_menu_item_names(), is_format_char(), parse_markup(), and events::menu_handler::status_table().
const std::string font::race = "<166,146,117>" |
Definition at line 51 of file marked-up_text.cpp.
Referenced by dialogs::unit_preview_pane::draw_contents(), help::generate_unit_sections(), help::generate_unit_topics(), impl_race_get(), luaW_pushracetable(), and unit_type_data::set_config().
const SDL_Color font::race_color = { 166, 146, 117, SDL_ALPHA_OPAQUE } |
Definition at line 61 of file marked-up_text.cpp.
const char font::RED_TEXT ='#' |
Definition at line 45 of file marked-up_text.cpp.
Referenced by dialogs::show_unit_list().
const int font::SIZE_15 = 15 * SIZE_NORMAL / 14 |
Definition at line 64 of file font.hpp.
Referenced by battle_prediction_pane::draw_unit().
const int font::SIZE_LARGE = 18 * SIZE_NORMAL / 14 |
Definition at line 66 of file font.hpp.
Referenced by CVideo::set_help_string(), and hotkey::show_binding_dialog().
const int font::SIZE_NORMAL = 14 |
Definition at line 58 of file font.hpp.
Referenced by battle_prediction_pane::battle_prediction_pane(), gui::file_menu::display_current_files(), terrain_label::draw(), gui::progress_bar::draw_contents(), dialogs::unit_preview_pane::draw_contents(), mp::gamebrowser::draw_contents(), mp::gamebrowser::draw_row(), battle_prediction_pane::draw_unit(), dialogs::file_dialog::format_dirname(), battle_prediction_pane::get_strings_max_length(), and default_map_generator::user_config().
const int font::SIZE_PLUS = 16 * SIZE_NORMAL / 14 |
Definition at line 65 of file font.hpp.
Referenced by battle_prediction_pane::battle_prediction_pane(), mp::wait::leader_preview_pane::draw_contents(), mp::gamebrowser::draw_row(), display::set_diagnostic(), and gui::floating_textbox::show().
const int font::SIZE_SMALL = 12 * SIZE_NORMAL / 14 |
Definition at line 62 of file font.hpp.
Referenced by display_chat_manager::add_chat_message(), battle_prediction_pane::battle_prediction_pane(), mp::wait::leader_preview_pane::draw_contents(), dialogs::unit_preview_pane::draw_contents(), display::draw_hex(), battle_prediction_pane::draw_unit(), battle_prediction_pane::get_hp_distrib_surface(), and game_lua_kernel::intf_print().
const int font::SIZE_TINY = 10 * SIZE_NORMAL / 14 |
const int font::SIZE_TITLE = 20 * SIZE_NORMAL / 14 |
Definition at line 67 of file font.hpp.
Referenced by gui::dialog_frame::draw_title(), and gui::dialog_frame::top_padding().
const int font::SIZE_XLARGE = 24 * SIZE_NORMAL / 14 |
Definition at line 68 of file font.hpp.
Referenced by display::announce(), game_display::float_label(), about::show_about(), and the_end().
const char font::SMALL_TEXT ='`' |
Definition at line 40 of file marked-up_text.cpp.
Referenced by is_format_char(), parse_markup(), and about::show_about().
const SDL_Color font::TITLE_COLOR = {0xBC,0xB0,0x88,0} |
Definition at line 573 of file font.cpp.
Referenced by gui::dialog_frame::draw_title().
const std::string font::unit_type = "<245,230,193>" |
Definition at line 50 of file marked-up_text.cpp.
Referenced by dialogs::unit_preview_pane::draw_contents().
const SDL_Color font::unit_type_color = { 245, 230, 193, SDL_ALPHA_OPAQUE } |
Definition at line 60 of file marked-up_text.cpp.
const std::string font::weapon = "<245,230,193>" |
Definition at line 48 of file marked-up_text.cpp.
Referenced by dialogs::unit_preview_pane::draw_contents(), battle_prediction_pane::get_unit_strings(), game_lua_kernel::impl_current_get(), basic_unit_filter_impl::internal_matches_filter(), gui2::set_weapon_info(), and unit_weapons().
const SDL_Color font::weapon_color = { 245, 230, 193, SDL_ALPHA_OPAQUE } |
Definition at line 54 of file marked-up_text.cpp.
Referenced by attack_info(), unit_alignment(), and unit_weapons().
const std::string font::weapon_details = "<166,146,117>" |
Definition at line 49 of file marked-up_text.cpp.
Referenced by dialogs::unit_preview_pane::draw_contents().
const SDL_Color font::weapon_details_color = { 166, 146, 117, SDL_ALPHA_OPAQUE } |
Definition at line 57 of file marked-up_text.cpp.
Referenced by attack_info(), and unit_weapons().
const std::string font::weapon_details_sep = "–" |
Definition at line 63 of file marked-up_text.cpp.
Referenced by attack_info(), dialogs::unit_preview_pane::draw_contents(), and gui2::tunit_preview_pane::set_displayed_type().
const std::string font::weapon_numbers_sep = "×" |
Definition at line 63 of file marked-up_text.cpp.
Referenced by attack_info(), dialogs::unit_preview_pane::draw_contents(), gui2::tunit_preview_pane::set_displayed_type(), gui2::set_weapon_info(), and unit_weapons().
const SDL_Color font::YELLOW_COLOR = {0xFF,0xFF,0x00,0} |
Definition at line 570 of file font.cpp.
Referenced by help::help_text_area::add_text_item(), game_display::draw_movement_info(), mp::gamebrowser::draw_row(), display::set_diagnostic(), string_to_color(), and gui::floating_textbox::update_location().