rnd-20030223-3-src
[rocksndiamonds.git] / src / libgame / text.h
1 /***********************************************************
2 * Artsoft Retro-Game Library                               *
3 *----------------------------------------------------------*
4 * (c) 1994-2002 Artsoft Entertainment                      *
5 *               Holger Schemel                             *
6 *               Detmolder Strasse 189                      *
7 *               33604 Bielefeld                            *
8 *               Germany                                    *
9 *               e-mail: info@artsoft.org                   *
10 *----------------------------------------------------------*
11 * text.h                                                   *
12 ***********************************************************/
13
14 #ifndef TEXT_H
15 #define TEXT_H
16
17 #include "system.h"
18
19
20 /* font types */
21 #define FS_INITIAL              0
22 #define FS_BIG                  1
23 #define FS_MEDIUM               2
24 #define FS_SMALL                3
25
26 /* font colors */
27 #define FC_RED                  0
28 #define FC_BLUE                 1
29 #define FC_GREEN                2
30 #define FC_YELLOW               3
31
32 /* special fonts */
33 #define FC_SPECIAL_TAPE         4
34 #define FC_SPECIAL_GAME         5
35 #define FC_SPECIAL_NARROW       6
36
37 #define FONT(fs, fc)            ((      (fs) == FS_INITIAL ?            \
38                                         IMG_FONT_INITIAL_1 + (fc) :     \
39                                         (fs) == FS_BIG ?                \
40                                         IMG_FONT_BIG_1 + (fc) :         \
41                                         (fs) == FS_MEDIUM ?             \
42                                         IMG_FONT_MEDIUM_1 + (fc) :      \
43                                         (fs) == FS_SMALL ?              \
44                                         IMG_FONT_SMALL_1 + (fc) :       \
45                                         IMG_FONT_SMALL_1                \
46                                  ) - FIRST_IMG_FONT)
47
48 #define FONT_DEFAULT_BIG        FONT(FS_BIG,   FC_YELLOW)
49 #define FONT_DEFAULT_SMALL      FONT(FS_SMALL, FC_YELLOW)
50 #define FONT_SPECIAL_TAPE       FONT(FS_SMALL, FC_SPECIAL_TAPE)
51 #define FONT_SPECIAL_GAME       FONT(FS_SMALL, FC_SPECIAL_GAME)
52 #define FONT_SPECIAL_NARROW     FONT(FS_SMALL, FC_SPECIAL_NARROW)
53
54 #define FONT_CHARS_PER_LINE     16
55 #define FONT_LINES_PER_FONT     4
56
57 #define FONT_OPAQUE             0
58 #define FONT_MASKED             1
59
60 /* text output definitions */
61 #define MAX_OUTPUT_LINESIZE     1024
62
63 /* font structure definitions */
64
65 void InitFontInfo(struct FontBitmapInfo *, int,
66                   int (*select_font_function)(int));
67 int getFontWidth(int);
68 int getFontHeight(int);
69 void DrawInitText(char *, int, int);
70 void DrawTextF(int, int, int, char *, ...);
71 void DrawTextFCentered(int, int, char *, ...);
72 void DrawText(int, int, char *, int);
73 void DrawTextExt(DrawBuffer *, int, int, char *, int, int);
74
75 #endif  /* TEXT_H */