Graphical text output. More...
Classes | |
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... | |
class | floating_label |
class | attribute_list |
Helper class to encapsulate the management of a PangoAttrList. More... | |
struct | error |
struct | manager |
struct | subset_descriptor |
class | p_font |
Small helper class to make sure the pango font object is destroyed properly. More... | |
struct | inverse_table |
class | pango_text |
Text class. More... | |
Enumerations | |
enum | ALIGN { LEFT_ALIGN , CENTER_ALIGN , RIGHT_ALIGN } |
enum | LABEL_SCROLL_MODE { ANCHOR_LABEL_SCREEN , ANCHOR_LABEL_MAP } |
enum | family_class { FONT_SANS_SERIF , FONT_MONOSPACE , FONT_LIGHT , FONT_SCRIPT } |
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, const std::chrono::milliseconds &fadeout=std::chrono::milliseconds{0}) |
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 () |
void | update_floating_labels () |
void | add_attribute_size (attribute_list &list, unsigned offset_start, unsigned offset_end, int size) |
Add Pango font size attribute to a specific portion of text. More... | |
void | add_attribute_weight (attribute_list &list, unsigned offset_start, unsigned offset_end, PangoWeight weight) |
Add Pango font weight attribute to a specific portion of text. More... | |
void | add_attribute_style (attribute_list &list, unsigned offset_start, unsigned offset_end, PangoStyle style) |
Add Pango font style attribute to a specific portion of text, used to set italic/oblique text. More... | |
void | add_attribute_underline (attribute_list &list, unsigned offset_start, unsigned offset_end, PangoUnderline underline) |
Add Pango underline attribute to a specific portion of text. More... | |
void | add_attribute_fg_color (attribute_list &list, unsigned offset_start, unsigned offset_end, const color_t &color) |
Add Pango fg color attribute to a specific portion of text. More... | |
void | add_attribute_bg_color (attribute_list &list, unsigned offset_start, unsigned offset_end, const color_t &color) |
Mark a specific portion of text for highlighting. More... | |
void | add_attribute_font_family (attribute_list &list, unsigned offset_start, unsigned offset_end, font::family_class family) |
Add Pango font family attribute to a specific portion of text. More... | |
int | relative_size (int size) |
bool | load_font_config () |
const t_string & | get_font_families (family_class fclass=FONT_SANS_SERIF) |
Returns the currently defined fonts. More... | |
family_class | str_to_family_class (const std::string &str) |
std::string | escape_text (std::string_view text) |
Escapes the pango markup characters in a text. More... | |
std::string | semi_escape_text (std::string_view text) |
bool | looks_like_url (std::string_view str) |
std::string | format_as_link (const std::string &link, color_t color) |
texture | 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 texture containing the rendered text. More... | |
std::pair< int, int > | 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 | 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... | |
rect | pango_draw_text (bool actually_draw, const 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... | |
color_t | string_to_color (const std::string &s) |
Return the color the string represents. More... | |
static void | unpremultiply (uint8_t &value, const unsigned div) |
static void | from_cairo_format (uint32_t &c) |
Converts from cairo-format ARGB32 premultiplied alpha to plain alpha. More... | |
pango_text & | get_text_renderer () |
Returns a reference to a static pango_text object. More... | |
int | get_max_height (unsigned size, font::family_class fclass=font::FONT_SANS_SERIF, pango_text::FONT_STYLE style=pango_text::STYLE_NORMAL) |
Returns the maximum glyph height of a font, in pixels. More... | |
constexpr float | get_line_spacing_factor () |
Variables | |
const int | SIZE_NORMAL = 17 |
const int | SIZE_TINY = 13 * (SIZE_NORMAL / 17) |
const int | SIZE_SMALL = 15 * (SIZE_NORMAL / 17) |
const int | SIZE_BUTTON = 16 * (SIZE_NORMAL / 17) |
const int | SIZE_BUTTON_SMALL = 14 * (SIZE_NORMAL / 17) |
const int | SIZE_15 = 15 * (SIZE_NORMAL / 17) |
const int | SIZE_PLUS = 18 * (SIZE_NORMAL / 17) |
const int | SIZE_LARGE = 20 * (SIZE_NORMAL / 17) |
const int | SIZE_TITLE = 22 * (SIZE_NORMAL / 17) |
const int | SIZE_FLOAT_LABEL = 24 * (SIZE_NORMAL / 17) |
const int | SIZE_XLARGE = 36 * (SIZE_NORMAL / 17) |
const std::size_t | max_text_line_width = 4096 |
const std::string | ellipsis = "..." |
const std::string | nbsp = " " |
const std::string | unicode_minus = "-" |
const std::string | unicode_en_dash = "–" |
const std::string | unicode_em_dash = "—" |
const std::string | unicode_figure_dash = "‒" |
const std::string | unicode_multiplication_sign = "×" |
const std::string | unicode_bullet = "•" |
const std::string | weapon_numbers_sep = "×" |
const std::string | weapon_details_sep = "–" |
const color_t | NORMAL_COLOR {221, 221, 221} |
const color_t | GRAY_COLOR {136, 136, 136} |
const color_t | LOBBY_COLOR {187, 187, 187} |
const color_t | GOOD_COLOR {0 , 181, 26 } |
const color_t | BAD_COLOR {255, 0 , 0 } |
const color_t | BLACK_COLOR {0 , 0 , 0 } |
const color_t | YELLOW_COLOR {255, 255, 0 } |
const color_t | BUTTON_COLOR {186, 172, 125} |
const color_t | PETRIFIED_COLOR {160, 160, 160} |
const color_t | TITLE_COLOR {186, 172, 125} |
const color_t | LABEL_COLOR {107, 140, 255} |
const color_t | BIGMAP_COLOR {255, 255, 255} |
const color_t | GREEN_COLOR {0 , 255, 0 } |
const color_t | BLUE_COLOR {0 , 0 , 255} |
const color_t | INACTIVE_COLOR {150, 150, 150} |
const color_t | DISABLED_COLOR = PETRIFIED_COLOR.inverse() |
const color_t | weapon_color {245, 230, 193} |
const color_t | good_dmg_color {130, 240, 50 } |
const color_t | bad_dmg_color {250, 140, 80 } |
const color_t | weapon_details_color {196, 176, 147} |
const color_t | inactive_details_color { 86, 86, 86} |
const color_t | inactive_ability_color {146, 146, 146} |
const color_t | unit_type_color {245, 230, 193} |
const color_t | race_color {166, 146, 117} |
static constexpr inverse_table | inverse_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 39 of file floating_label.hpp.
enum font::family_class |
Font classes for get_font_families().
Enumerator | |
---|---|
FONT_SANS_SERIF | |
FONT_MONOSPACE | |
FONT_LIGHT | |
FONT_SCRIPT |
Definition at line 26 of file font_options.hpp.
Enumerator | |
---|---|
ANCHOR_LABEL_SCREEN | |
ANCHOR_LABEL_MAP |
Definition at line 41 of file floating_label.hpp.
void font::add_attribute_bg_color | ( | attribute_list & | list, |
unsigned | offset_start, | ||
unsigned | offset_end, | ||
const color_t & | color | ||
) |
Mark a specific portion of text for highlighting.
Used for selection box. BGColor is set in set_text(), this just marks the area to be colored. Markup not used because the user may enter their own markup or special characters
list | The attribute list to which to append this attribute. |
offset_start | Byte index of the cursor where selection/highlight starts |
offset_end | Byte index of the cursor where selection/highlight ends |
color | Highlight/Background color |
Definition at line 143 of file attributes.cpp.
References DBG_GUI_D.
Referenced by gui2::text_shape::draw(), and gui2::text_box_base::set_highlight_area().
void font::add_attribute_fg_color | ( | attribute_list & | list, |
unsigned | offset_start, | ||
unsigned | offset_end, | ||
const color_t & | color | ||
) |
Add Pango fg color attribute to a specific portion of text.
This changes the foreground color of the corresponding part of the text.
list | The attribute list to which to append this attribute. |
offset_start | Byte index of the cursor where color change starts |
offset_end | Byte index of the cursor where color change ends |
color | Foreground color |
Definition at line 127 of file attributes.cpp.
References DBG_GUI_D.
void font::add_attribute_font_family | ( | attribute_list & | list, |
unsigned | offset_start, | ||
unsigned | offset_end, | ||
font::family_class | family | ||
) |
Add Pango font family attribute to a specific portion of text.
This changes the font family of the corresponding part of the text.
list | The attribute list to which to append this attribute. |
offset_start | Byte index of the cursor where size change starts |
offset_end | Byte index of the cursor where size change ends |
family | The font family |
Definition at line 158 of file attributes.cpp.
References t_string::c_str(), DBG_GUI_D, and get_font_families().
void font::add_attribute_size | ( | attribute_list & | list, |
unsigned | offset_start, | ||
unsigned | offset_end, | ||
int | size | ||
) |
Add Pango font size attribute to a specific portion of text.
This changes the font size of the corresponding part of the text.
list | The attribute list to which to append this attribute. |
offset_start | Byte index of the cursor where size change starts |
offset_end | Byte index of the cursor where size change ends |
size | Font size |
Definition at line 72 of file attributes.cpp.
References DBG_GUI_D, prefs::font_scaled(), prefs::get(), video::get_pixel_scale(), and utf8::size().
void font::add_attribute_style | ( | attribute_list & | list, |
unsigned | offset_start, | ||
unsigned | offset_end, | ||
PangoStyle | style | ||
) |
Add Pango font style attribute to a specific portion of text, used to set italic/oblique text.
list | The attribute list to which to append this attribute. |
offset_start | Byte index of the cursor where font style change starts |
offset_end | Byte index of the cursor where font style change ends |
style | Pango font style (normal/italic/oblique) |
Definition at line 101 of file attributes.cpp.
References DBG_GUI_D.
void font::add_attribute_underline | ( | attribute_list & | list, |
unsigned | offset_start, | ||
unsigned | offset_end, | ||
PangoUnderline | underline | ||
) |
Add Pango underline attribute to a specific portion of text.
This adds an underline to the corresponding part of the text.
list | The attribute list to which to append this attribute. |
offset_start | Byte index of the cursor where underline starts |
offset_end | Byte index of the cursor where underline change ends |
underline | Pango underline style |
Definition at line 114 of file attributes.cpp.
References DBG_GUI_D.
void font::add_attribute_weight | ( | attribute_list & | list, |
unsigned | offset_start, | ||
unsigned | offset_end, | ||
PangoWeight | weight | ||
) |
Add Pango font weight attribute to a specific portion of text.
This changes the font weight of the corresponding part of the text.
list | The attribute list to which to append this attribute. |
offset_start | Byte index of the cursor where font weight change starts |
offset_end | Byte index of the cursor where font weight change ends |
weight | Pango font weight |
Definition at line 88 of file attributes.cpp.
References DBG_GUI_D.
int font::add_floating_label | ( | const floating_label & | flabel | ) |
add a label floating on the screen above everything else.
Definition at line 261 of file floating_label.cpp.
Referenced by display_chat_manager::add_chat_message(), display::announce(), game_display::float_label(), game_lua_kernel::intf_set_floating_label(), terrain_label::recalculate(), display::set_diagnostic(), editor::editor_display::set_help_string(), editor::editor_display::set_status(), display::update_fps_label(), and gui::floating_textbox::update_location().
void font::draw_floating_labels | ( | ) |
Definition at line 358 of file floating_label.cpp.
References label.
Referenced by display::expose().
|
inline |
Escapes the pango 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 33 of file escape.hpp.
References c.
Referenced by about::credits_group::about_group::about_group(), gui2::chatbox::add_active_window_message(), gui2::chatbox::add_active_window_whisper(), gui2::chatbox::add_chat_message(), gui2::dialogs::lua_interpreter::lua_model::add_dialog_message(), gui2::chatbox::add_room_window_message(), gui2::chatbox::add_whisper_window_whisper(), addons_client::delete_remote_addon(), addon_info::display_title(), addons_client::do_check_before_overwriting_addon(), addons_client::download_addon(), addons_client::install_addon(), addons_client::is_error_response(), gui2::dialogs::lua_interpreter::lua_model::lua_model(), gui2::dialogs::formula_debugger::pre_show(), gui2::dialogs::chat_log::model::stream_log(), unit_name(), and addons_client::upload_addon().
|
inline |
Definition at line 33 of file hyperlink.hpp.
References color_t::to_hex_string().
Referenced by font::pango_text::format_links().
|
static |
Converts from cairo-format ARGB32 premultiplied alpha to plain alpha.
c | a uint32 representing the color |
Definition at line 696 of file text.cpp.
References b, c, g, inverse_table_, and unpremultiply().
Referenced by font::pango_text::create_surface().
SDL_Rect font::get_floating_label_rect | ( | int | handle | ) |
Definition at line 319 of file floating_label.cpp.
References sdl::empty_rect, i, and utf8::size().
Referenced by display_chat_manager::add_chat_message(), editor::editor_display::layout(), display_chat_manager::prune_chat_messages(), editor::editor_display::set_help_string(), editor::editor_display::set_status(), and gui::floating_textbox::update_location().
const t_string & font::get_font_families | ( | family_class | fclass | ) |
Returns the currently defined fonts.
Definition at line 102 of file font_config.cpp.
References FONT_LIGHT, FONT_MONOSPACE, and FONT_SCRIPT.
Referenced by add_attribute_font_family(), font::pango_text::calculate_size(), and font::pango_text::get_max_glyph_height().
|
constexpr |
Definition at line 532 of file text.hpp.
Referenced by gui2::multiline_text::handle_mouse_selection(), and font::pango_text::pango_text().
int font::get_max_height | ( | unsigned | size, |
font::family_class | fclass = font::FONT_SANS_SERIF , |
||
pango_text::FONT_STYLE | style = pango_text::STYLE_NORMAL |
||
) |
Returns the maximum glyph height of a font, in pixels.
size | Desired font size in pixels. |
fclass | Font family to use for measurement. |
style | Font style to select the correct variant for measurement. |
Definition at line 964 of file text.cpp.
References font::pango_text::get_max_glyph_height(), get_text_renderer(), font::pango_text::set_family_class(), font::pango_text::set_font_size(), font::pango_text::set_font_style(), and utf8::size().
Referenced by gui2::rich_label::add_link(), gui::textbox::add_text_line(), gui2::rich_label::get_parsed_text(), gui::textbox::textbox(), gui2::combobox::update_offsets(), gui2::multiline_text::update_offsets(), and gui2::text_box::update_offsets().
pango_text & font::get_text_renderer | ( | ) |
Returns a reference to a static pango_text object.
Since the class is essentially a render pipeline, there's no need for individual areas of the game to own their own renderers. Not to mention it isn't a trivial class; constructing one is likely to be expensive.
Definition at line 958 of file text.cpp.
Referenced by font::floating_label::create_texture(), gui2::text_shape::draw(), display::draw_hex(), display::draw_label(), display::draw_report(), display::draw_text_in_hex(), get_max_height(), gui2::rich_label::get_offset_from_xy(), and gui2::rich_label::get_xy_from_offset().
bool font::load_font_config | ( | ) |
Definition at line 58 of file font_config.cpp.
References e, ERR_FT, filesystem::get_wml_location(), config::optional_child(), preprocess_file(), and read().
Referenced by game_launcher::change_language(), do_gameloop(), and test_utils::game_config_manager::game_config_manager().
|
inline |
Definition at line 28 of file hyperlink.hpp.
Referenced by font::pango_text::format_links(), and font::pango_text::get_link().
void font::move_floating_label | ( | int | handle, |
double | xmove, | ||
double | ymove | ||
) |
moves the floating label given by 'handle' by (xmove,ymove)
Definition at line 273 of file floating_label.cpp.
References i.
Referenced by game_lua_kernel::intf_move_floating_label(), editor::editor_display::layout(), display_chat_manager::prune_chat_messages(), editor::editor_display::set_help_string(), and editor::editor_display::set_status().
rect font::pango_draw_text | ( | bool | actually_draw, |
const 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.
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 area is empty, the text will not be clipped.
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.
A bounding rectangle of the text is returned. If actually_draw is true the text will also be drawn to the screen. Otherwise only the bounding rectangle is returned.
Definition at line 108 of file sdl_ttf_compat.cpp.
References tooltips::add_tooltip(), draw::blit(), rect::empty(), FONT_SANS_SERIF, utf8::size(), and t.
Referenced by gui::button::calculate_size(), gui::button::draw_contents(), and location_palette_item::draw_contents().
std::pair< int, int > font::pango_line_size | ( | const std::string & | line, |
int | font_size, | ||
font::pango_text::FONT_STYLE | font_style | ||
) |
Determine the width and height of a line of text given a certain font size.
Definition at line 60 of file sdl_ttf_compat.cpp.
References FONT_SANS_SERIF, draw::line(), and s.
Referenced by gui::textbox::add_text_line(), and editor::editor_display::set_help_string().
texture font::pango_render_text | ( | const std::string & | text, |
int | size, | ||
const color_t & | color, | ||
font::pango_text::FONT_STYLE | style, | ||
bool | use_markup, | ||
int | max_width | ||
) |
Returns a SDL texture containing the rendered text.
Definition at line 44 of file sdl_ttf_compat.cpp.
References FONT_SANS_SERIF, and utf8::size().
Referenced by gui::textbox::add_text_line().
std::string font::pango_word_wrap | ( | const std::string & | unwrapped_text, |
int | font_size, | ||
int | max_width, | ||
int | max_height, | ||
int | max_lines, | ||
bool | |||
) |
Uses Pango to word wrap text.
Definition at line 76 of file sdl_ttf_compat.cpp.
References FONT_SANS_SERIF, draw::line(), and font::pango_text::STYLE_NORMAL.
Referenced by display_chat_manager::add_chat_message(), and gui2::rich_label::split_in_width().
|
inline |
Definition at line 30 of file constants.hpp.
References utf8::size(), and SIZE_NORMAL.
void font::remove_floating_label | ( | int | handle, |
const std::chrono::milliseconds & | fadeout = std::chrono::milliseconds{0} |
||
) |
removes the floating label given by 'handle' from the screen
if fadeout is given, the label fades out over that duration if fadeout is less than 0, it uses the fadeout setting from the label
Definition at line 290 of file floating_label.cpp.
References i.
Referenced by display::announce(), terrain_label::clear(), display::clear_fps_label(), editor::editor_display::clear_help_string(), gui::floating_textbox::close(), game_lua_kernel::intf_remove_floating_label(), game_lua_kernel::intf_set_floating_label(), display_chat_manager::prune_chat_messages(), display::set_diagnostic(), display::update_fps_label(), gui::floating_textbox::update_location(), and font::floating_label_context::~floating_label_context().
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 281 of file floating_label.cpp.
References ANCHOR_LABEL_MAP, and i.
Referenced by display::scroll().
|
inline |
Definition at line 52 of file escape.hpp.
References c.
Referenced by font::pango_text::validate_markup().
void font::show_floating_label | ( | int | handle, |
bool | value | ||
) |
hides or shows a floating label
Definition at line 311 of file floating_label.cpp.
References i.
Referenced by terrain_label::calculate_shroud().
|
inline |
Definition at line 34 of file font_options.hpp.
References FONT_LIGHT, FONT_MONOSPACE, FONT_SANS_SERIF, and FONT_SCRIPT.
color_t font::string_to_color | ( | const std::string & | s | ) |
Return the color the string represents.
Return font::NORMAL_COLOR if the string is empty or can't be matched against any other color.
Definition at line 49 of file standard_colors.cpp.
References BAD_COLOR, BIGMAP_COLOR, BLACK_COLOR, BLUE_COLOR, color_t::from_hex_string(), GOOD_COLOR, NORMAL_COLOR, and YELLOW_COLOR.
Referenced by gui2::rich_label::get_parsed_text().
|
static |
Definition at line 680 of file text.cpp.
Referenced by from_cairo_format().
void font::update_floating_labels | ( | ) |
Definition at line 375 of file floating_label.cpp.
Referenced by display::layout().
const color_t font::BAD_COLOR {255, 0 , 0 } |
Definition at line 25 of file standard_colors.cpp.
Referenced by gui2::dialogs::mp_lobby::adjust_game_row_contents(), gui2::addon_list::colorize_addon_state_string(), unit_helper::format_cost_string(), unit_helper::format_movement_string(), editor::editor_palette< Item >::layout(), REPORT_GENERATOR(), string_to_color(), and display::update_fps_label().
const color_t font::bad_dmg_color {250, 140, 80 } |
Definition at line 42 of file standard_colors.cpp.
Referenced by attack_info(), gui2::dialogs::attack_predictions::set_data(), unit_alignment(), and unit_weapons().
const color_t font::BIGMAP_COLOR {255, 255, 255} |
Definition at line 32 of file standard_colors.cpp.
Referenced by string_to_color().
const color_t font::BLACK_COLOR {0 , 0 , 0 } |
Definition at line 26 of file standard_colors.cpp.
Referenced by string_to_color().
const color_t font::BLUE_COLOR {0 , 0 , 255} |
Definition at line 34 of file standard_colors.cpp.
Referenced by string_to_color().
const color_t font::BUTTON_COLOR {186, 172, 125} |
Definition at line 28 of file standard_colors.cpp.
Referenced by add_name(), gui::button::calculate_size(), and gui::button::draw_contents().
const color_t font::DISABLED_COLOR = PETRIFIED_COLOR.inverse() |
Definition at line 37 of file standard_colors.cpp.
const std::string font::ellipsis = "..." |
Definition at line 39 of file constants.cpp.
Referenced by utils::ellipsis_truncate().
const color_t font::GOOD_COLOR {0 , 181, 26 } |
Definition at line 24 of file standard_colors.cpp.
Referenced by gui2::addon_list::colorize_addon_state_string(), gui2::dialogs::mp_lobby::make_game_row_data(), gui2::addon_list::set_addons(), and string_to_color().
const color_t font::good_dmg_color {130, 240, 50 } |
Definition at line 41 of file standard_colors.cpp.
Referenced by attack_info(), gui2::dialogs::attack_predictions::set_data(), unit_alignment(), and unit_weapons().
const color_t font::GRAY_COLOR {136, 136, 136} |
Definition at line 22 of file standard_colors.cpp.
Referenced by gui2::dialogs::units_dialog::build_recall_dialog(), gui2::dialogs::campaign_selection::campaign_selected(), gui2::addon_list::colorize_addon_state_string(), gui::button::draw_contents(), unit_helper::format_movement_string(), gray_inactive(), gui2::dialogs::mp_lobby::make_game_row_data(), gui2::dialogs::campaign_difficulty::pre_show(), REPORT_GENERATOR(), and gui2::lobby_player_list_helper::update().
const color_t font::GREEN_COLOR {0 , 255, 0 } |
Definition at line 33 of file standard_colors.cpp.
Referenced by unit_helper::format_cost_string(), and unit_helper::format_movement_string().
const color_t font::inactive_ability_color {146, 146, 146} |
Definition at line 45 of file standard_colors.cpp.
Referenced by unit_abilities().
const color_t font::INACTIVE_COLOR {150, 150, 150} |
Definition at line 35 of file standard_colors.cpp.
Referenced by unit_helper::format_level_string(), and unit_helper::maybe_inactive().
const color_t font::inactive_details_color { 86, 86, 86} |
Definition at line 44 of file standard_colors.cpp.
Referenced by attack_info(), and attack_type::weapon_specials().
|
staticconstexpr |
Definition at line 674 of file text.cpp.
Referenced by from_cairo_format().
const color_t font::LABEL_COLOR {107, 140, 255} |
Definition at line 31 of file standard_colors.cpp.
Referenced by game_lua_kernel::intf_float_label(), game_lua_kernel::intf_set_floating_label(), events::menu_handler::label_terrain(), terrain_label::read(), and terrain_label::recalculate().
const color_t font::LOBBY_COLOR {187, 187, 187} |
Definition at line 23 of file standard_colors.cpp.
const std::size_t font::max_text_line_width = 4096 |
Definition at line 36 of file constants.cpp.
const std::string font::nbsp = " " |
Definition at line 40 of file constants.cpp.
Referenced by help::unit_topic_generator::operator()().
const color_t font::NORMAL_COLOR {221, 221, 221} |
Definition at line 21 of file standard_colors.cpp.
Referenced by gui2::addon_list::colorize_addon_state_string(), location_palette_item::draw_contents(), wb::move::draw_hex(), display::draw_hex(), display::draw_label(), game_display::draw_movement_info(), display::draw_report(), playmp_controller::play_human_turn(), string_to_color(), play_controller::hotkey_handler::toggle_accelerated_speed(), editor::mouse_action_map_label::up_left(), display::update_fps_label(), and playsingle_controller::hotkey_handler::whiteboard_toggle().
const color_t font::PETRIFIED_COLOR {160, 160, 160} |
Definition at line 29 of file standard_colors.cpp.
const color_t font::race_color {166, 146, 117} |
Definition at line 47 of file standard_colors.cpp.
const int font::SIZE_15 = 15 * (SIZE_NORMAL / 17) |
Definition at line 28 of file constants.cpp.
Referenced by display_chat_manager::add_chat_message().
const int font::SIZE_BUTTON = 16 * (SIZE_NORMAL / 17) |
Definition at line 25 of file constants.cpp.
const int font::SIZE_BUTTON_SMALL = 14 * (SIZE_NORMAL / 17) |
Definition at line 26 of file constants.cpp.
Referenced by display::create_buttons().
const int font::SIZE_FLOAT_LABEL = 24 * (SIZE_NORMAL / 17) |
Definition at line 32 of file constants.cpp.
Referenced by display::announce(), and game_display::float_label().
const int font::SIZE_LARGE = 20 * (SIZE_NORMAL / 17) |
Definition at line 30 of file constants.cpp.
Referenced by editor::editor_display::set_help_string().
const int font::SIZE_NORMAL = 17 |
Definition at line 20 of file constants.cpp.
Referenced by terrain_label::recalculate(), relative_size(), and gui::floating_textbox::show().
const int font::SIZE_PLUS = 18 * (SIZE_NORMAL / 17) |
Definition at line 29 of file constants.cpp.
Referenced by display::set_diagnostic().
const int font::SIZE_SMALL = 15 * (SIZE_NORMAL / 17) |
Definition at line 24 of file constants.cpp.
Referenced by gui2::dialogs::attack_predictions::draw_hp_graph(), game_lua_kernel::intf_set_floating_label(), and editor::editor_display::set_status().
const int font::SIZE_TINY = 13 * (SIZE_NORMAL / 17) |
Definition at line 23 of file constants.cpp.
Referenced by display::draw_hex().
const int font::SIZE_TITLE = 22 * (SIZE_NORMAL / 17) |
Definition at line 31 of file constants.cpp.
Referenced by gui2::rich_label::get_parsed_text().
const int font::SIZE_XLARGE = 36 * (SIZE_NORMAL / 17) |
Definition at line 33 of file constants.cpp.
const color_t font::TITLE_COLOR {186, 172, 125} |
Definition at line 30 of file standard_colors.cpp.
Referenced by gui2::dialogs::mp_lobby::adjust_game_row_contents().
const std::string font::unicode_bullet = "•" |
Definition at line 47 of file constants.cpp.
Referenced by attack_info(), play_controller::check_next_scenario_is_known(), addons_client::do_resolve_addon_dependencies(), gui2::dialogs::game_load::evaluate_summary_string(), help::generate_ability_topics(), help::generate_contents_links(), help::generate_era_topics(), help::generate_faction_topics(), help::generate_unit_topics(), help::generate_weapon_special_topics(), gui2::get_hp_tooltip(), gui2::get_mp_tooltip(), mp::initial_level_config(), gui2::password_box::insert_char(), editor::context_manager::modified_maps(), help::terrain_topic_generator::operator()(), help::unit_topic_generator::operator()(), gui2::password_box::set_value(), unit_type(), and gui2::dialogs::mp_match_history::update_display().
const std::string font::unicode_em_dash = "—" |
Definition at line 44 of file constants.cpp.
Referenced by gui2::dialogs::statistics_dialog::add_stat_row(), gui2::dialogs::format_addon_time(), mp::game_info::game_info(), gui2::dialogs::faction_select::on_faction_select(), gui2::dialogs::addon_manager::pre_show(), gui2::dialogs::game_version::pre_show(), gui2::dialogs::mp_join_game::pre_show(), gui2::dialogs::mp_staging::pre_show(), gui2::dialogs::screenshot_notification::pre_show(), gui2::dialogs::unit_attack::pre_show(), editor::terrain_palette::setup_item(), gui2::dialogs::tally(), gui2::dialogs::mp_create_game::update_details(), and gui2::dialogs::mp_staging::update_leader_display().
const std::string font::unicode_en_dash = "–" |
Definition at line 43 of file constants.cpp.
Referenced by gui2::dialogs::units_dialog::build_recall_dialog(), gui2::dialogs::units_dialog::build_unit_list_dialog(), gui2::unit_preview_pane::set_display_data(), unit_weapons(), and unit_xp().
const std::string font::unicode_figure_dash = "‒" |
Definition at line 45 of file constants.cpp.
Referenced by help::format_mp_entry(), gui2::get_mp_tooltip(), help::unit_topic_generator::operator()(), and unit_moves().
const std::string font::unicode_minus = "-" |
Definition at line 42 of file constants.cpp.
Referenced by wb::recall::draw_hex(), wb::recruit::draw_hex(), utils::half_signed_value(), help::unit_topic_generator::operator()(), utils::print_modifier(), REPORT_GENERATOR(), utils::si_string(), and utils::signed_value().
const std::string font::unicode_multiplication_sign = "×" |
Definition at line 46 of file constants.cpp.
Referenced by mp::game_info::game_info(), ng::scenario::map_size(), gui2::dialogs::attack_predictions::set_data(), and gui2::dialogs::preferences_dialog::set_resolution_list().
const color_t font::unit_type_color {245, 230, 193} |
Definition at line 46 of file standard_colors.cpp.
Referenced by gui2::unit_preview_pane::print_attack_details(), and gui2::unit_preview_pane::set_display_data().
const color_t font::weapon_color {245, 230, 193} |
Definition at line 40 of file standard_colors.cpp.
Referenced by attack_info(), gui2::dialogs::attack_predictions::set_data(), unit_alignment(), and unit_weapons().
const color_t font::weapon_details_color {196, 176, 147} |
Definition at line 43 of file standard_colors.cpp.
Referenced by attack_info(), gui2::addon_list::colorize_addon_state_string(), gui2::unit_preview_pane::print_attack_details(), and unit_weapons().
const std::string font::weapon_details_sep = "–" |
Definition at line 50 of file constants.cpp.
Referenced by attack_info(), and gui2::unit_preview_pane::print_attack_details().
const std::string font::weapon_numbers_sep = "×" |
Definition at line 49 of file constants.cpp.
Referenced by attack_info(), help::unit_topic_generator::operator()(), gui2::dialogs::unit_attack::pre_show(), gui2::unit_preview_pane::print_attack_details(), gui2::dialogs::attack_predictions::set_data(), and unit_weapons().
const color_t font::YELLOW_COLOR {255, 255, 0 } |
Definition at line 27 of file standard_colors.cpp.
Referenced by gui2::addon_list::colorize_addon_state_string(), unit_helper::format_movement_string(), gui2::dialogs::mp_lobby::make_game_row_data(), display::set_diagnostic(), string_to_color(), and gui::floating_textbox::update_location().