17 #ifndef MARKED_UP_TEXT_HPP_INCLUDED
18 #define MARKED_UP_TEXT_HPP_INCLUDED
23 #include <SDL_video.h>
53 std::string::const_iterator
parse_markup(std::string::const_iterator i1,
54 std::string::const_iterator i2,
56 SDL_Color*
color,
int* style);
81 int x,
int y,
bool use_tooltips =
false,
int style = 0);
86 int x,
int y,
bool use_tooltips =
false,
int style = 0);
89 sdl::timage draw_text_to_texture(
const SDL_Rect& area,
int size,
90 const SDL_Color&
color,
92 bool use_tooltips =
false,
int style = 0);
137 int max_width,
int max_height = -1,
int max_lines = -1,
bool partial_line =
false);
152 int x,
int y,
int max_width);
156 #endif // MARKED_UP_TEXT_HPP_INCLUDED
const SDL_Color good_dmg_color
SDL_Rect text_area(const std::string &text, int size, int style)
Calculate the size of a text (in pixels) if it were to be drawn.
const SDL_Color unit_type_color
std::string color2hexa(const SDL_Color &color)
Creates the hexadecimal string of a color, such as "#ffff00" for yellow.
const std::string weapon_details_sep
const char LARGE_TEXT
Standard markups for color, size, font, images.
std::string word_wrap_text(const std::string &unwrapped_text, int font_size, int max_width, int max_height, int max_lines, bool partial_line)
Wrap text.
GLint GLint GLint GLint GLint GLint y
std::string span_color(const SDL_Color &color)
Creates pango markup of a color.
const SDL_Color inactive_details_color
const SDL_Color bad_dmg_color
const SDL_Color race_color
const SDL_Color weapon_details_color
std::string color2markup(const SDL_Color &color)
Create string of color-markup, such as "<255,255,0>" for yellow.
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.
bool is_format_char(char c)
Determine if char is one of the special chars used as markup.
SDL_Rect draw_text(surface &dst, const SDL_Rect &area, int size, const SDL_Color &color, const std::string &txt, int x, int y, bool use_tooltips, int style)
Function to draw text on a surface.
Contains a wrapper class for the GPU_Image class.
const std::string weapon_details
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.
bool is_cjk_char(const ucs4::char_t ch)
Determine if a ucs4::char_t is a CJK character.
GLint GLint GLint GLint GLint x
const SDL_Color weapon_color
const std::string weapon_numbers_sep
std::string del_tags(const std::string &text)
Copy string, but without tags at the beginning.
const SDL_Color inactive_ability_color
const std::string unit_type
GLsizei const GLcharARB ** string