当前位置:网站首页>The Chinese and English dot matrix character display principle of the 111th blog of the fledgling Xiao Li
The Chinese and English dot matrix character display principle of the 111th blog of the fledgling Xiao Li
2022-07-23 07:54:00 【Fledgling Xiao Li】
Character Introduction
Characters are divided into Chinese characters and English characters , English characters are what we often say ASCII character , Chinese characters refer to Chinese characters and some commonly used Chinese characters and symbols
Display principle
In fact, to display a character on an embedded display device is essentially punctuation , By drawing the shape of this character in a certain area, the shape of this character is displayed .
English characters

Here with this character “H” For example , It can be found in total 816 A character is displayed in the small grid of , The first line is not displayed , The second line also does not show , The third line is the same , The fourth line is displayed or not If we code the display as 1, Code the places that are not displayed as 0 Then the first row of data can be bynema 00000000, The second line of data is also 00000000, The third line is the same 00000000, In the fourth row 111001111, In this way, 16 rows of data can be represented in this way , Then the data of these sixteen lines is H The font encoding data of this character , We usually write these data in hexadecimal , For example, the first line is written 0x00, The second line is also 0x00, By analogy , With 16 For example, a total of 816 A grid point is 16 Bytes of data , Because a byte is eight grid points .
Chinese characters

Same thing , But the difference is that the same character occupies different lattice points , The number of bytes needed here becomes 16*16 individual , The number of bytes has also become 32 Bytes . Similarly, the font data is 32 Bytes .
ASCII Character set
hold ASCII Font of characters ( Regular byte data ) Making a set is ASCII Character set .
Chinese character set
Put the font of Chinese characters ( Regular byte data ) Making a set is Chinese character set . Common Chinese character sets are GB2312 Character set GBK Character sets and so on .
Library files
Write the data of the character set into a file, which is called a font file , There are separate ASCII Font files also have , There is also a separate Chinese font file , There is also a character file composed of the two .

Reading and displaying character files

English character display

Chinese character display

According to the effect
english 
chinese 
Display code
int main(void)
{
char ch = 'A';
char BUFF[2] = {
" Li "};
uint8_t AB = 0x00;
uint8_t CD = 0x00;
int ZK_NUM = 0;
int GB2312_NUM = 0;
int ASCII_NUM = 0;
char *p = &BUFF[0];
int i = 0;
AB = (uint8_t)*p;
CD = ((uint8_t)*(p+1));
//GB2312_NUM = ((AB-0xa1)*94+(CD-0xa0)-1);
printf("%X %X %d \r\n",AB,CD,GB2312_NUM); //fseek(fp,(1445*32),SEEK_SET);
char Table_Text[32]={
0};
//FILE *fp0 = fopen("C:/Users/23206/Desktop/ASC16.bin","r+");
//FILE *fp1 = fopen("C:/Users/23206/Desktop/HZK16.bin","r+");
FILE *fp = fopen("C:/Users/23206/Desktop/ZK16.bin","r+");
for(ZK_NUM = 128;ZK_NUM<150;ZK_NUM++)
{
printf("\r\n*GB2312_16_16_ZK The first %-4d Character font *\n",ZK_NUM);
printf("\n");
if(ZK_NUM*16<0x00000806)
{
printf("\r\n*GB2312_16_16_ZK The first %-4d English font *\n",ASCII_NUM);
fseek(fp,(ASCII_NUM*16),SEEK_SET);
fgets(&Table_Text[0],16+1,fp);
Printf_ASCII(&Table_Text[0],16);
ASCII_NUM++;
printf("ASCII_NUM = %d\r\n",ASCII_NUM);
}
else
{
printf("\r\n*GB2312_16_16_ZK The first %-4d Chinese font *\n",GB2312_NUM);
fseek(fp,((GB2312_NUM)*32+0x00000806),SEEK_SET);
fgets(&Table_Text[0],32+1,fp);
Printf_HZ(&Table_Text[0],16);
GB2312_NUM++;
printf("GB2312_NUM = %d\r\n",GB2312_NUM);
}
printf("\n");
mssleep(10);
//sleep(1);
}
fclose(fp);
return 0;
}
边栏推荐
- Wechat campus second-hand book trading applet graduation design finished product (8) graduation design thesis template
- 【开发技术】SpingBoot数据库与持久化技术,JPA,MongoDB,Redis
- Information system project managers must recite the core examination points (49) contract law
- 多传感器融合综述---FOV与BEV
- LAN SDN technology hard core insider 5 implementation of virtualized network
- Here comes the genuine Adobe software! Adobe's only genuine family bucket subscription in the world costs only 0 yuan / year
- 升级poi-tl版本1.12.0与旧版poi(4.1.2)、easyexcel之间的依赖冲突解决
- (五)数电——公式化简法
- 不会吧?钉钉都下载了,你还不知道可以这样玩?
- LAN SDN technology hard core insider 6 distributed anycast gateway
猜你喜欢
随机推荐
网络安全之ARP欺骗防护
Codeforces Round #809 (Div. 2)(C和D1两题)
LeetCode(剑指 Offer)- 11. 旋转数组的最小数字
延伸联接边界,扩展业务范围,全面迈向智能云网2.0时代
文件上传,服务器文件名中文乱码文件上传,服务器文件名中文乱码
亚马逊旗下Zoox通过安全测试 并在加州申请试驾
大厂底层必修:“应用程序与 AMS 的通讯实现”
FastAPI学习(二)——FastAPI+Jinjia2模板渲染网页(跳转返回渲染页面)
初出茅庐的小李第109篇博客之如何打开Keil中文件的真是路径
Fastapi learning (II) -- fastapi+jinjia2 template rendering web page (jump back to the rendering page)
Talk about 12 business scenarios of concurrent programming
程序员最想干的三件事 |漫画
Problems encountered in punching
如何优雅的改变this指向
景联文科技提供3D点云-图像标注服务
C语音实现tcp客户端和tcp服务端,Qt调用测试
工作流引擎在vivo营销自动化中的应用实践
“蔚来杯“2022牛客暑期多校训练营1 (部分题目总结)
pny 文件转图片
Could NOT find Doxygen (missing: DOXYGEN_EXECUTABLE)









