本帖最后由 yxxcf 于 2011-3-23 22:09 编辑
// ------------------ 汉字字模的数据结构定义 ------------------------ //
typedef struct typFNT_GB16 // 汉字字模数据结构
{
signed char Index[2]; // 汉字内码索引
char Msk[32]; // 点阵码数据
};
/////////////////////////////////////////////////////////////////////////
// 汉字字模表 //
// 汉字库: 宋体16.dot 纵向取模下高位,数据排列:从左到右从上到下 //
/////////////////////////////////////////////////////////////////////////
struct typFNT_GB16 code GB_16[] = // 数据表
{
"中", 0x00,0xF8,0x08,0x08,0x08,0x08,0x08,0xFF,
0x08,0x08,0x08,0x08,0x08,0xFC,0x08,0x00,
0x00,0x03,0x01,0x01,0x01,0x01,0x01,0xFF,
0x01,0x01,0x01,0x01,0x01,0x03,0x00,0x00,
"华", 0x00,0x40,0x20,0x10,0xFC,0x03,0x40,0x20,
0x10,0xFF,0x08,0x04,0x06,0xC0,0x00,0x00,
0x04,0x04,0x04,0x04,0x05,0x04,0x04,0xFF,
0x04,0x04,0x05,0x05,0x05,0x05,0x04,0x00,
"人", 0x00,0x00,0x00,0x00,0x00,0x00,0x80,0x7F,
0x80,0x00,0x00,0x00,0x00,0x00,0x00,0x00,
0x00,0x80,0x40,0x20,0x10,0x0C,0x03,0x00,
0x03,0x0C,0x10,0x20,0x40,0xC0,0x40,0x00,
"民", 0x00,0xFE,0x22,0x22,0x22,0x22,0xE2,0x22,
0x22,0x22,0x22,0x3F,0x82,0x00,0x00,0x00,
0x00,0xFF,0x41,0x21,0x11,0x01,0x03,0x0D,
0x11,0x21,0x41,0x41,0x81,0x81,0xE0,0x00,
"共", 0x00,0x10,0x10,0x10,0xFF,0x10,0x10,0x10,
0x10,0x10,0xFF,0x10,0x18,0x10,0x00,0x00,
0x04,0x04,0x84,0x44,0x27,0x34,0x04,0x04,
0x04,0x14,0x27,0x64,0xC4,0x06,0x04,0x00,
"和", 0x20,0x24,0x24,0xA4,0xFC,0x22,0x33,0x22,
0xF0,0x10,0x10,0x10,0x10,0xF8,0x10,0x00,
0x10,0x08,0x06,0x01,0xFF,0x01,0x06,0x00,
0x3F,0x10,0x10,0x10,0x10,0x3F,0x00,0x00,
"国", 0x00,0xFE,0x02,0x0A,0x8A,0x8A,0x8A,0xFA,
0x8A,0xCA,0x8E,0x0A,0x02,0xFF,0x02,0x00,
0x00,0xFF,0x40,0x50,0x50,0x50,0x50,0x5F,
0x50,0x52,0x54,0x50,0x40,0xFF,0x00,0x00
};
例:uchar code s1[]="共和国";
液晶字模如上,请问:
如何利用内码索引确认字符串中每个字在字模表中的位置? |