yaft: add a second font for low-resolution displays

TODO: instead of statically defining the characters, freetype should be
used for rendering
This commit is contained in:
Stefan Seyfried
2018-01-14 20:46:19 +01:00
committed by Thilo Graf
parent 7a824ccd50
commit 5598cd50aa
3 changed files with 222 additions and 6 deletions

View File

@@ -3,13 +3,14 @@ struct glyph_t {
uint8_t width;
uint32_t bitmap[24];
};
#if 0
enum {
CELL_WIDTH = 12,
CELL_HEIGHT = 24
};
static const struct glyph_t glyphs[] = {
#endif
static const struct glyph_t hd_glyphs[] = {
{12, 24, {0}}, /* entry 0 is width, height, dummy */
{32, 1, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}},
{33, 1, {0x0, 0x0, 0x0, 0x0, 0x600, 0x600, 0x600, 0x600, 0x600, 0x600, 0x600, 0x600, 0x600, 0x600, 0x0, 0x0, 0x600, 0x600, 0x600, 0x0, 0x0, 0x0, 0x0, 0x0}},
{34, 1, {0x0, 0x0, 0x1980, 0x1980, 0x1980, 0x1980, 0x1980, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}},
@@ -201,4 +202,207 @@ static const struct glyph_t glyphs[] = {
{254, 1, {0x0, 0x0, 0x0, 0x0, 0x6000, 0x6000, 0x6000, 0x6000, 0x7F80, 0x60C0, 0x6060, 0x6060, 0x6060, 0x6060, 0x6060, 0x6060, 0x6060, 0x60C0, 0x7F80, 0x6000, 0x6000, 0x6000, 0x6000, 0x0}},
{255, 1, {0x0, 0x0, 0x0, 0x0, 0x1980, 0x1980, 0x1980, 0x0, 0x6060, 0x6060, 0x6060, 0x6060, 0x6060, 0x6060, 0x6060, 0x6060, 0x6060, 0x30E0, 0x1FE0, 0x60, 0x60, 0xC0, 0x3F80, 0x0}},
{12288, 2, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}},
{0, 0, {0}}
};
static const struct glyph_t sd_glyphs[] = {
{8, 16, {0}}, /* entry 0 is width, height, dummy */
{32, 1, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}},
{33, 1, {0x0, 0x0, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x0, 0x0, 0x10, 0x10, 0x0, 0x0}},
{34, 1, {0x0, 0x0, 0x6C, 0x24, 0x24, 0x48, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}},
{35, 1, {0x0, 0x0, 0x44, 0x44, 0x44, 0xFE, 0x44, 0x44, 0x44, 0x44, 0xFE, 0x44, 0x44, 0x44, 0x0, 0x0}},
{36, 1, {0x0, 0x0, 0x10, 0x10, 0x7C, 0x92, 0x90, 0x7C, 0x12, 0x12, 0x92, 0x7C, 0x10, 0x10, 0x0, 0x0}},
{37, 1, {0x0, 0x0, 0x0, 0x60, 0x90, 0x92, 0x64, 0x8, 0x10, 0x20, 0x4C, 0x92, 0x12, 0xC, 0x0, 0x0}},
{38, 1, {0x0, 0x0, 0x0, 0x70, 0x88, 0x88, 0x88, 0x50, 0x20, 0x50, 0x8A, 0x84, 0x8C, 0x72, 0x0, 0x0}},
{39, 1, {0x0, 0x0, 0x30, 0x10, 0x10, 0x20, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}},
{40, 1, {0x0, 0x4, 0x8, 0x10, 0x10, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x10, 0x10, 0x8, 0x4, 0x0}},
{41, 1, {0x0, 0x20, 0x10, 0x8, 0x8, 0x4, 0x4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},
{53, 1, {0x0, 0x0, 0x7E, 0x40, 0x40, 0x40, 0x78, 0x44, 0x2, 0x2, 0x2, 0x82, 0x44, 0x38, 0x0, 0x0}},
{54, 1, {0x0, 0x0, 0x38, 0x44, 0x82, 0x80, 0xB8, 0xC4, 0x82, 0x82, 0x82, 0x82, 0x44, 0x38, 0x0, 0x0}},
{55, 1, {0x0, 0x0, 0xFE, 0x82, 0x82, 0x2, 0x4, 0x8, 0x8, 0x10, 0x10, 0x10, 0x10, 0x10, 0x0, 0x0}},
{56, 1, {0x0, 0x0, 0x38, 0x44, 0x82, 0x82, 0x44, 0x38, 0x44, 0x82, 0x82, 0x82, 0x44, 0x38, 0x0, 0x0}},
{57, 1, {0x0, 0x0, 0x38, 0x44, 0x82, 0x82, 0x82, 0x46, 0x3A, 0x2, 0x2, 0x82, 0x44, 0x38, 0x0, 0x0}},
{58, 1, {0x0, 0x0, 0x0, 0x0, 0x18, 0x18, 0x0, 0x0, 0x0, 0x0, 0x18, 0x18, 0x0, 0x0, 0x0, 0x0}},
{59, 1, {0x0, 0x0, 0x0, 0x0, 0x18, 0x18, 0x0, 0x0, 0x0, 0x0, 0x18, 0x8, 0x8, 0x10, 0x0, 0x0}},
{60, 1, {0x0, 0x0, 0x0, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x20, 0x10, 0x8, 0x4, 0x2, 0x0, 0x0}},
{61, 1, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xFE, 0x0, 0x0, 0xFE, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}},
{62, 1, {0x0, 0x0, 0x0, 0x40, 0x20, 0x10, 0x8, 0x4, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x0, 0x0}},
{63, 1, {0x0, 0x0, 0x38, 0x44, 0x82, 0x2, 0x4, 0x8, 0x10, 0x10, 0x0, 0x0, 0x10, 0x10, 0x0, 0x0}},
{64, 1, {0x0, 0x0, 0x38, 0x44, 0x92, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAC, 0x90, 0x40, 0x3C, 0x0, 0x0}},
{65, 1, {0x0, 0x0, 0x10, 0x10, 0x28, 0x28, 0x28, 0x44, 0x44, 0x44, 0xFE, 0x82, 0x82, 0x82, 0x0, 0x0}},
{66, 1, {0x0, 0x0, 0xF8, 0x44, 0x42, 0x42, 0x44, 0x78, 0x44, 0x42, 0x42, 0x42, 0x44, 0xF8, 0x0, 0x0}},
{67, 1, {0x0, 0x0, 0x38, 0x44, 0x82, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x82, 0x44, 0x38, 0x0, 0x0}},
{68, 1, {0x0, 0x0, 0xF8, 0x44, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x44, 0xF8, 0x0, 0x0}},
{69, 1, {0x0, 0x0, 0x7E, 0x40, 0x40, 0x40, 0x40, 0x7C, 0x40, 0x40, 0x40, 0x40, 0x40, 0x7E, 0x0, 0x0}},
{70, 1, {0x0, 0x0, 0x7E, 0x40, 0x40, 0x40, 0x40, 0x7C, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x0, 0x0}},
{71, 1, {0x0, 0x0, 0x38, 0x44, 0x82, 0x80, 0x80, 0x80, 0x8E, 0x82, 0x82, 0x82, 0x46, 0x38, 0x0, 0x0}},
{72, 1, {0x0, 0x0, 0x42, 0x42, 0x42, 0x42, 0x42, 0x7E, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x0, 0x0}},
{73, 1, {0x0, 0x0, 0x38, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x38, 0x0, 0x0}},
{74, 1, {0x0, 0x0, 0xE, 0x4, 0x4, 0x4, 0x4, 0x4, 0x4, 0x4, 0x4, 0x44, 0x44, 0x38, 0x0, 0x0}},
{75, 1, {0x0, 0x0, 0x42, 0x42, 0x44, 0x44, 0x48, 0x70, 0x48, 0x48, 0x44, 0x44, 0x42, 0x42, 0x0, 0x0}},
{76, 1, {0x0, 0x0, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x7E, 0x0, 0x0}},
{77, 1, {0x0, 0x0, 0x82, 0x82, 0xC6, 0xC6, 0xAA, 0xAA, 0x92, 0x92, 0x82, 0x82, 0x82, 0x82, 0x0, 0x0}},
{78, 1, {0x0, 0x0, 0x82, 0xC2, 0xC2, 0xA2, 0xA2, 0x92, 0x92, 0x8A, 0x8A, 0x86, 0x86, 0x82, 0x0, 0x0}},
{79, 1, {0x0, 0x0, 0x38, 0x44, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x44, 0x38, 0x0, 0x0}},
{80, 1, {0x0, 0x0, 0x78, 0x44, 0x42, 0x42, 0x44, 0x78, 0x40, 0x40, 0x40, 0x40, 0x40, 0x40, 0x0, 0x0}},
{81, 1, {0x0, 0x0, 0x38, 0x44, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x9A, 0xA6, 0x64, 0x3A, 0x0, 0x0}},
{82, 1, {0x0, 0x0, 0x78, 0x44, 0x42, 0x42, 0x44, 0x78, 0x44, 0x44, 0x42, 0x42, 0x42, 0x42, 0x0, 0x0}},
{83, 1, {0x0, 0x0, 0x38, 0x44, 0x82, 0x80, 0x40, 0x38, 0x4, 0x2, 0x2, 0x82, 0x44, 0x38, 0x0, 0x0}},
{84, 1, {0x0, 0x0, 0xFE, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x0, 0x0}},
{85, 1, {0x0, 0x0, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x3C, 0x0, 0x0}},
{86, 1, {0x0, 0x0, 0x82, 0x82, 0x82, 0x44, 0x44, 0x44, 0x28, 0x28, 0x28, 0x10, 0x10, 0x10, 0x0, 0x0}},
{87, 1, {0x0, 0x0, 0x82, 0x82, 0x82, 0x92, 0x92, 0x92, 0xAA, 0xAA, 0xAA, 0x44, 0x44, 0x44, 0x0, 0x0}},
{88, 1, {0x0, 0x0, 0x82, 0x82, 0x44, 0x44, 0x28, 0x10, 0x10, 0x28, 0x44, 0x44, 0x82, 0x82, 0x0, 0x0}},
{89, 1, {0x0, 0x0, 0x82, 0x82, 0x44, 0x44, 0x28, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x0, 0x0}},
{90, 1, {0x0, 0x0, 0xFE, 0x2, 0x4, 0x4, 0x8, 0x10, 0x10, 0x20, 0x40, 0x40, 0x80, 0xFE, 0x0, 0x0}},
{91, 1, {0x0, 0x3C, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x3C, 0x0}},
{92, 1, {0x0, 0x80, 0x80, 0x40, 0x40, 0x20, 0x20, 0x10, 0x10, 0x8, 0x8, 0x4, 0x4, 0x2, 0x2, 0x0}},
{93, 1, {0x0, 0x78, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x8, 0x78, 0x0}},
{94, 1, {0x0, 0x0, 0x10, 0x28, 0x44, 0x82, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}},
{95, 1, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xFE, 0x0, 0x0}},
{96, 1, {0x0, 0x0, 0x40, 0x20, 0x10, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}},
{97, 1, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3C, 0x42, 0x6, 0x3A, 0x42, 0x42, 0x46, 0x3A, 0x0, 0x0}},
{98, 1, {0x0, 0x0, 0x40, 0x40, 0x40, 0x40, 0x58, 0x64, 0x42, 0x42, 0x42, 0x42, 0x64, 0x58, 0x0, 0x0}},
{99, 1, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x1C, 0x22, 0x40, 0x40, 0x40, 0x40, 0x22, 0x1C, 0x0, 0x0}},
{100, 1, {0x0, 0x0, 0x2, 0x2, 0x2, 0x2, 0x1A, 0x26, 0x42, 0x42, 0x42, 0x42, 0x26, 0x1A, 0x0, 0x0}},
{101, 1, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x38, 0x44, 0x82, 0xFE, 0x80, 0x80, 0x46, 0x3C, 0x0, 0x0}},
{102, 1, {0x0, 0x0, 0xC, 0x12, 0x10, 0x10, 0x7C, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x0, 0x0}},
{103, 1, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3A, 0x46, 0x82, 0x82, 0x82, 0x46, 0x3A, 0x2, 0xC4, 0x78}},
{104, 1, {0x0, 0x0, 0x40, 0x40, 0x40, 0x40, 0x58, 0x64, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x0, 0x0}},
{105, 1, {0x0, 0x0, 0x10, 0x10, 0x0, 0x0, 0x30, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x38, 0x0, 0x0}},
{106, 1, {0x0, 0x0, 0x4, 0x4, 0x0, 0x0, 0xC, 0x4, 0x4, 0x4, 0x4, 0x4, 0x4, 0x44, 0x44, 0x38}},
{107, 1, {0x0, 0x0, 0x40, 0x40, 0x40, 0x40, 0x42, 0x44, 0x48, 0x50, 0x70, 0x48, 0x44, 0x42, 0x0, 0x0}},
{108, 1, {0x0, 0x0, 0x30, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x0, 0x0}},
{109, 1, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xEC, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x0, 0x0}},
{110, 1, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x5C, 0x62, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x0, 0x0}},
{111, 1, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x38, 0x44, 0x82, 0x82, 0x82, 0x82, 0x44, 0x38, 0x0, 0x0}},
{112, 1, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x58, 0x64, 0x42, 0x42, 0x42, 0x64, 0x58, 0x40, 0x40, 0x40}},
{113, 1, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x34, 0x4C, 0x84, 0x84, 0x84, 0x4C, 0x34, 0x4, 0x4, 0x4}},
{114, 1, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x2C, 0x32, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x0, 0x0}},
{115, 1, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x3C, 0x46, 0x40, 0x30, 0xC, 0x2, 0x62, 0x3C, 0x0, 0x0}},
{116, 1, {0x0, 0x0, 0x10, 0x10, 0x10, 0x10, 0x7C, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0xC, 0x0, 0x0}},
{117, 1, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x46, 0x3A, 0x0, 0x0}},
{118, 1, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x82, 0x82, 0x44, 0x44, 0x28, 0x28, 0x10, 0x10, 0x0, 0x0}},
{119, 1, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x82, 0x82, 0x92, 0x92, 0xAA, 0xAA, 0x44, 0x44, 0x0, 0x0}},
{120, 1, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x82, 0x44, 0x28, 0x10, 0x10, 0x28, 0x44, 0x82, 0x0, 0x0}},
{121, 1, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x82, 0x82, 0x44, 0x44, 0x28, 0x28, 0x10, 0x10, 0x20, 0xC0}},
{122, 1, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x7E, 0x2, 0x4, 0x8, 0x10, 0x20, 0x40, 0x7E, 0x0, 0x0}},
{123, 1, {0x0, 0x0, 0xC, 0x10, 0x10, 0x10, 0x10, 0x60, 0x10, 0x10, 0x10, 0x10, 0x10, 0xC, 0x0, 0x0}},
{124, 1, {0x0, 0x0, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x18, 0x0, 0x0}},
{125, 1, {0x0, 0x0, 0x30, 0x8, 0x8, 0x8, 0x8, 0x6, 0x8, 0x8, 0x8, 0x8, 0x8, 0x30, 0x0, 0x0}},
{126, 1, {0x0, 0x60, 0x92, 0xC, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}},
{161, 1, {0x0, 0x10, 0x10, 0x0, 0x0, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x30, 0x30, 0x30, 0x30}},
{162, 1, {0x0, 0x0, 0x10, 0x3C, 0x52, 0x92, 0x90, 0x90, 0x90, 0x90, 0x90, 0x92, 0x52, 0x3C, 0x10, 0x0}},
{163, 1, {0x0, 0x0, 0x0, 0x0, 0xC, 0x12, 0x10, 0x10, 0x10, 0x7C, 0x10, 0x10, 0x3C, 0x52, 0x20, 0x0}},
{164, 1, {0x0, 0x0, 0x0, 0x0, 0x0, 0x42, 0x3C, 0x24, 0x24, 0x3C, 0x42, 0x0, 0x0, 0x0, 0x0, 0x0}},
{165, 1, {0x82, 0x82, 0x44, 0x44, 0x44, 0x28, 0x28, 0xFE, 0x10, 0xFE, 0x10, 0x10, 0x10, 0x10, 0x0, 0x0}},
{166, 1, {0x0, 0x10, 0x10, 0x10, 0x10, 0x10, 0x0, 0x0, 0x0, 0x10, 0x10, 0x10, 0x10, 0x10, 0x0, 0x0}},
{167, 1, {0x0, 0x3C, 0x42, 0x40, 0x20, 0x3C, 0x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, 0x0, 0x0, 0x0, 0x0}},
{180, 1, {0x0, 0xC, 0x18, 0x30, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}},
{181, 1, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x22, 0x22, 0x22, 0x44, 0x44, 0x6C, 0x54, 0x82, 0x80}},
{182, 1, {0x0, 0x3C, 0x74, 0x74, 0x74, 0x74, 0x34, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x14, 0x0, 0x0}},
{183, 1, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x18, 0x18, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}},
{184, 1, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xC, 0x8, 0x10}},
{185, 1, {0x0, 0x8, 0x18, 0x28, 0x8, 0x8, 0x8, 0x8, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}},
{186, 1, {0x0, 0x18, 0x24, 0x24, 0x24, 0x24, 0x18, 0x0, 0x3C, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}},
{187, 1, {0x0, 0x0, 0x0, 0x0, 0x90, 0x48, 0x24, 0x12, 0x9, 0x9, 0x12, 0x24, 0x48, 0x90, 0x0, 0x0}},
{188, 1, {0x0, 0x40, 0xC4, 0x44, 0x48, 0x48, 0x50, 0x12, 0x26, 0x2A, 0x4A, 0x5F, 0x82, 0x82, 0x0, 0x0}},
{189, 1, {0x0, 0x40, 0xC4, 0x44, 0x48, 0x48, 0x50, 0x1C, 0x32, 0x22, 0x44, 0x48, 0x88, 0x9E, 0x0, 0x0}},
{190, 1, {0x0, 0x60, 0x92, 0x12, 0x64, 0x14, 0x98, 0x6A, 0x16, 0x16, 0x2A, 0x3F, 0x42, 0x42, 0x0, 0x0}},
{191, 1, {0x8, 0x8, 0x0, 0x0, 0x8, 0x8, 0x8, 0x10, 0x20, 0x20, 0x41, 0x41, 0x41, 0x22, 0x1C, 0x0}},
{192, 1, {0x30, 0x10, 0x8, 0x10, 0x10, 0x28, 0x28, 0x44, 0x44, 0x7C, 0x82, 0x82, 0x82, 0x82, 0x0, 0x0}},
{193, 1, {0x18, 0x10, 0x20, 0x10, 0x10, 0x28, 0x28, 0x44, 0x44, 0x7C, 0x82, 0x82, 0x82, 0x82, 0x0, 0x0}},
{194, 1, {0x10, 0x38, 0x44, 0x10, 0x10, 0x28, 0x28, 0x44, 0x44, 0x7C, 0x82, 0x82, 0x82, 0x82, 0x0, 0x0}},
{195, 1, {0x34, 0x58, 0x0, 0x10, 0x10, 0x28, 0x28, 0x44, 0x44, 0x7C, 0x82, 0x82, 0x82, 0x82, 0x0, 0x0}},
{196, 1, {0x44, 0x44, 0x0, 0x10, 0x10, 0x28, 0x28, 0x44, 0x44, 0x7C, 0x82, 0x82, 0x82, 0x82, 0x0, 0x0}},
{197, 1, {0x10, 0x28, 0x10, 0x10, 0x10, 0x28, 0x28, 0x44, 0x44, 0x7C, 0x82, 0x82, 0x82, 0x82, 0x0, 0x0}},
{198, 1, {0x0, 0x0, 0x1F, 0x28, 0x28, 0x28, 0x2E, 0x48, 0x48, 0x78, 0x88, 0x88, 0x88, 0x8F, 0x0, 0x0}},
{199, 1, {0x0, 0x38, 0x44, 0x42, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x42, 0x44, 0x38, 0x8, 0x8, 0x10}},
{200, 1, {0x30, 0x10, 0x8, 0xFE, 0x80, 0x80, 0x80, 0xFC, 0x80, 0x80, 0x80, 0x80, 0x80, 0xFE, 0x0, 0x0}},
{201, 1, {0x18, 0x10, 0x20, 0xFE, 0x80, 0x80, 0x80, 0xFC, 0x80, 0x80, 0x80, 0x80, 0x80, 0xFE, 0x0, 0x0}},
{202, 1, {0x10, 0x38, 0x44, 0xFE, 0x80, 0x80, 0x80, 0xFC, 0x80, 0x80, 0x80, 0x80, 0x80, 0xFE, 0x0, 0x0}},
{203, 1, {0x44, 0x44, 0x0, 0xFE, 0x80, 0x80, 0x80, 0xFC, 0x80, 0x80, 0x80, 0x80, 0x80, 0xFE, 0x0, 0x0}},
{204, 1, {0x30, 0x10, 0x8, 0x38, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x38, 0x0, 0x0}},
{205, 1, {0x18, 0x10, 0x20, 0x38, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x38, 0x0, 0x0}},
{206, 1, {0x10, 0x38, 0x44, 0x38, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x38, 0x0, 0x0}},
{207, 1, {0x44, 0x44, 0x0, 0x38, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x38, 0x0, 0x0}},
{208, 1, {0x0, 0x70, 0x48, 0x44, 0x44, 0x42, 0x42, 0xF2, 0x42, 0x42, 0x44, 0x44, 0x48, 0x70, 0x0, 0x0}},
{209, 1, {0x34, 0x58, 0x82, 0x82, 0xC2, 0xC2, 0xA2, 0xA2, 0x92, 0x8A, 0x8A, 0x86, 0x86, 0x82, 0x0, 0x0}},
{210, 1, {0x30, 0x10, 0x8, 0x38, 0x44, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x44, 0x38, 0x0, 0x0}},
{211, 1, {0x18, 0x10, 0x20, 0x38, 0x44, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x44, 0x38, 0x0, 0x0}},
{212, 1, {0x10, 0x38, 0x44, 0x38, 0x44, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x44, 0x38, 0x0, 0x0}},
{213, 1, {0x34, 0x58, 0x0, 0x38, 0x44, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x44, 0x38, 0x0, 0x0}},
{214, 1, {0x44, 0x44, 0x0, 0x38, 0x44, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x44, 0x38, 0x0, 0x0}},
{215, 1, {0x0, 0x0, 0x0, 0x0, 0x81, 0x42, 0x24, 0x18, 0x18, 0x24, 0x42, 0x81, 0x0, 0x0, 0x0, 0x0}},
{216, 1, {0x2, 0x2, 0x3C, 0x44, 0x86, 0x8A, 0x8A, 0x92, 0x92, 0xA2, 0xA2, 0xC2, 0x44, 0x78, 0x80, 0x80}},
{217, 1, {0x30, 0x10, 0x8, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x44, 0x38, 0x0, 0x0}},
{218, 1, {0x18, 0x10, 0x20, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x44, 0x38, 0x0, 0x0}},
{219, 1, {0x10, 0x38, 0x44, 0x0, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x44, 0x38, 0x0, 0x0}},
{220, 1, {0x44, 0x44, 0x0, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x44, 0x38, 0x0, 0x0}},
{221, 1, {0x18, 0x10, 0xA2, 0x82, 0x44, 0x44, 0x28, 0x28, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x0, 0x0}},
{222, 1, {0x80, 0x80, 0xF8, 0x84, 0x82, 0x82, 0x84, 0xF8, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x0, 0x0}},
{223, 1, {0x0, 0x78, 0x84, 0x82, 0x82, 0x84, 0xB8, 0x84, 0x82, 0x82, 0x82, 0x82, 0x84, 0xB8, 0x0, 0x0}},
{224, 1, {0x0, 0x30, 0x10, 0x8, 0x0, 0x3C, 0x42, 0x2, 0x3E, 0x42, 0x82, 0x82, 0x86, 0x7A, 0x0, 0x0}},
{225, 1, {0x0, 0x18, 0x10, 0x20, 0x0, 0x3C, 0x42, 0x2, 0x3E, 0x42, 0x82, 0x82, 0x86, 0x7A, 0x0, 0x0}},
{226, 1, {0x0, 0x10, 0x38, 0x44, 0x0, 0x3C, 0x42, 0x2, 0x3E, 0x42, 0x82, 0x82, 0x86, 0x7A, 0x0, 0x0}},
{227, 1, {0x0, 0x34, 0x58, 0x0, 0x0, 0x3C, 0x42, 0x2, 0x3E, 0x42, 0x82, 0x82, 0x86, 0x7A, 0x0, 0x0}},
{228, 1, {0x0, 0x0, 0x24, 0x24, 0x0, 0x3C, 0x42, 0x2, 0x3E, 0x42, 0x82, 0x82, 0x86, 0x7A, 0x0, 0x0}},
{229, 1, {0x0, 0x10, 0x28, 0x10, 0x0, 0x3C, 0x42, 0x2, 0x3E, 0x42, 0x82, 0x82, 0x86, 0x7A, 0x0, 0x0}},
{230, 1, {0x0, 0x0, 0x0, 0x0, 0x0, 0x6C, 0x92, 0x12, 0x3E, 0x50, 0x90, 0x92, 0x92, 0x6C, 0x0, 0x0}},
{231, 1, {0x0, 0x0, 0x0, 0x0, 0x38, 0x44, 0x82, 0x80, 0x80, 0x80, 0x82, 0x44, 0x38, 0x10, 0x10, 0x20}},
{232, 1, {0x0, 0x30, 0x10, 0x8, 0x0, 0x38, 0x44, 0x82, 0x82, 0xFE, 0x80, 0x82, 0x44, 0x38, 0x0, 0x0}},
{233, 1, {0x0, 0x18, 0x10, 0x20, 0x0, 0x38, 0x44, 0x82, 0x82, 0xFE, 0x80, 0x82, 0x44, 0x38, 0x0, 0x0}},
{234, 1, {0x0, 0x10, 0x38, 0x44, 0x0, 0x38, 0x44, 0x82, 0x82, 0xFE, 0x80, 0x82, 0x44, 0x38, 0x0, 0x0}},
{235, 1, {0x0, 0x44, 0x44, 0x0, 0x0, 0x38, 0x44, 0x82, 0x82, 0xFE, 0x80, 0x82, 0x44, 0x38, 0x0, 0x0}},
{236, 1, {0x30, 0x10, 0x8, 0x30, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x0, 0x0}},
{237, 1, {0x18, 0x10, 0x20, 0x30, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x0, 0x0}},
{238, 1, {0x10, 0x38, 0x44, 0x30, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x0, 0x0}},
{239, 1, {0x44, 0x44, 0x0, 0x30, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x0, 0x0}},
{240, 1, {0x0, 0x64, 0x18, 0x30, 0x48, 0x38, 0x44, 0x82, 0x82, 0x82, 0x82, 0x82, 0x44, 0x38, 0x0, 0x0}},
{241, 1, {0x0, 0x34, 0x58, 0x0, 0x0, 0x5C, 0x62, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x0, 0x0}},
{242, 1, {0x0, 0x30, 0x10, 0x8, 0x0, 0x38, 0x44, 0x82, 0x82, 0x82, 0x82, 0x82, 0x44, 0x38, 0x0, 0x0}},
{243, 1, {0x0, 0x18, 0x10, 0x20, 0x0, 0x38, 0x44, 0x82, 0x82, 0x82, 0x82, 0x82, 0x44, 0x38, 0x0, 0x0}},
{244, 1, {0x0, 0x10, 0x38, 0x44, 0x0, 0x38, 0x44, 0x82, 0x82, 0x82, 0x82, 0x82, 0x44, 0x38, 0x0, 0x0}},
{245, 1, {0x0, 0x34, 0x58, 0x0, 0x0, 0x38, 0x44, 0x82, 0x82, 0x82, 0x82, 0x82, 0x44, 0x38, 0x0, 0x0}},
{246, 1, {0x0, 0x44, 0x44, 0x0, 0x0, 0x38, 0x44, 0x82, 0x82, 0x82, 0x82, 0x82, 0x44, 0x38, 0x0, 0x0}},
{247, 1, {0x0, 0x0, 0x0, 0x0, 0x0, 0x10, 0x10, 0x0, 0xFE, 0x0, 0x10, 0x10, 0x0, 0x0, 0x0, 0x0}},
{248, 1, {0x0, 0x0, 0x0, 0x0, 0x0, 0x3A, 0x44, 0x8A, 0x8A, 0x92, 0xA2, 0xA2, 0x44, 0xB8, 0x0, 0x0}},
{249, 1, {0x0, 0x30, 0x10, 0x8, 0x0, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x46, 0x3A, 0x0, 0x0}},
{250, 1, {0x0, 0x18, 0x10, 0x20, 0x0, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x46, 0x3A, 0x0, 0x0}},
{251, 1, {0x0, 0x10, 0x38, 0x44, 0x0, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x46, 0x3A, 0x0, 0x0}},
{252, 1, {0x0, 0x24, 0x24, 0x0, 0x0, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x42, 0x46, 0x3A, 0x0, 0x0}},
{253, 1, {0x0, 0xC, 0x8, 0x10, 0x0, 0x42, 0x42, 0x22, 0x24, 0x14, 0x8, 0x8, 0x10, 0x10, 0x20, 0x40}},
{254, 1, {0x0, 0x0, 0x40, 0x40, 0x40, 0x78, 0x44, 0x42, 0x42, 0x42, 0x44, 0x78, 0x40, 0x40, 0x40, 0x40}},
{255, 1, {0x0, 0x24, 0x24, 0x0, 0x0, 0x42, 0x42, 0x22, 0x24, 0x14, 0x8, 0x8, 0x10, 0x10, 0x20, 0x40}},
{12288, 2, {0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0}},
{0, 0, {0}}
};
/* bigger fonts first, reverse sorted width */
static const struct glyph_t *glyphs[] = {
hd_glyphs,
sd_glyphs,
NULL
};

View File

@@ -370,11 +370,22 @@ void term_die(struct terminal_t *term)
bool term_init(struct terminal_t *term, int width, int height)
{
extern const uint32_t color_list[COLORS]; /* global */
const glyph_t *_glyphs;
term->width = width;
term->height = height;
term->cols = term->width / CELL_WIDTH;
int j = 0;
do {
_glyphs = glyphs[j];
CELL_WIDTH = _glyphs[0].code;
CELL_HEIGHT = _glyphs[0].width;
term->cols = term->width / CELL_WIDTH;
if (term->cols > 79)
break;
j++;
} while (glyphs[j]);
term->lines = term->height / CELL_HEIGHT;
term->esc.size = ESCSEQ_SIZE;
@@ -408,8 +419,8 @@ bool term_init(struct terminal_t *term, int width, int height)
for (uint32_t code = 0; code < UCS2_CHARS; code++)
term->glyph[code] = NULL;
for (uint32_t gi = 0; gi < sizeof(glyphs) / sizeof(struct glyph_t); gi++)
term->glyph[glyphs[gi].code] = &glyphs[gi];
for (uint32_t gi = 1; _glyphs[gi].code > 0; gi++)
term->glyph[_glyphs[gi].code] = &_glyphs[gi];
if (!term->glyph[DEFAULT_CHAR]
|| !term->glyph[SUBSTITUTE_HALF]

View File

@@ -25,6 +25,7 @@
/* maybe on command line? */
#undef DEBUG
#endif
static int CELL_WIDTH, CELL_HEIGHT;
#include "yaft.h"
#include "conf.h"
#include "util.h"