X-Git-Url: https://git.artsoft.org/?a=blobdiff_plain;f=src%2Flibgame%2Ftext.h;h=530a6b2a95772de3d6c9debe5ecbd014e1a8d711;hb=e57078603232563176d90bb543ce2bc3a15b889e;hp=c1915d47859a77fb4f0685981f4919db359918b3;hpb=6ed4958820f8f97174ca47594dcc6f00ee31b2cb;p=rocksndiamonds.git diff --git a/src/libgame/text.h b/src/libgame/text.h index c1915d47..530a6b2a 100644 --- a/src/libgame/text.h +++ b/src/libgame/text.h @@ -29,22 +29,34 @@ #define FC_GREEN FONT_INITIAL_3 #define FC_YELLOW FONT_INITIAL_4 -#define FONT_CHARS_PER_LINE 16 -#define FONT_LINES_PER_FONT 4 - -#define FONT_OPAQUE 0 -#define FONT_MASKED 1 - /* text output definitions */ #define MAX_OUTPUT_LINESIZE 1024 +/* special character mapping for default fonts */ +#define FONT_ASCII_CURSOR ((char)160) +#define MAP_FONT_ASCII(c) ((c) >= 'a' && (c) <= 'z' ? 'A' + (c) - 'a' : \ + (c) == '©' ? 96 : \ + (c) == 'ä' || (c) == 'Ä' ? 97 : \ + (c) == 'ö' || (c) == 'Ö' ? 98 : \ + (c) == 'ü' || (c) == 'Ü' ? 99 : \ + (c) == '°' ? 100 : \ + (c) == '®' ? 101 : \ + (c) == FONT_ASCII_CURSOR ? 102 : \ + (c)) + +/* 64 regular ordered ASCII characters, 6 special characters, 1 cursor char. */ +#define MIN_NUM_CHARS_PER_FONT 64 +#define DEFAULT_NUM_CHARS_PER_FONT (MIN_NUM_CHARS_PER_FONT + 6 +1) +#define DEFAULT_NUM_CHARS_PER_LINE 16 + + /* font structure definitions */ -void InitFontInfo(struct FontBitmapInfo *, int, - int (*select_font_function)(int)); +void InitFontInfo(struct FontBitmapInfo *, int, int (*function)(int)); + int getFontWidth(int); int getFontHeight(int); -boolean getFontChar(int, char, int *, int *); +void getFontCharSource(int, char, Bitmap **, int *, int *); void DrawInitText(char *, int, int); void DrawTextF(int, int, int, char *, ...);