The Battle for Wesnoth  1.15.0-dev
Classes | Typedefs | Enumerations | Functions | Variables
font Namespace Reference

Note: Specific to sdl_ttf. More...

Classes

struct  char_block_map
 
struct  error
 
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  font_id
 
struct  inverse_table
 
struct  manager
 
class  p_font
 Small helper class to make sure the pango font object is destroyed properly. More...
 
class  pango_text
 Text class. More...
 
struct  sdl_ttf
 
struct  subset_descriptor
 
class  text_cache
 
struct  text_chunk
 
class  text_surface
 
struct  ttf_record
 

Typedefs

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

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...
 
enum  CACHE { CACHE_LOBBY, CACHE_GAME }
 

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)
 
int relative_size (int size)
 
bool check_font_file (std::string name)
 Test if a font file exists. More...
 
bool load_font_config ()
 
const t_stringget_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::const_iterator parse_markup (std::string::const_iterator i1, std::string::const_iterator i2, int *font_size, color_t *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...
 
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 color_t &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 color_t &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 char32_t ch)
 Determine if a char32_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...
 
std::string escape_text (const std::string &text)
 Escapes the pango markup characters in a text. More...
 
std::string semi_escape_text (const std::string &text)
 
bool looks_like_url (utils::string_view str)
 
std::string format_as_link (const std::string &link, color_t color)
 
std::ostream & operator<< (std::ostream &s, const PangoRectangle &rect)
 
static TTF_Font * open_font_impl (const std::string &, int)
 
static TTF_Font * open_font (const std::string &fname, int size)
 
static surface render_text (const std::string &text, int fontsize, const color_t &color, int style, bool use_markup)
 
surface get_rendered_text (const std::string &str, int size, const color_t &color, int style)
 
SDL_Rect 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 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...
 
void cache_mode (CACHE mode)
 
static void clear_fonts ()
 
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_textget_text_renderer ()
 Returns a reference to a static pango_text object. More...
 
std::string span_color (const color_t &color)
 Returns a Pango formatting string using the provided color_t object. More...
 
std::string get_pango_color_from_id (const std::string &id)
 Returns a hex color string from a color range. More...
 
std::string get_color_string_pango (const std::string &id)
 Returns the name of a color range, colored with its own color. More...
 

Variables

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 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 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 ='&'
 
static std::map< font_id, ttf_recordfont_table
 
static std::vector< std::string > font_names
 
static std::vector< std::string > bold_names
 
static std::vector< std::string > italic_names
 
static char_block_map char_blocks
 
static std::map< int, std::map< int, line_size_cache_map > > line_size_cache
 
open_font_cache open_fonts
 
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 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 {166, 146, 117}
 
const color_t inactive_details_color {146, 146, 146}
 
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 const inverse_table inverse_table_
 

Detailed Description

Note: Specific to sdl_ttf.

Graphical text output.

Collection of helper functions relating to Pango formatting.

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.

Typedef Documentation

◆ line_size_cache_map

typedef std::map<std::string,SDL_Rect> font::line_size_cache_map

Definition at line 135 of file sdl_ttf.cpp.

◆ open_font_cache

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

Definition at line 140 of file sdl_ttf.cpp.

◆ subset_id

typedef int font::subset_id

Definition at line 33 of file font_id.hpp.

Enumeration Type Documentation

◆ ALIGN

Enumerator
LEFT_ALIGN 
CENTER_ALIGN 
RIGHT_ALIGN 

Definition at line 31 of file floating_label.hpp.

◆ CACHE

Enumerator
CACHE_LOBBY 
CACHE_GAME 

Definition at line 59 of file sdl_ttf.hpp.

◆ family_class

Font classes for get_font_families().

Enumerator
FONT_SANS_SERIF 
FONT_MONOSPACE 
FONT_LIGHT 
FONT_SCRIPT 

Definition at line 25 of file font_options.hpp.

◆ LABEL_SCROLL_MODE

Enumerator
ANCHOR_LABEL_SCREEN 
ANCHOR_LABEL_MAP 

Definition at line 33 of file floating_label.hpp.

Function Documentation

◆ add_floating_label()

int font::add_floating_label ( const floating_label flabel)

◆ cache_mode()

void font::cache_mode ( CACHE  mode)

Definition at line 469 of file sdl_ttf.cpp.

References CACHE_LOBBY, and font::text_cache::resize().

◆ check_font_file()

bool font::check_font_file ( std::string  name)

Test if a font file exists.

Definition at line 63 of file font_config.cpp.

References filesystem::ends_with(), filesystem::file_exists(), config::find_child(), name(), game_config::path, and WRN_FT.

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

◆ clear_fonts()

static void font::clear_fonts ( )
static

Definition at line 492 of file sdl_ttf.cpp.

References font::char_block_map::cbmap, and i.

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

◆ cut_word()

static void font::cut_word ( std::string &  line,
std::string &  word,
int  font_size,
int  style,
int  max_width 
)
static

◆ del_tags()

std::string font::del_tags ( const std::string &  text)

Copy string, but without tags at the beginning.

Definition at line 136 of file marked-up_text.cpp.

References utils::join(), parse_markup(), and utils::split().

Referenced by gui::menu::basic_sorter::less().

◆ draw_floating_labels()

void font::draw_floating_labels ( surface  screen)

Definition at line 284 of file floating_label.cpp.

References i.

Referenced by gui2::window::draw(), and display::flip().

◆ draw_text() [1/2]

SDL_Rect font::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,
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:

  • any line beginning in # will be displayed in BAD_COLOR (red)
  • any line beginning in @ will be displayed in GOOD_COLOR (green)
  • any line beginning in + will be displayed with size increased by 2
  • any line beginning in - will be displayed with size decreased by 2
  • any line beginning with 0x0n will be displayed in the color of side n

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 153 of file marked-up_text.cpp.

References draw_text_line(), gui2::event::find(), parse_markup(), utf8::size(), and utils::unescape().

Referenced by gui::button::calculate_size(), location_palette_item::draw_contents(), gui::button::draw_contents(), draw_label(), gui::menu::draw_row(), draw_text(), gui::dialog_frame::draw_title(), gui::menu::style::item_size(), and text_area().

◆ draw_text() [2/2]

SDL_Rect font::draw_text ( CVideo gui,
const SDL_Rect &  area,
int  size,
const color_t 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 200 of file marked-up_text.cpp.

References draw_text(), CVideo::getSurface(), and utf8::size().

◆ draw_text_line()

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 
)

◆ escape_text()

std::string font::escape_text ( const std::string &  text)
inline

◆ format_as_link()

std::string font::format_as_link ( const std::string &  link,
color_t  color 
)
inline

Definition at line 31 of file hyperlink.hpp.

References color_t::to_hex_string().

Referenced by font::pango_text::format_links().

◆ from_cairo_format()

static void font::from_cairo_format ( uint32_t &  c)
static

Converts from cairo-format ARGB32 premultiplied alpha to plain alpha.

Parameters
ca uint32 representing the color

Definition at line 604 of file text.cpp.

References a, b, g, and unpremultiply().

Referenced by font::pango_text::rerender().

◆ get_color_string_pango()

std::string font::get_color_string_pango ( const std::string &  id)

Returns the name of a color range, colored with its own color.

Parameters
idThe id of the color range.

Definition at line 40 of file text_formatting.cpp.

References _(), get_pango_color_from_id(), name(), and game_config::team_rgb_name.

Referenced by gui2::dialogs::mp_staging::add_side_node().

◆ get_floating_label_rect()

SDL_Rect font::get_floating_label_rect ( int  handle)

◆ get_font_families()

const t_string & font::get_font_families ( family_class  fclass = FONT_SANS_SERIF)

Returns the currently defined fonts.

Definition at line 201 of file font_config.cpp.

References FONT_LIGHT, FONT_MONOSPACE, and FONT_SCRIPT.

Referenced by font::pango_text::calculate_size().

◆ get_max_height()

int font::get_max_height ( int  size)

◆ get_pango_color_from_id()

std::string font::get_pango_color_from_id ( const std::string &  id)

Returns a hex color string from a color range.

Parameters
idThe id of the color range.

Definition at line 30 of file text_formatting.cpp.

References game_config::team_rgb_colors.

Referenced by gui2::dialogs::mp_join_game::generate_side_list(), and get_color_string_pango().

◆ get_rendered_text()

surface font::get_rendered_text ( const std::string &  str,
int  size,
const color_t color,
int  style 
)

◆ get_text_renderer()

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 865 of file text.cpp.

Referenced by gui2::text_shape::draw(), and font::pango_text::is_surface_split().

◆ is_cjk_char()

bool font::is_cjk_char ( const char32_t  ch)

Determine if a char32_t is a CJK character.

Return values
trueInput-char is a CJK char
falseInput-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 227 of file marked-up_text.cpp.

Referenced by cut_word(), and help::get_first_word().

◆ is_format_char()

bool font::is_format_char ( char  c)

Determine if char is one of the special chars used as markup.

Return values
trueInput-char is a markup-char.
falseInput-char is a normal char.

Definition at line 209 of file marked-up_text.cpp.

References BAD_TEXT, BLACK_TEXT, BOLD_TEXT, GOOD_TEXT, GRAY_TEXT, LARGE_TEXT, NORMAL_TEXT, NULL_MARKUP, and SMALL_TEXT.

Referenced by word_wrap_text().

◆ line_size()

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 421 of file sdl_ttf.cpp.

References gui2::cache, gui::font_size, font::text_surface::height(), i, s, font::ttf_record::style, and font::text_surface::width().

Referenced by cut_word(), line_width(), and word_wrap_text().

◆ line_width()

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 416 of file sdl_ttf.cpp.

References line_size().

Referenced by help::help_text_area::add_text_item(), gui::textbox::add_text_line(), draw_text_line(), 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().

◆ load_font_config()

bool font::load_font_config ( )

◆ looks_like_url()

bool font::looks_like_url ( utils::string_view  str)
inline

◆ make_text_ellipsis()

std::string font::make_text_ellipsis ( const std::string &  text,
int  font_size,
int  max_width,
int  style 
)

◆ move_floating_label()

void font::move_floating_label ( int  handle,
double  xmove,
double  ymove 
)

moves the floating label given by 'handle' by (xmove,ymove)

Definition at line 217 of file floating_label.cpp.

References i.

Referenced by display_chat_manager::prune_chat_messages(), CVideo::set_help_string(), and show_tooltip().

◆ open_font()

static TTF_Font* font::open_font ( const std::string &  fname,
int  size 
)
static

Definition at line 148 of file sdl_ttf.cpp.

References open_font_impl().

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

◆ open_font_impl()

static TTF_Font * font::open_font_impl ( const std::string &  fname,
int  size 
)
static

◆ operator<<()

std::ostream& font::operator<< ( std::ostream &  s,
const PangoRectangle &  rect 
)
inline

Definition at line 22 of file stream_ops.hpp.

References s.

◆ parse_markup()

std::string::const_iterator font::parse_markup ( std::string::const_iterator  i1,
std::string::const_iterator  i2,
int *  font_size,
color_t color,
int *  style 
)

◆ relative_size()

int font::relative_size ( int  size)
inline

◆ remove_floating_label()

void font::remove_floating_label ( int  handle)

◆ render_text()

static surface font::render_text ( const std::string &  text,
int  fontsize,
const color_t color,
int  style,
bool  use_markup 
)
static

◆ scroll_floating_labels()

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 225 of file floating_label.cpp.

References ANCHOR_LABEL_MAP, and i.

Referenced by display::scroll().

◆ semi_escape_text()

std::string font::semi_escape_text ( const std::string &  text)
inline

Definition at line 51 of file escape.hpp.

References c.

Referenced by font::pango_text::validate_markup().

◆ show_floating_label()

void font::show_floating_label ( int  handle,
bool  value 
)

hides or shows a floating label

Definition at line 246 of file floating_label.cpp.

References i.

Referenced by terrain_label::calculate_shroud().

◆ span_color()

std::string font::span_color ( const color_t color)

◆ str_to_family_class()

family_class font::str_to_family_class ( const std::string &  str)
inline

Definition at line 33 of file font_options.hpp.

References FONT_LIGHT, FONT_MONOSPACE, FONT_SANS_SERIF, and FONT_SCRIPT.

◆ text_area()

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 147 of file marked-up_text.cpp.

References draw_text(), and NORMAL_COLOR.

Referenced by gui::menu::draw_row().

◆ undraw_floating_labels()

void font::undraw_floating_labels ( surface  screen)

Definition at line 301 of file floating_label.cpp.

References i.

Referenced by display::flip(), and gui2::window::show().

◆ unpremultiply()

static void font::unpremultiply ( uint8_t &  value,
const unsigned  div 
)
static

Definition at line 588 of file text.cpp.

Referenced by from_cairo_format().

◆ word_wrap_text()

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 
)

Variable Documentation

◆ BAD_COLOR

const color_t font::BAD_COLOR {255, 0 , 0 }

◆ bad_dmg_color

const color_t font::bad_dmg_color {250, 140, 80 }

◆ BAD_TEXT

const char font::BAD_TEXT ='#'

Definition at line 44 of file marked-up_text.cpp.

Referenced by is_format_char(), and parse_markup().

◆ BIGMAP_COLOR

const color_t font::BIGMAP_COLOR {255, 255, 255}

Definition at line 31 of file standard_colors.cpp.

Referenced by help::string_to_color().

◆ BLACK_COLOR

const color_t font::BLACK_COLOR {0 , 0 , 0 }

◆ BLACK_TEXT

const char font::BLACK_TEXT ='}'

Definition at line 43 of file marked-up_text.cpp.

Referenced by is_format_char(), and parse_markup().

◆ bold_names

std::vector<std::string> font::bold_names
static

Definition at line 64 of file sdl_ttf.cpp.

◆ BOLD_TEXT

const char font::BOLD_TEXT ='~'

Definition at line 41 of file marked-up_text.cpp.

Referenced by is_format_char(), and parse_markup().

◆ BUTTON_COLOR

const color_t font::BUTTON_COLOR {186, 172, 125}

Definition at line 27 of file standard_colors.cpp.

Referenced by gui::button::calculate_size(), and gui::button::draw_contents().

◆ char_blocks

char_block_map font::char_blocks
static

Definition at line 132 of file sdl_ttf.cpp.

◆ COLOR_TEXT

const char font::COLOR_TEXT ='<'

Definition at line 46 of file marked-up_text.cpp.

Referenced by parse_markup().

◆ DISABLED_COLOR

const color_t font::DISABLED_COLOR = PETRIFIED_COLOR.inverse()

Definition at line 33 of file standard_colors.cpp.

◆ ellipsis

const std::string font::ellipsis = "..."

Definition at line 35 of file constants.cpp.

Referenced by utils::ellipsis_truncate(), make_text_ellipsis(), and relative_size().

◆ font_names

std::vector<std::string> font::font_names
static

Definition at line 63 of file sdl_ttf.cpp.

◆ font_table

std::map<font_id, ttf_record> font::font_table
static

Definition at line 62 of file sdl_ttf.cpp.

◆ GOOD_COLOR

const color_t font::GOOD_COLOR {0 , 181, 26 }

◆ good_dmg_color

const color_t font::good_dmg_color {130, 240, 50 }

◆ GOOD_TEXT

const char font::GOOD_TEXT ='@'

Definition at line 44 of file marked-up_text.cpp.

Referenced by is_format_char(), and parse_markup().

◆ GRAY_COLOR

const color_t font::GRAY_COLOR {136, 136, 136}

◆ GRAY_TEXT

const char font::GRAY_TEXT ='|'

Definition at line 43 of file marked-up_text.cpp.

Referenced by is_format_char(), and parse_markup().

◆ GREEN_TEXT

const char font::GREEN_TEXT ='@'

Definition at line 45 of file marked-up_text.cpp.

◆ IMAGE

const char font::IMAGE ='&'

Definition at line 46 of file marked-up_text.cpp.

◆ inactive_ability_color

const color_t font::inactive_ability_color {146, 146, 146}

Definition at line 41 of file standard_colors.cpp.

Referenced by unit_abilities().

◆ inactive_details_color

const color_t font::inactive_details_color {146, 146, 146}

Definition at line 40 of file standard_colors.cpp.

Referenced by attack_info(), and attack_type::weapon_specials().

◆ inverse_table_

const inverse_table font::inverse_table_
static

Definition at line 582 of file text.cpp.

◆ italic_names

std::vector<std::string> font::italic_names
static

Definition at line 65 of file sdl_ttf.cpp.

◆ LABEL_COLOR

const color_t font::LABEL_COLOR {107, 140, 255}

◆ LARGE_TEXT

const char font::LARGE_TEXT ='*'

Standard markups for color, size, font, images.

Definition at line 40 of file marked-up_text.cpp.

Referenced by is_format_char(), and parse_markup().

◆ line_size_cache

std::map<int,std::map<int,line_size_cache_map> > font::line_size_cache
static

Definition at line 138 of file sdl_ttf.cpp.

◆ LOBBY_COLOR

const color_t font::LOBBY_COLOR {187, 187, 187}

Definition at line 22 of file standard_colors.cpp.

◆ max_text_line_width

const std::size_t font::max_text_line_width = 4096

Definition at line 32 of file constants.cpp.

Referenced by font::text_surface::get_surfaces(), and relative_size().

◆ nbsp

const std::string font::nbsp = " "

Definition at line 36 of file constants.cpp.

Referenced by help::unit_topic_generator::operator()(), and relative_size().

◆ NORMAL_COLOR

const color_t font::NORMAL_COLOR {221, 221, 221}

◆ NORMAL_TEXT

const char font::NORMAL_TEXT ='{'

Definition at line 41 of file marked-up_text.cpp.

Referenced by is_format_char(), and parse_markup().

◆ NULL_MARKUP

const char font::NULL_MARKUP ='^'

Definition at line 42 of file marked-up_text.cpp.

Referenced by is_format_char(), and parse_markup().

◆ open_fonts

open_font_cache font::open_fonts

Definition at line 141 of file sdl_ttf.cpp.

◆ PETRIFIED_COLOR

const color_t font::PETRIFIED_COLOR {160, 160, 160}

Definition at line 28 of file standard_colors.cpp.

◆ race_color

const color_t font::race_color {166, 146, 117}

Definition at line 43 of file standard_colors.cpp.

◆ RED_TEXT

const char font::RED_TEXT ='#'

Definition at line 45 of file marked-up_text.cpp.

◆ SIZE_15

const int font::SIZE_15 = 15 * SIZE_NORMAL / 14

Definition at line 25 of file constants.cpp.

Referenced by display_chat_manager::add_chat_message().

◆ SIZE_LARGE

const int font::SIZE_LARGE = 18 * SIZE_NORMAL / 14

Definition at line 27 of file constants.cpp.

Referenced by CVideo::set_help_string().

◆ SIZE_NORMAL

const int font::SIZE_NORMAL = 14

Definition at line 19 of file constants.cpp.

Referenced by terrain_label::draw().

◆ SIZE_PLUS

const int font::SIZE_PLUS = 16 * SIZE_NORMAL / 14

Definition at line 26 of file constants.cpp.

Referenced by display::set_diagnostic(), and gui::floating_textbox::show().

◆ SIZE_SMALL

const int font::SIZE_SMALL = 12 * SIZE_NORMAL / 14

◆ SIZE_TINY

const int font::SIZE_TINY = 10 * SIZE_NORMAL / 14

Definition at line 22 of file constants.cpp.

◆ SIZE_TITLE

const int font::SIZE_TITLE = 20 * SIZE_NORMAL / 14

Definition at line 28 of file constants.cpp.

Referenced by gui::dialog_frame::draw_title(), and gui::dialog_frame::top_padding().

◆ SIZE_XLARGE

const int font::SIZE_XLARGE = 24 * SIZE_NORMAL / 14

Definition at line 29 of file constants.cpp.

Referenced by display::announce(), and game_display::float_label().

◆ SMALL_TEXT

const char font::SMALL_TEXT ='`'

Definition at line 40 of file marked-up_text.cpp.

Referenced by is_format_char(), and parse_markup().

◆ TITLE_COLOR

const color_t font::TITLE_COLOR {186, 172, 125}

◆ unicode_bullet

const std::string font::unicode_bullet = "•"

◆ unicode_em_dash

const std::string font::unicode_em_dash = "—"

◆ unicode_en_dash

const std::string font::unicode_en_dash = "–"

◆ unicode_figure_dash

const std::string font::unicode_figure_dash = "‒"

◆ unicode_minus

const std::string font::unicode_minus = "-"

◆ unicode_multiplication_sign

const std::string font::unicode_multiplication_sign = "×"

◆ unit_type_color

const color_t font::unit_type_color {245, 230, 193}

◆ weapon_color

const color_t font::weapon_color {245, 230, 193}

◆ weapon_details_color

const color_t font::weapon_details_color {166, 146, 117}

◆ weapon_details_sep

const std::string font::weapon_details_sep = "–"

◆ weapon_numbers_sep

const std::string font::weapon_numbers_sep = "×"

◆ YELLOW_COLOR

const color_t font::YELLOW_COLOR {255, 255, 0 }