In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly explains "the method of displaying Chinese characters with embedded Linux_Framebuffer_04 dot matrix". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Now let the editor to take you to learn the "embedded Linux_Framebuffer_04 dot matrix display of Chinese characters" bar!
The process of displaying Chinese characters is the same as that of ASCII characters.
Determine the Chinese characters to be displayed
Find the dot matrix data of the corresponding Chinese characters in the font
Use the trace function to draw the dot matrix data of Chinese characters, but unlike the display of ASCII characters, Chinese characters need to pay attention to the coding mode of Chinese characters. There is also a difference between the coding mode of the C code source file and the coding method of the Chinese characters in the compiled program. Note: generally use ANSI or UTF-8 encoding instead of UTF-16 encoding, because the UTF-16 encoding ASCII character is also 2 bytes, at this time one byte is 0, in C language 0 represents the end of the string is easy to cause misunderstanding.
When writing a C program, regardless of the ANSI or UTF8 encoding used by the source code, you can use the-finput-charset=GB2312 option to inform the compiler of the encoding method used by the source code when compiling. If this option is not used, GCC will default to the source code encoding method of UTF-8;. In addition, you can use-fexec-charset=GB2312 to set the characters in the compiled executable program to be UTF8 encoding. If the actual encoding of the source code is different from that specified by-finput-charset, and the executable program compiled by the latter is different from the coding specified by-fexec-charset, the compiler will convert the coding format.
Chinese character location code
The dot matrix font of commonly used Chinese characters is HZK16. Each Chinese character in HZK16 is described with 32 bytes, as shown in the following figure:
As with the ASCII dot matrix font, each bit in 32 bytes represents a pixel, with a value of 1 for lighting and 0 for turning off.
In HZK16, the GB2312 code value is used to find the dot matrix. take the middle word as an example, its code value is 0xd6d0.
0xd6 stands for area code, indicating in: 0xd6-0xa1 area [there are 94 Chinese characters in each area]
0xd0 represents the bitcode, indicating that it is the 0xd0-0xa1 character in this area.
Location codes do not start with 0xa1 from 0 to be compatible with ASCII codes. So the word "medium" to be displayed is HZK16 0xd6-0xa1 * 94 + (0xd0-0xa1) characters. Sample source code
At this point, I believe you have a deeper understanding of the "embedded Linux_Framebuffer_04 dot matrix display method of Chinese characters", might as well come to the actual operation of it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.