64x128 English font modulo description

From LCD wiki
Jump to: navigation, search
  • 64x128 English font modulo description
The size settings are as shown below:
Module-025.png
The modulo data is as follows (click to open):
64x128 English ASCII modulo data
The function is defined as follows:
void LCD_Show_12864_char(u16 x,u16 y,u16 fc, u16 bc, u8 num,u8 mode)
{
    u32 temp;
    u8 pos,t,i;
    u16 colortemp=POINT_COLOR;      		   
    num=num-' ';//Get the offset value
    LCD_SetWindows(x,y,x+64-1,y+128-1);//Set a single text display window
    if(!mode) //Non-overlay mode: The font has a background color, which will overwrite the original display
    {		
	for(pos=0;pos<128;pos++)
	{
	    for(i=0;i<2;i++)
	    {
	        temp = (asc2_12864[num][pos*8+i*4]<<24)|(asc2_12864[num][pos*8+i*4+1]<<16)|(asc2_12864[num][pos*8+i*4+2]<<8)|asc2_12864[num][pos*8+i*4+3];//Call 12864 font, you need to take the model definition
	        for(t=0;t<32;t++)
	        {                 
		    if(temp&0x80000000)
		    {
		        Lcd_WriteData_16Bit(fc);
		    }
		    else 
		    {
		        Lcd_WriteData_16Bit(bc); 
		    }
		    temp<<=1;
	        }
            }		
	}	
    }
    else//Overlay mode: the font does not have a background color, and is directly superimposed and displayed on the original display content
    {
        for(pos=0;pos<128;pos++)
	{
	     for(i=0;i<2;i++)
	     {
	         temp = (asc2_12864[num][pos*8+i*4]<<24)|(asc2_12864[num][pos*8+i*4+1]<<16)|(asc2_12864[num][pos*8+i*4+2]<<8)|asc2_12864[num][pos*8+i*4+3];//Call 12864 font, you need to take the model definition
	         for(t=0;t<32;t++)
	         {   
		     POINT_COLOR=fc;              
		     if(temp&0x80000000)
		     {
		         LCD_DrawPoint(x+i*32+t,y+pos);//Draw a point      
		     }
		     temp<<=1;
	        }
	    }
	}
    }
    POINT_COLOR=colortemp;	
    LCD_SetWindows(0,0,lcddev.width-1,lcddev.height-1);//Restore window to full screen  
}