22#ifndef AGS_LIB_ALFONT_H
23#define AGS_LIB_ALFONT_H
25#include "ags/lib/allegro/surface.h"
31#define ALFONT_MAJOR_VERSION 1
32#define ALFONT_MINOR_VERSION 9
33#define ALFONT_SUB_VERSION 1
34#define ALFONT_VERSION_STR "1.9.1"
35#define ALFONT_DATE_STR "24/11/2002"
36#define ALFONT_DATE 20021124
41#define ALFONT_ERROR -1
46#define ALFONT_FLG_FORCE_RESIZE 0x01
48#define ALFONT_FLG_ASCENDER_EQ_HEIGHT 0x02
53#define ALFONT_FLG_SELECT_NOMINAL_SZ 0x04
57#define ALFONT_FLG_PRECALC_MAX_CBOX 0x08
60typedef struct ALFONT_FONT ALFONT_FONT;
63#define ALFONT_DLL_DECLSPEC
65ALFONT_DLL_DECLSPEC
const char *alfont_get_name(ALFONT_FONT *f);
67ALFONT_DLL_DECLSPEC
int alfont_init(
void);
68ALFONT_DLL_DECLSPEC
void alfont_exit(
void);
70ALFONT_DLL_DECLSPEC ALFONT_FONT *alfont_load_font(
const char *filepathname);
71ALFONT_DLL_DECLSPEC ALFONT_FONT *alfont_load_font_from_mem(
const char *data,
int data_len);
72ALFONT_DLL_DECLSPEC
void alfont_destroy_font(ALFONT_FONT *f);
74ALFONT_DLL_DECLSPEC
int alfont_set_font_size(ALFONT_FONT *f,
int h);
75ALFONT_DLL_DECLSPEC
int alfont_set_font_size_ex(ALFONT_FONT *f,
int h,
int flags);
76ALFONT_DLL_DECLSPEC
int alfont_get_font_height(ALFONT_FONT *f);
78ALFONT_DLL_DECLSPEC
int alfont_get_font_real_height(ALFONT_FONT *f);
80ALFONT_DLL_DECLSPEC
void alfont_get_font_real_vextent(ALFONT_FONT *f,
int *top,
int *bottom);
82ALFONT_DLL_DECLSPEC
int alfont_text_mode(
int mode);
84ALFONT_DLL_DECLSPEC
void alfont_textout_aa(BITMAP *bmp, ALFONT_FONT *f,
const char *s,
int x,
int y,
int color);
85ALFONT_DLL_DECLSPEC
void alfont_textout(BITMAP *bmp, ALFONT_FONT *f,
const char *s,
int x,
int y,
int color);
86ALFONT_DLL_DECLSPEC
void alfont_textout_aa_ex(BITMAP *bmp, ALFONT_FONT *f,
const char *s,
int x,
int y,
int color,
int bg);
87ALFONT_DLL_DECLSPEC
void alfont_textout_ex(BITMAP *bmp, ALFONT_FONT *f,
const char *s,
int x,
int y,
int color,
int bg);
89ALFONT_DLL_DECLSPEC
void alfont_textout_centre_aa(BITMAP *bmp, ALFONT_FONT *f,
const char *s,
int x,
int y,
int color);
90ALFONT_DLL_DECLSPEC
void alfont_textout_centre(BITMAP *bmp, ALFONT_FONT *f,
const char *s,
int x,
int y,
int color);
91ALFONT_DLL_DECLSPEC
void alfont_textout_centre_aa_ex(BITMAP *bmp, ALFONT_FONT *f,
const char *s,
int x,
int y,
int color,
int bg);
92ALFONT_DLL_DECLSPEC
void alfont_textout_centre_ex(BITMAP *bmp, ALFONT_FONT *f,
const char *s,
int x,
int y,
int color,
int bg);
94ALFONT_DLL_DECLSPEC
void alfont_textout_right_aa(BITMAP *bmp, ALFONT_FONT *f,
const char *s,
int x,
int y,
int color);
95ALFONT_DLL_DECLSPEC
void alfont_textout_right(BITMAP *bmp, ALFONT_FONT *f,
const char *s,
int x,
int y,
int color);
96ALFONT_DLL_DECLSPEC
void alfont_textout_right_aa_ex(BITMAP *bmp, ALFONT_FONT *f,
const char *s,
int x,
int y,
int color,
int bg);
97ALFONT_DLL_DECLSPEC
void alfont_textout_right_ex(BITMAP *bmp, ALFONT_FONT *f,
const char *s,
int x,
int y,
int color,
int bg);
99ALFONT_DLL_DECLSPEC
void alfont_textprintf(BITMAP *bmp, ALFONT_FONT *f,
int x,
int y,
int color,
const char *format, ...);
100ALFONT_DLL_DECLSPEC
void alfont_textprintf_aa(BITMAP *bmp, ALFONT_FONT *f,
int x,
int y,
int color,
const char *format, ...);
101ALFONT_DLL_DECLSPEC
void alfont_textprintf_ex(BITMAP *bmp, ALFONT_FONT *f,
int x,
int y,
int color,
int bg,
const char *format, ...);
102ALFONT_DLL_DECLSPEC
void alfont_textprintf_aa_ex(BITMAP *bmp, ALFONT_FONT *f,
int x,
int y,
int color,
int bg,
const char *format, ...);
104ALFONT_DLL_DECLSPEC
void alfont_textprintf_centre(BITMAP *bmp, ALFONT_FONT *f,
int x,
int y,
int color,
const char *format, ...);
105ALFONT_DLL_DECLSPEC
void alfont_textprintf_centre_aa(BITMAP *bmp, ALFONT_FONT *f,
int x,
int y,
int color,
const char *format, ...);
106ALFONT_DLL_DECLSPEC
void alfont_textprintf_centre_ex(BITMAP *bmp, ALFONT_FONT *f,
int x,
int y,
int color,
int bg,
const char *format, ...);
107ALFONT_DLL_DECLSPEC
void alfont_textprintf_centre_aa_ex(BITMAP *bmp, ALFONT_FONT *f,
int x,
int y,
int color,
int bg,
const char *format, ...);
109ALFONT_DLL_DECLSPEC
void alfont_textprintf_right(BITMAP *bmp, ALFONT_FONT *f,
int x,
int y,
int color,
const char *format, ...);
110ALFONT_DLL_DECLSPEC
void alfont_textprintf_right_aa(BITMAP *bmp, ALFONT_FONT *f,
int x,
int y,
int color,
const char *format, ...);
111ALFONT_DLL_DECLSPEC
void alfont_textprintf_right_ex(BITMAP *bmp, ALFONT_FONT *f,
int x,
int y,
int color,
int bg,
const char *format, ...);
112ALFONT_DLL_DECLSPEC
void alfont_textprintf_right_aa_ex(BITMAP *bmp, ALFONT_FONT *f,
int x,
int y,
int color,
int bg,
const char *format, ...);
114ALFONT_DLL_DECLSPEC
int alfont_text_height(ALFONT_FONT *f);
115ALFONT_DLL_DECLSPEC
int alfont_text_length(ALFONT_FONT *f,
const char *str);
117ALFONT_DLL_DECLSPEC
int alfont_is_fixed_font(ALFONT_FONT *f);
118ALFONT_DLL_DECLSPEC
int alfont_is_scalable_font(ALFONT_FONT *f);
120ALFONT_DLL_DECLSPEC
const int *alfont_get_available_fixed_sizes(ALFONT_FONT *f);
121ALFONT_DLL_DECLSPEC
int alfont_get_nof_available_fixed_sizes(ALFONT_FONT *f);
123ALFONT_DLL_DECLSPEC
int alfont_get_char_extra_spacing(ALFONT_FONT *f);
124ALFONT_DLL_DECLSPEC
void alfont_set_char_extra_spacing(ALFONT_FONT *f,
int spacing);