summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
239b08a)
While support for font bitmaps with full ISO-8859-1 character maps
already exists, this change adds support for specially crafted font
bitmaps containing the usual reduced character map plus lower case
characters (including umlaut characters) by choosing ".frames: 112"
for the font definition. To use this, the last line in the font's
character map that looks like this
©ÄÖÜ°™_
is replaced with the following three lines (where the underscore
characters are usually replaced with filled, cursor style blocks):
`abcdefghijklmno
pqrstuvwxyz{|}~_
©ÄÖÜ°™_äöüß
The layout of the characters in the font bitmap may differ from the
above example (which reflects the default font bitmap layout), and can
be set using the ".frames_per_line" configuration option (which would
be "16" for the example above).
(In fact, this extended, reduced font character map currently has only
107 characters defined, so a few special characters may be added later
to the remaining five slots.)
{
int font_bitmap_id = gfx.select_font_function(font_nr);
struct FontBitmapInfo *font = &gfx.font_bitmap_info[font_bitmap_id];
{
int font_bitmap_id = gfx.select_font_function(font_nr);
struct FontBitmapInfo *font = &gfx.font_bitmap_info[font_bitmap_id];
- boolean default_font = (font->num_chars == DEFAULT_NUM_CHARS_PER_FONT);
int font_pos = (unsigned char)c - 32;
// map some special characters to their ascii values in default font
int font_pos = (unsigned char)c - 32;
// map some special characters to their ascii values in default font
+ if (font->num_chars == DEFAULT_NUM_CHARS_PER_FONT)
font_pos = MAP_FONT_ASCII(c) - 32;
font_pos = MAP_FONT_ASCII(c) - 32;
+ else if (font->num_chars == NUM_CHARS_PER_FONT_EXT)
+ font_pos = MAP_FONT_ASCII_EXT(c) - 32;
// this allows dynamic special characters together with special font
if (font_pos < 0 || font_pos >= font->num_chars)
// this allows dynamic special characters together with special font
if (font_pos < 0 || font_pos >= font->num_chars)
(c) == FONT_ASCII_DOWN ? 111 : \
(c))
(c) == FONT_ASCII_DOWN ? 111 : \
(c))
+#define MAP_FONT_ASCII_EXT(c) ((c) == CHAR_BYTE_COPYRIGHT ? 128 : \
+ (c) == CHAR_BYTE_UMLAUT_A ? 129 : \
+ (c) == CHAR_BYTE_UMLAUT_O ? 130 : \
+ (c) == CHAR_BYTE_UMLAUT_U ? 131 : \
+ (c) == CHAR_BYTE_DEGREE ? 132 : \
+ (c) == CHAR_BYTE_REGISTERED ? 133 : \
+ (c) == FONT_ASCII_CURSOR ? 134 : \
+ (c) == CHAR_BYTE_UMLAUT_a ? 135 : \
+ (c) == CHAR_BYTE_UMLAUT_o ? 136 : \
+ (c) == CHAR_BYTE_UMLAUT_u ? 137 : \
+ (c) == CHAR_BYTE_SHARP_S ? 138 : \
+ (c) == FONT_ASCII_BUTTON ? 141 : \
+ (c) == FONT_ASCII_UP ? 142 : \
+ (c) == FONT_ASCII_DOWN ? 143 : \
+ (c))
+
// 64 regular ordered ASCII characters, 6 special characters, 1 cursor char.
#define MIN_NUM_CHARS_PER_FONT 64
// 64 regular ordered ASCII characters, 6 special characters, 1 cursor char.
#define MIN_NUM_CHARS_PER_FONT 64
+#define NUM_CHARS_PER_FONT_EXT 112
#define DEFAULT_NUM_CHARS_PER_FONT (MIN_NUM_CHARS_PER_FONT + 6 +1)
#define DEFAULT_NUM_CHARS_PER_LINE 16
#define DEFAULT_NUM_CHARS_PER_FONT (MIN_NUM_CHARS_PER_FONT + 6 +1)
#define DEFAULT_NUM_CHARS_PER_LINE 16