求怎么在函数里调整中文显示的行间距
- void OLED_ShowChinese12x12(unsigned char x,unsigned char y,unsigned char *s,unsigned char sizey,unsigned char mode)
- {
- unsigned char i,j,k,DATA=0;
- unsigned short HZnum;
- unsigned char TypefaceNum;
- volatile unsigned char b=0;
- x/=2;
- TypefaceNum=(sizey/8+((sizey%8)?1:0))*sizey;//字符所占字节数
- HZnum=sizeof(tfont12)/sizeof(typFNT_GB12); //统计汉字库数目
- // Column_Address(x,x+sizey/2-1);
- // Row_Address(y,y+sizey-1);
- b=x+16/2-1;
- Column_Address(x,b);
- Row_Address(y,y+12-1);
- for(k=0;k<HZnum;k++)
- {
- if ((tfont12[k].Index[0]==*(s))&&(tfont12[k].Index[1]==*(s+1)))
- {
- for(i=0;i<TypefaceNum;i++)
- {
- for(j=0;j<4;j++)
- {
- if(tfont12[k].Msk[i]&(0x01<<(j*2+0)))
- {
- DATA=0xf0;
- }
- if(tfont12[k].Msk[i]&(0x01<<(j*2+1)))
- {
- DATA|=0x0f;
- }
- if(mode)
- {
- OLED_WR_Byte(~DATA);
- }else
- {
- OLED_WR_Byte(DATA);
- }
- DATA=0;
- }
- }
- }
- continue; //查找到对应点阵字库立即退出,防止多个汉字重复取模带来影响
- }
- }
复制代码
|