27#ifdef SDL2_PLAIN_INCLUDE
67 #define adj_font(size) size
70#define ptsize_default() adj_font(default_font_size(active_theme))
109 char *current =
pstr->text;
140 log_error(
"TTF_SizeUTF8() return ERROR!");
149 log_error(
"TTF_SizeUTF8() return ERROR!");
217 log_error(
"create_utf8_str(): load_font() failed");
260 if (
n >
pstr->n_alloc) {
262 size_t n1 = (3 *
pstr->n_alloc) / 2;
283 log_error(
"write_utf8(): couldn't blit text to display: %s",
310 switch (
pstr->render) {
325 log_debug(
"create_utf8_surf: Font is generally %d big, and "
327 log_debug(
"create_utf8_surf: String is %d length", text->w);
329 log_debug(
"create_utf8_surf: text NULL");
376 switch (
pstr->render) {
428 char *current =
pstr->text;
429 char c = *(
pstr->text);
484 for (
i = 1;
i < 8 && (ptr[
i] & (128 + 64)) == 128;
i++) {
520 if (
pstr->ptsize > 8) {
524 log_error(
"Can't convert string to const width");
572 log_error(
"change_ptsize: load_font() failed");
622 log_error(
"load_font: Couldn't load %d pt font from %s: %s",
659 log_error(
"unload_font: Trying unload from empty Font ARRAY");
672 log_error(
"unload_font: Trying unload Font which is "
673 "not included in Font ARRAY");
struct canvas int int struct sprite int int int width
SDL_Color * get_theme_color(enum theme_color themecolor)
SDL_Surface * create_surf_with_format(SDL_PixelFormat *pf, int width, int height, Uint32 flags)
int alphablit(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect, unsigned char alpha_mod)
SDL_Surface * create_surf(int width, int height, Uint32 flags)
static TTF_Font * load_font(Uint16 ptsize)
void change_ptsize_utf8(utf8_str *pstr, Uint16 new_ptsize)
void utf8_str_size(utf8_str *pstr, SDL_Rect *fill)
utf8_str * copy_chars_to_utf8_str(utf8_str *pstr, const char *pchars)
SDL_Surface * create_text_surf_from_utf8(utf8_str *pstr)
void change_fonto_utf8(utf8_str *pstr, enum font_origin origin)
static char * font_with_full_path
void unload_font(Uint16 ptsize)
utf8_str * create_utf8_str(char *in_text, size_t n_alloc, Uint16 ptsize)
utf8_str * create_utf8_str_fonto(char *in_text, size_t n_alloc, enum font_origin origin)
static struct ttf_font_chain * font_tab
int write_utf8(SDL_Surface *dest, Sint16 x, Sint16 y, utf8_str *pstr)
static SDL_Surface * create_utf8_multi_surf(utf8_str *pstr)
bool convert_utf8_str_to_const_surface_width(utf8_str *pstr, int width)
static SDL_Surface * create_utf8_surf(utf8_str *pstr)
void free_font_system(void)
SDL_Surface * create_text_surf_smaller_than_w(utf8_str *pstr, int w)
static Uint16 fonto_ptsize(enum font_origin origin)
const char * theme_font_filename(const struct theme *t)
struct theme * active_theme
char ** create_new_line_utf8strs(const char *pstr)
#define fc_assert_ret_val(condition, val)
#define log_debug(message,...)
#define log_error(message,...)
#define fc_calloc(n, esz)
#define fc_realloc(ptr, sz)
struct ttf_font_chain * next
int fc_snprintf(char *str, size_t n, const char *format,...)