§ Внешний вид


§ Код для Си

Если для AVR, то надо добавить после zxfont[] ключевое слово PROGMEM. Всего 96 символов, начиная с 0x20 и заканчивая 0x7F.
static const unsigned char zxfont[] = {
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
    0x00,0x10,0x10,0x10,0x10,0x00,0x10,0x00,
    0x00,0x24,0x24,0x00,0x00,0x00,0x00,0x00,
    0x00,0x24,0x7E,0x24,0x24,0x7E,0x24,0x00,
    0x00,0x08,0x3E,0x28,0x3E,0x0A,0x3E,0x08,
    0x00,0x62,0x64,0x08,0x10,0x26,0x46,0x00,
    0x00,0x10,0x28,0x10,0x2A,0x44,0x3A,0x00,
    0x00,0x08,0x10,0x00,0x00,0x00,0x00,0x00,
    0x00,0x04,0x08,0x08,0x08,0x08,0x04,0x00,
    0x00,0x20,0x10,0x10,0x10,0x10,0x20,0x00,
    0x00,0x00,0x14,0x08,0x3E,0x08,0x14,0x00,
    0x00,0x00,0x08,0x08,0x3E,0x08,0x08,0x00,
    0x00,0x00,0x00,0x00,0x00,0x08,0x08,0x10,
    0x00,0x00,0x00,0x00,0x3E,0x00,0x00,0x00,
    0x00,0x00,0x00,0x00,0x00,0x18,0x18,0x00,
    0x00,0x00,0x02,0x04,0x08,0x10,0x20,0x00,
    0x00,0x3C,0x46,0x4A,0x52,0x62,0x3C,0x00,
    0x00,0x18,0x28,0x08,0x08,0x08,0x3E,0x00,
    0x00,0x3C,0x42,0x02,0x3C,0x40,0x7E,0x00,
    0x00,0x3C,0x42,0x0C,0x02,0x42,0x3C,0x00,
    0x00,0x08,0x18,0x28,0x48,0x7E,0x08,0x00,
    0x00,0x7E,0x40,0x7C,0x02,0x42,0x3C,0x00,
    0x00,0x3C,0x40,0x7C,0x42,0x42,0x3C,0x00,
    0x00,0x7E,0x02,0x04,0x08,0x10,0x10,0x00,
    0x00,0x3C,0x42,0x3C,0x42,0x42,0x3C,0x00,
    0x00,0x3C,0x42,0x42,0x3E,0x02,0x3C,0x00,
    0x00,0x00,0x00,0x10,0x00,0x00,0x10,0x00,
    0x00,0x00,0x10,0x00,0x00,0x10,0x10,0x20,
    0x00,0x00,0x04,0x08,0x10,0x08,0x04,0x00,
    0x00,0x00,0x00,0x3E,0x00,0x3E,0x00,0x00,
    0x00,0x00,0x10,0x08,0x04,0x08,0x10,0x00,
    0x00,0x3C,0x42,0x04,0x08,0x00,0x08,0x00,
    0x00,0x3C,0x4A,0x56,0x5E,0x40,0x3C,0x00,
    0x00,0x3C,0x42,0x42,0x7E,0x42,0x42,0x00,
    0x00,0x7C,0x42,0x7C,0x42,0x42,0x7C,0x00,
    0x00,0x3C,0x42,0x40,0x40,0x42,0x3C,0x00,
    0x00,0x78,0x44,0x42,0x42,0x44,0x78,0x00,
    0x00,0x7E,0x40,0x7C,0x40,0x40,0x7E,0x00,
    0x00,0x7E,0x40,0x7C,0x40,0x40,0x40,0x00,
    0x00,0x3C,0x42,0x40,0x4E,0x42,0x3C,0x00,
    0x00,0x42,0x42,0x7E,0x42,0x42,0x42,0x00,
    0x00,0x3E,0x08,0x08,0x08,0x08,0x3E,0x00,
    0x00,0x02,0x02,0x02,0x42,0x42,0x3C,0x00,
    0x00,0x44,0x48,0x70,0x48,0x44,0x42,0x00,
    0x00,0x40,0x40,0x40,0x40,0x40,0x7E,0x00,
    0x00,0x42,0x66,0x5A,0x42,0x42,0x42,0x00,
    0x00,0x42,0x62,0x52,0x4A,0x46,0x42,0x00,
    0x00,0x3C,0x42,0x42,0x42,0x42,0x3C,0x00,
    0x00,0x7C,0x42,0x42,0x7C,0x40,0x40,0x00,
    0x00,0x3C,0x42,0x42,0x52,0x4A,0x3C,0x00,
    0x00,0x7C,0x42,0x42,0x7C,0x44,0x42,0x00,
    0x00,0x3C,0x40,0x3C,0x02,0x42,0x3C,0x00,
    0x00,0xFE,0x10,0x10,0x10,0x10,0x10,0x00,
    0x00,0x42,0x42,0x42,0x42,0x42,0x3C,0x00,
    0x00,0x42,0x42,0x42,0x42,0x24,0x18,0x00,
    0x00,0x42,0x42,0x42,0x42,0x5A,0x24,0x00,
    0x00,0x42,0x24,0x18,0x18,0x24,0x42,0x00,
    0x00,0x82,0x44,0x28,0x10,0x10,0x10,0x00,
    0x00,0x7E,0x04,0x08,0x10,0x20,0x7E,0x00,
    0x00,0x0E,0x08,0x08,0x08,0x08,0x0E,0x00,
    0x00,0x00,0x40,0x20,0x10,0x08,0x04,0x00,
    0x00,0x70,0x10,0x10,0x10,0x10,0x70,0x00,
    0x00,0x10,0x38,0x54,0x10,0x10,0x10,0x00,
    0x00,0x00,0x00,0x00,0x00,0x00,0x00,0xFF,
    0x00,0x1C,0x22,0x78,0x20,0x20,0x7E,0x00,
    0x00,0x00,0x38,0x04,0x3C,0x44,0x3C,0x00,
    0x00,0x20,0x20,0x3C,0x22,0x22,0x3C,0x00,
    0x00,0x00,0x1C,0x20,0x20,0x20,0x1C,0x00,
    0x00,0x04,0x04,0x3C,0x44,0x44,0x3C,0x00,
    0x00,0x00,0x38,0x44,0x78,0x40,0x3C,0x00,
    0x00,0x0C,0x10,0x18,0x10,0x10,0x10,0x00,
    0x00,0x00,0x3C,0x44,0x44,0x3C,0x04,0x38,
    0x00,0x40,0x40,0x78,0x44,0x44,0x44,0x00,
    0x00,0x10,0x00,0x30,0x10,0x10,0x38,0x00,
    0x00,0x04,0x00,0x04,0x04,0x04,0x24,0x18,
    0x00,0x20,0x28,0x30,0x30,0x28,0x24,0x00,
    0x00,0x10,0x10,0x10,0x10,0x10,0x0C,0x00,
    0x00,0x00,0x68,0x54,0x54,0x54,0x54,0x00,
    0x00,0x00,0x78,0x44,0x44,0x44,0x44,0x00,
    0x00,0x00,0x38,0x44,0x44,0x44,0x38,0x00,
    0x00,0x00,0x78,0x44,0x44,0x78,0x40,0x40,
    0x00,0x00,0x3C,0x44,0x44,0x3C,0x04,0x06,
    0x00,0x00,0x1C,0x20,0x20,0x20,0x20,0x00,
    0x00,0x00,0x38,0x40,0x38,0x04,0x78,0x00,
    0x00,0x10,0x38,0x10,0x10,0x10,0x0C,0x00,
    0x00,0x00,0x44,0x44,0x44,0x44,0x38,0x00,
    0x00,0x00,0x44,0x44,0x28,0x28,0x10,0x00,
    0x00,0x00,0x44,0x54,0x54,0x54,0x28,0x00,
    0x00,0x00,0x44,0x28,0x10,0x28,0x44,0x00,
    0x00,0x00,0x44,0x44,0x44,0x3C,0x04,0x38,
    0x00,0x00,0x7C,0x08,0x10,0x20,0x7C,0x00,
    0x00,0x0E,0x08,0x30,0x08,0x08,0x0E,0x00,
    0x00,0x08,0x08,0x08,0x08,0x08,0x08,0x00,
    0x00,0x70,0x10,0x0C,0x10,0x10,0x70,0x00,
    0x00,0x14,0x28,0x00,0x00,0x00,0x00,0x00,
    0x3C,0x42,0x99,0xA1,0xA1,0x99,0x42,0x3C
};

§ Конвертер PHP

$im = imagecreatetruecolor(128,48);
for ($i = 0; $i < 96; $i++)
for ($j = 0; $j < 8; $j++)
for ($k = 0; $k < 8; $k++)
    imagesetpixel($im,
        ($i & 15)*8 + $k,
        ($i >> 4)*8 + $j,
        ($font[8*$i+$j] << $k) & 128 ? 0x000000 : 0xcccccc);

imagepng($im, "zxfont.png");
21 дек, 2022
© 2007-2023 Психичная ручка сидела