8x16 English font modulo description
来自LCD wiki
- 8x16英文字体取模说明
void LCD_Show_1608_char(u16 x,u16 y,u16 fc, u16 bc, u8 num,u8 mode) { u8 temp; u8 pos,t; u16 colortemp=POINT_COLOR; num=num-' ';//得到偏移后的值 LCD_SetWindows(x,y,x+8-1,y+16-1);//设置单个文字显示窗口 if(!mode) //非叠加方式:字体带有背景色,显示时会将原来显示的内容覆盖掉 { for(pos=0;pos<16;pos++) { temp = asc2_1608[num][pos];//调用1608字体,需要自己取模定义 for(t=0;t<8;t++) { if(temp&0x80) { Lcd_WriteData_16Bit(fc); } else { Lcd_WriteData_16Bit(bc); } temp<<=1; } } } else//叠加方式:字体不带背景色,直接叠加显示到原来显示的内容上 { for(pos=0;pos<16;pos++) { temp = asc2_1608[num][pos];//调用1608字体,需要自己取模定义 for(t=0;t<8;t++) { POINT_COLOR=fc; if(temp&0x80) { LCD_DrawPoint(x+t,y+pos);//画一个点 } temp<<=1; } } } POINT_COLOR=colortemp; LCD_SetWindows(0,0,lcddev.width-1,lcddev.height-1);//恢复窗口为全屏 }