22 #ifndef AGS_SHARED_FONT_FONTS_H 23 #define AGS_SHARED_FONT_FONTS_H 25 #include "common/std/vector.h" 26 #include "ags/shared/ac/game_struct_defines.h" 27 #include "ags/shared/util/string.h" 28 #include "ags/shared/ac/game_struct_defines.h" 29 #include "ags/shared/font/ags_font_renderer.h" 30 #include "ags/shared/gfx/allegro_bitmap.h" 34 class IAGSFontRenderer;
35 class IAGSFontRenderer2;
36 class IAGSFontRendererInternal;
38 struct FontRenderParams;
54 int LineSpacingCalc = 0;
57 Bitmap TextStencil, TextStencilSub;
58 Bitmap OutlineStencil, OutlineStencilSub;
68 void init_font_renderer();
69 void shutdown_font_renderer();
70 void adjust_y_coordinate_for_text(
int *ypos,
size_t fontnum);
73 void font_recalc_metrics(
size_t fontNumber);
74 bool font_first_renderer_loaded();
75 bool is_font_loaded(
size_t fontNumber);
76 bool is_bitmap_font(
size_t fontNumber);
77 bool font_supports_extended_characters(
size_t fontNumber);
79 const char *get_font_name(
size_t fontNumber);
81 int get_font_flags(
size_t fontNumber);
88 void ensure_text_valid_for_font(
char *text,
size_t fontnum);
90 int get_font_scaling_mul(
size_t fontNumber);
92 int get_text_width(
const char *texx,
size_t fontNumber);
94 int get_text_width_outlined(
const char *text,
size_t font_number);
98 int get_font_height(
size_t fontNumber);
100 int get_font_height_outlined(
size_t fontNumber);
103 int get_font_surface_height(
size_t fontNumber);
109 int get_font_linespacing(
size_t fontNumber);
111 void set_font_linespacing(
size_t fontNumber,
int spacing);
113 int get_font_outline(
size_t font_number);
115 int get_font_outline_thickness(
size_t font_number);
118 int get_text_lines_height(
size_t fontNumber,
size_t numlines);
121 int get_text_lines_surf_height(
size_t fontNumber,
size_t numlines);
123 void set_font_outline(
size_t font_number,
int outline_type,
124 enum FontInfo::AutoOutlineStyle style = FontInfo::kSquared,
int thickness = 1);
125 bool is_font_antialiased(
size_t font_number);
127 void wouttextxy(
Shared::Bitmap *ds,
int xxx,
int yyy,
size_t fontNumber, color_t text_color,
const char *texx);
129 void set_fontinfo(
size_t fontNumber,
const FontInfo &finfo);
131 FontInfo get_fontinfo(
size_t font_number);
133 bool load_font_size(
size_t fontNumber,
const FontInfo &font_info);
void wgtprintf(
Shared::Bitmap *ds,
int xxx,
int yyy,
size_t fontNumber, color_t text_color,
char *fmt, ...);
136 void alloc_font_outline_buffers(
size_t font_number,
138 int text_width,
int text_height,
int color_depth);
140 void adjust_fonts_for_render_mode(
bool aa_mode);
142 void wfreefont(
size_t fontNumber);
144 void free_all_fonts();
147 bool ShouldAntiAliasText();
156 inline size_t Count()
const {
165 inline void Clear() {
169 inline void Reset() {
172 inline void Add(
const char *cstr) {
173 if (_pool.size() == _count) _pool.resize(_count + 1);
174 _pool[_count++].SetString(cstr);
187 size_t split_lines(
const char *texx,
SplitLines &lines,
int width,
int fontNumber,
size_t max_lines = -1);
Definition: achievements_tables.h:27
Definition: allegro_bitmap.h:44
Definition: ags_font_renderer.h:107
Definition: ags_font_renderer.h:51
Definition: ags_font_renderer.h:82
Definition: game_struct_defines.h:268
Definition: ags_font_renderer.h:33