Freeciv-3.2
|
#include <SDL3/SDL.h>
#include "fcintl.h"
#include "log.h"
#include "mem.h"
#include "colors.h"
#include "graphics.h"
#include "gui_main.h"
#include "themespec.h"
#include "utf8string.h"
#include "gui_string.h"
Go to the source code of this file.
Data Structures | |
struct | ttf_font_chain |
Macros | |
#define | adj_font(size) size |
#define | ptsize_default() adj_font(default_font_size(active_theme)) |
Functions | |
static TTF_Font * | load_font (Uint16 ptsize) |
static SDL_Surface * | create_utf8_surf (utf8_str *pstr) |
static SDL_Surface * | create_utf8_multi_surf (utf8_str *pstr) |
void | utf8_str_size (utf8_str *pstr, SDL_Rect *fill) |
static Uint16 | fonto_ptsize (enum font_origin origin) |
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) |
utf8_str * | copy_chars_to_utf8_str (utf8_str *pstr, const char *pchars) |
int | write_utf8 (SDL_Surface *dest, Sint16 x, Sint16 y, utf8_str *pstr) |
SDL_Surface * | create_text_surf_from_utf8 (utf8_str *pstr) |
bool | convert_utf8_str_to_const_surface_width (utf8_str *pstr, int width) |
SDL_Surface * | create_text_surf_smaller_than_w (utf8_str *pstr, int w) |
void | change_ptsize_utf8 (utf8_str *pstr, Uint16 new_ptsize) |
void | change_fonto_utf8 (utf8_str *pstr, enum font_origin origin) |
void | unload_font (Uint16 ptsize) |
void | free_font_system (void) |
Variables | |
static struct ttf_font_chain * | font_tab = NULL |
static char * | font_with_full_path = NULL |
Definition at line 63 of file gui_string.c.
#define ptsize_default | ( | ) | adj_font(default_font_size(active_theme)) |
Definition at line 66 of file gui_string.c.
void change_fonto_utf8 | ( | utf8_str * | pstr, |
enum font_origin | origin | ||
) |
Change font size of text to that from given origin.
Definition at line 585 of file gui_string.c.
Change font size of text.
Definition at line 560 of file gui_string.c.
Wrap text to make it fit to given screen width.
Definition at line 450 of file gui_string.c.
Convert char array to utf8_str. Pointer to target string is needed as parameter, but also returned for convenience.
Definition at line 249 of file gui_string.c.
SDL_Surface * create_text_surf_from_utf8 | ( | utf8_str * | pstr | ) |
Generic function to create surface with any kind of text, single line or multiline, drawn.
Definition at line 426 of file gui_string.c.
SDL_Surface * create_text_surf_smaller_than_w | ( | utf8_str * | pstr, |
int | w | ||
) |
Create surface with text drawn to it. Wrap text as needed to make it fit in given width.
Definition at line 540 of file gui_string.c.
|
static |
Create surface with multiline text drawn.
Definition at line 343 of file gui_string.c.
Create utf8_str struct with ptsize font. If ptsize is zero, use theme's default font size.
Font will be loaded or aliased with existing font of that size. in_text must be allocated in memory (fc_malloc() / fc_calloc())
Definition at line 204 of file gui_string.c.
utf8_str * create_utf8_str_fonto | ( | char * | in_text, |
size_t | n_alloc, | ||
enum font_origin | origin | ||
) |
Create utf8_str struct with font size from given origin.
Font will be loaded or aliased with existing font of that size. in_text must be allocated in memory (fc_malloc() / fc_calloc())
Definition at line 239 of file gui_string.c.
|
static |
Create Text Surface from utf8_str
Definition at line 296 of file gui_string.c.
|
static |
Convert font_origin to ptsize value
Definition at line 166 of file gui_string.c.
Free all fonts.
Definition at line 699 of file gui_string.c.
Load font of given pointsize.
Definition at line 595 of file gui_string.c.
Free font of given pointsize.
Definition at line 654 of file gui_string.c.
Adjust font sizes for small screen. Calculate display size of string.
Definition at line 102 of file gui_string.c.
int write_utf8 | ( | SDL_Surface * | dest, |
Sint16 | x, | ||
Sint16 | y, | ||
utf8_str * | pstr | ||
) |
Blit text to surface.
Definition at line 274 of file gui_string.c.
|
static |
Definition at line 52 of file gui_string.c.