• sales

    +86-0755-88291180

16x16 Chinese font modulo description

16x16 Chinese font modulo description

The size settings are as shown below:
After the modulo is successful, you need to define the following structure array to store the modulo data (the definition of structure is in the Chinese_and_English_display_modulo_settings):
const typFNT_GB16 tfont16[]=   
{
  "中",0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,0x3F,0xF8,0x21,0x08,0x21,0x08,0x21,0x08,
  0x21,0x08,0x21,0x08,0x3F,0xF8,0x21,0x08,0x01,0x00,0x01,0x00,0x01,0x00,0x01,0x00,
};
The function is defined as follows:
void GUI_DrawFont16(u16 x, u16 y, u16 fc, u16 bc, u8 *s,u8 mode)
{
   u8 i,j;
   u16 k;
   u16 HZnum;
   u16 x0=x;
   HZnum=sizeof(tfont16)/sizeof(typFNT_GB16);	//Automatic statistics of the number of Chinese characters
   for (k=0;k<HZnum;k++) 
   {
       if((tfont16[k].Index[0]==*(s))&&(tfont16[k].Index[1]==*(s+1)))
       { 	
           LCD_SetWindows(x,y,x+16-1,y+16-1);
	   for(i=0;i<16*2;i++)
           {
		for(j=0;j<8;j++)
		{	
		     if(!mode) //Non-overlay mode: The font has a background color, which will overwrite the original display
		     {
			  if(tfont16[k].Msk[i]&(0x80>>j))
                          {	
                               Lcd_WriteData_16Bit(fc);
                          }			  
                          else 
                          {
                               Lcd_WriteData_16Bit(bc);
			  }
		     }
		     else //Overlay mode: the font does not have a background color, and is directly superimposed and displayed on the original display content
		     {
			  POINT_COLOR=fc;
			  if(tfont16[k].Msk[i]&(0x80>>j))						
                          {
                               LCD_DrawPoint(x,y);//Draw a point  
			  }
			  x++;
			  if((x-x0)==16)
			  {
			       x=x0;
			       y++;
			       break;
			  }
		     }
	        }
	    }
	 }				  	
	 continue;  //Find the corresponding dot matrix font to exit immediately, to prevent the impact of multiple Chinese characters repeated modulo
    }
    LCD_SetWindows(0,0,lcddev.width-1,lcddev.height-1);//Restore window to full screen
}

TAG: Code Raspberry Pi display Raspberry Pi Pico 2 RP2350 1.47 inch LCD Display Development board RP2350A 1.47inch Screen RGB color $8.5 X1007 Raspberry Pi 5 PCIe to Dual 2.5" SATA HDD/SSD Double-SATA (NOT BOOT From SATA/SSD series bus servos ESP32-S3 Development Board 4 inch LCD TouchScreen Display 480x480 RS485 /SHT20 /Relay For Arduino LVGL 86 TVbox 8.2inch Round LCD HDMI Capacitive 8.2 inch Touchscreen Display 1080x1080 For Raspberry Pi/Jetson Nano/mini PC 7inch Round LCD HDMI Capacitive 7 inch Touchscreen Display 1080x1080 For Raspberry Pi/Jetson Nano/mini PC ESP32-S3 LCD Mini tiny Development Board 0.85 inch Display 0.85inch Screen 128x128 SD-Port For Arduino ESP32 S3 Development Board 3.5 inch LCD Capacitive Touch Screen 3.5inch Display 320×480 N16R8 1.46inch LCD TouchScreen Display 412×412 SPD2010 For Arduino /Raspberry Pi /ESP32 /Pico /STM32 Information Raspberry Pi Pico 2 RP2350B 3.49-inch capacitive TouchCcree 3.49inch LCD display development board 172×640 ESP32-S3 AI RGB Matrix Driver Board Dual Microphone DeepSeek Raspberry Pi 5 Sound Raspberry Pi 5 PCIe to 2.5G Ethernet Adapter Board Plug and Play Raspberry Pi 5 PCM5122 I2S Audio Card DAC Also For PI4 /PI3 /Zero Series Raspberry Pi Pico 2 RP2350 1.47 inch LCD B Display Development board RP2350A 1.47inch Screen RGB color Raspberry Pi Pico 2 Tiny RP2350B RP2350-Linux Mini Development Board with PSRAM-8MB Or Without PSRAM Raspberry Pi 15.6 inch FHD Monitor (C) LCD 1080P Capacitive TouchScreen Display Type-C/HDMI For Computer PC