1 /***********************************************************
2 * Artsoft Retro-Game Library *
3 *----------------------------------------------------------*
4 * (c) 1994-2006 Artsoft Entertainment *
6 * Detmolder Strasse 189 *
9 * e-mail: info@artsoft.org *
10 *----------------------------------------------------------*
12 ***********************************************************/
21 #define FONT_INITIAL_1 0
22 #define FONT_INITIAL_2 1
23 #define FONT_INITIAL_3 2
24 #define FONT_INITIAL_4 3
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
32 /* text output definitions */
33 #define MAX_OUTPUT_LINESIZE 1024
35 /* special character mapping for default fonts */
36 #define FONT_ASCII_CURSOR ((char)160)
37 #define FONT_ASCII_BUTTON ((char)128)
38 #define FONT_ASCII_UP ((char)129)
39 #define FONT_ASCII_DOWN ((char)130)
40 #define FONT_ASCII_LEFT ((char)'<')
41 #define FONT_ASCII_RIGHT ((char)'>')
43 #define MAP_FONT_ASCII(c) ((c) >= 'a' && (c) <= 'z' ? 'A' + (c) - 'a' : \
45 (c) == 'ä' || (c) == 'Ä' ? 97 : \
46 (c) == 'ö' || (c) == 'Ö' ? 98 : \
47 (c) == 'ü' || (c) == 'Ü' ? 99 : \
50 (c) == FONT_ASCII_CURSOR ? 102 : \
51 (c) == FONT_ASCII_BUTTON ? 109 : \
52 (c) == FONT_ASCII_UP ? 110 : \
53 (c) == FONT_ASCII_DOWN ? 111 : \
56 /* 64 regular ordered ASCII characters, 6 special characters, 1 cursor char. */
57 #define MIN_NUM_CHARS_PER_FONT 64
58 #define DEFAULT_NUM_CHARS_PER_FONT (MIN_NUM_CHARS_PER_FONT + 6 +1)
59 #define DEFAULT_NUM_CHARS_PER_LINE 16
62 /* font structure definitions */
64 void InitFontInfo(struct FontBitmapInfo *, int,
65 int (*function1)(int), int (*function2)(char *));
66 void FreeFontInfo(struct FontBitmapInfo *);
68 struct FontBitmapInfo *getFontBitmapInfo(int);
70 int getFontWidth(int);
71 int getFontHeight(int);
72 int getTextWidth(char *, int);
74 void getFontCharSource(int, char, Bitmap **, int *, int *);
76 int maxWordLengthInString(char *);
78 void DrawInitText(char *, int, int);
79 void DrawInitTextIfNeeded(char *, int, int);
80 void DrawInitTextExt(char *, int, int, boolean);
81 void DrawTextF(int, int, int, char *, ...);
82 void DrawTextFCentered(int, int, char *, ...);
83 void DrawTextS(int, int, int, char *);
84 void DrawTextSCentered(int, int, char *);
85 void DrawTextCentered(int, int, char *);
86 void DrawTextSAligned(int, int, char *, int, int);
87 void DrawTextAligned(int, int, char *, int, int);
88 void DrawText(int, int, char *, int);
89 void DrawTextExt(DrawBuffer *, int, int, char *, int, int);
91 char *GetTextBufferFromFile(char *, int);
92 int DrawTextBuffer(int, int, char *, int, int, int, int, int, int,
93 boolean, boolean, boolean);
94 int DrawTextFile(int, int, char *, int, int, int, int, int, int,
95 boolean, boolean, boolean);