1 /***********************************************************
2 * Artsoft Retro-Game Library *
3 *----------------------------------------------------------*
4 * (c) 1994-2002 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 MAP_FONT_ASCII(c) ((c) >= 'a' && (c) <= 'z' ? 'A' + (c) - 'a' : \
39 (c) == 'ä' || (c) == 'Ä' ? 97 : \
40 (c) == 'ö' || (c) == 'Ö' ? 98 : \
41 (c) == 'ü' || (c) == 'Ü' ? 99 : \
44 (c) == FONT_ASCII_CURSOR ? 102 : \
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
53 /* font structure definitions */
55 void InitFontInfo(struct FontBitmapInfo *, int, int (*function)(int));
56 void FreeFontInfo(struct FontBitmapInfo *);
58 int getFontWidth(int);
59 int getFontHeight(int);
60 int getTextWidth(char *, int);
62 void getFontCharSource(int, char, Bitmap **, int *, int *);
64 void DrawInitText(char *, int, int);
65 void DrawTextF(int, int, int, char *, ...);
66 void DrawTextFCentered(int, int, char *, ...);
67 void DrawTextS(int, int, int, char *);
68 void DrawTextSCentered(int, int, char *);
69 void DrawText(int, int, char *, int);
70 void DrawTextExt(DrawBuffer *, int, int, char *, int, int);
71 void DrawTextToTextArea(int, int, char *, int, int, int, int, int);
72 boolean RenderLineToBuffer(char **, char *, int *, boolean, int);
73 void DrawTextWrapped(int, int, char *, int, int, int);
74 int DrawTextFromFile(int, int, char *, int, int, int);