rnd-20030411-1-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 /* default fonts */
21 #define FONT_INITIAL_1          0
22 #define FONT_INITIAL_2          1
23 #define FONT_INITIAL_3          2
24 #define FONT_INITIAL_4          3
25
26 /* font colors */
27 #define FC_RED                  FONT_INITIAL_1
28 #define FC_BLUE                 FONT_INITIAL_2
29 #define FC_GREEN                FONT_INITIAL_3
30 #define FC_YELLOW               FONT_INITIAL_4
31
32 /* text output definitions */
33 #define MAX_OUTPUT_LINESIZE     1024
34
35 /* special character mapping for default fonts */
36 #define FONT_ASCII_CURSOR       ((char)160)
37 #define MAP_FONT_ASCII(c)       ((c) >= 'a' && (c) <= 'z' ? 'A' + (c) - 'a' : \
38                                  (c) == '©'               ? 96  :             \
39                                  (c) == 'ä' || (c) == 'Ä' ? 97  :             \
40                                  (c) == 'ö' || (c) == 'Ö' ? 98  :             \
41                                  (c) == 'ü' || (c) == 'Ü' ? 99  :             \
42                                  (c) == '°'               ? 100 :             \
43                                  (c) == '®'               ? 101 :             \
44                                  (c) == FONT_ASCII_CURSOR ? 102 :             \
45                                  (c))
46
47 /* 64 regular ordered ASCII characters, 6 special characters, 1 cursor char. */
48 #define MIN_NUM_CHARS_PER_FONT                  64
49 #define DEFAULT_NUM_CHARS_PER_FONT              (MIN_NUM_CHARS_PER_FONT + 6 +1)
50 #define DEFAULT_NUM_CHARS_PER_LINE              16
51
52
53 /* font structure definitions */
54
55 void InitFontInfo(struct FontBitmapInfo *, int, int (*function)(int));
56
57 int getFontWidth(int);
58 int getFontHeight(int);
59 void getFontCharSource(int, char, Bitmap **, int *, int *);
60
61 void DrawInitText(char *, int, int);
62 void DrawTextF(int, int, int, char *, ...);
63 void DrawTextFCentered(int, int, char *, ...);
64 void DrawText(int, int, char *, int);
65 void DrawTextExt(DrawBuffer *, int, int, char *, int, int);
66
67 #endif  /* TEXT_H */