1 /*         ______   ___    ___
2  *        /\  _  \ /\_ \  /\_ \
3  *        \ \ \L\ \\//\ \ \//\ \      __     __   _ __   ___
4  *         \ \  __ \ \ \ \  \ \ \   /'__`\ /'_ `\/\`'__\/ __`\
5  *          \ \ \/\ \ \_\ \_ \_\ \_/\  __//\ \L\ \ \ \//\ \L\ \
6  *           \ \_\ \_\/\____\/\____\ \____\ \____ \ \_\\ \____/
7  *            \/_/\/_/\/____/\/____/\/____/\/___L\ \/_/ \/___/
8  *                                           /\____/
9  *                                           \_/__/
10  *
11  *      Font loading routines.
12  *
13  *      By Evert Glebbeek.
14  *
15  *      See readme.txt for copyright information.
16  */
17 
18 
19 #ifndef ALLEGRO_FONT_H
20 #define ALLEGRO_FONT_H
21 
22 #include "base.h"
23 
24 #ifdef __cplusplus
25    extern "C" {
26 #endif
27 
28 typedef struct FONT_GLYPH           /* a single monochrome font character */
29 {
30    short w, h;
31    ZERO_SIZE_ARRAY(unsigned char, dat);
32 } FONT_GLYPH;
33 
34 
35 struct FONT_VTABLE;
36 
37 typedef struct FONT
38 {
39    void *data;
40    int height;
41    struct FONT_VTABLE *vtable;
42 } FONT;
43 
44 AL_FUNC(int, font_has_alpha, (FONT *f));
45 AL_FUNC(void, make_trans_font, (FONT *f));
46 
47 AL_FUNC(int, is_trans_font, (FONT *f));
48 AL_FUNC(int, is_color_font, (FONT *f));
49 AL_FUNC(int, is_mono_font, (FONT *f));
50 AL_FUNC(int, is_compatible_font, (FONT *f1, FONT *f2));
51 
52 AL_FUNC(void, register_font_file_type, (AL_CONST char *ext, FONT *(*load)(AL_CONST char *filename, RGB *pal, void *param)));
53 AL_FUNC(FONT *, load_font, (AL_CONST char *filename, RGB *pal, void *param));
54 
55 AL_FUNC(FONT *, load_dat_font, (AL_CONST char *filename, RGB *pal, void *param));
56 AL_FUNC(FONT *, load_bios_font, (AL_CONST char *filename, RGB *pal, void *param));
57 AL_FUNC(FONT *, load_grx_font, (AL_CONST char *filename, RGB *pal, void *param));
58 AL_FUNC(FONT *, load_grx_or_bios_font, (AL_CONST char *filename, RGB *pal, void *param));
59 AL_FUNC(FONT *, load_bitmap_font, (AL_CONST char *fname, RGB *pal, void *param));
60 AL_FUNC(FONT *, load_txt_font, (AL_CONST char *fname, RGB *pal, void *param));
61 
62 AL_FUNC(FONT *, grab_font_from_bitmap, (BITMAP *bmp));
63 
64 AL_FUNC(int, get_font_ranges, (FONT *f));
65 AL_FUNC(int, get_font_range_begin, (FONT *f, int range));
66 AL_FUNC(int, get_font_range_end, (FONT *f, int range));
67 AL_FUNC(FONT *, extract_font_range, (FONT *f, int begin, int end));
68 AL_FUNC(FONT *, merge_fonts, (FONT *f1, FONT *f2));
69 AL_FUNC(int, transpose_font, (FONT *f, int drange));
70 #ifdef __cplusplus
71    }
72 #endif
73 
74 #endif          /* ifndef ALLEGRO_FONT_H */
75 
76 
77