/********************************************************************
*8*8ASC码字模头文件
*右转90度ASC字模
*Modify:2005-3-16 14:31
********************************************************************/
const int8 font_blank_table[FONT_BLANK_TABLE_SIZE] = {
0x00,0x00,0x00,0x00,0x00 // blank
};
const int8 font_number_table[FONT_NUMBER_TABLE_SIZE] = {
0x7C,0xA2,0x92,0x8A,0x7C, // 0
0x00,0x84,0xFE,0x80,0x00, // 1
0xC4,0xA2,0x92,0x8A,0x84, // 2
0x42,0x82,0x8A,0x96,0x62, // 3
0x30,0x28,0x24,0xFE,0x20, // 4
0x4E,0x8A,0x8A,0x8A,0x72, // 5
0x78,0x94,0x92,0x92,0x60, // 6
0x02,0xE2,0x12,0x0A,0x06, // 7
0x6C,0x92,0x92,0x92,0x6C, // 8
0x0C,0x92,0x92,0x52,0x3C // 9
};
const int8 font_uletter_table[FONT_UPPER_CASE_TABLE_SIZE] = {
0xFC,0x22,0x22,0x22,0xFC, // A
0xFE,0x92,0x92,0x92,0x6C, // B
0x7C,0x82,0x82,0x82,0x44, // C
0xFE,0x82,0x82,0x44,0x38, // D
0xFE,0x92,0x92,0x92,0x82, // E
0xFE,0x12,0x12,0x12,0x02, // F
0x7C,0x82,0x92,0x92,0x74, // G
0xFE,0x10,0x10,0x10,0xFE, // H
0x00,0x82,0xFE,0x82,0x00, // I
0x40,0x80,0x82,0x7E,0x02, // J
0xFE,0x10,0x28,0x44,0x82, // K
0xFE,0x80,0x80,0x80,0x80, // L
0xFE,0x04,0x18,0x04,0xFE, // M
0xFE,0x08,0x10,0x20,0xFE, // N
0x7C,0x82,0x82,0x82,0x7C, // O
0xFE,0x12,0x12,0x12,0x0C, // P
0x7C,0x82,0xA2,0x42,0xBC, // Q
0xFE,0x12,0x32,0x52,0x8C, // R
0x4C,0x92,0x92,0x92,0x64, // S
0x02,0x02,0xFE,0x02,0x02, // T
0x7E,0x80,0x80,0x80,0x7E, // U
0x3E,0x40,0x80,0x40,0x3E, // V
0x7E,0x80,0x70,0x80,0x7E, // W
0xC6,0x28,0x10,0x28,0xC6, // X
0x0E,0x10,0xE0,0x10,0x0E, // Y
0xC2,0xA2,0x92,0x8A,0x86 // Z
};
const int8 font_lletter_table[FONT_LOWER_CASE_TABLE_SIZE] = {
0x40,0xA8,0xA8,0xA8,0xF0, // a
0xFE,0x88,0x88,0x88,0x70, // b
0x70,0x88,0x88,0x88,0x88, // c
0x70,0x88,0x88,0x88,0xFE, // d
0x70,0xA8,0xA8,0xA8,0x10, // e
0x08,0x08,0xFC,0x0A,0x0A, // f
0x10,0xA8,0xA8,0xA8,0x78, // g
0xFE,0x10,0x08,0x08,0xF0, // h
0x00,0x88,0xFA,0x80,0x00, // i
0x40,0x80,0x88,0x7A,0x00, // j
0xFE,0x20,0x50,0x88,0x00, // k
0x00,0x82,0xFE,0x80,0x00, // l
0xF8,0x08,0xF8,0x08,0xF0, // m
0xF8,0x10,0x08,0x08,0xF0, // n
0x70,0x88,0x88,0x88,0x70, // o
0xF8,0x28,0x28,0x28,0x10, // p
0x10,0x28,0x28,0x28,0xF8, // q
0xF8,0x10,0x08,0x08,0x00, // r
0x90,0xA8,0xA8,0xA8,0x48, // s
0x08,0x08,0x7E,0x88,0x88, // t
0x78,0x80,0x80,0x40,0xF8, // u
0x38,0x40,0x80,0x40,0x38, // v
0x78,0x80,0x60,0x80,0x78, // w
0x88,0x50,0x20,0x50,0x88, // x
0x18,0xA0,0xA0,0xA0,0x78, // y
0x88,0xC8,0xA8,0x98,0x88 // z
};
void get_font_matrix(int8 ascii_code, int8 *buf)
{
int8 i;
int8 base;
if(ascii_code == ' ')
{
for(i=0, base=0; i < FONT_WIDTH; i++)
{
*(buf+i) = font_blank_table[ base + i];
}
}
else if(ascii_code >= '0' && ascii_code <= '9')
{
for(i=0, base = (ascii_code - '0') * FONT_WIDTH; i < FONT_WIDTH; i++)
{
*(buf+i) = font_number_table[ base + i];
}
}
else if(ascii_code >= 'A' && ascii_code <= 'Z')
{
for(i=0, base = (ascii_code - 'A') * FONT_WIDTH; i < FONT_WIDTH; i++)
{
*(buf+i) = font_uletter_table[ base + i];
}
}
else
{
for(i=0, base = (ascii_code - 'a') * FONT_WIDTH; i < FONT_WIDTH; i++)
{
*(buf+i) = font_uletter_table[ base + i];
}
}
}