Please put hzk16 and this program in the same directory.
This is a very useful 16*16 dot matrix Chinese character library, and the compressed package contains detailed instructions for use.
Let me briefly explain the principle of dot matrix Chinese character display here:
The display of dot matrix Chinese characters is actually drawing dots on the screen. Taking 16*16 dot matrix Chinese characters as an example, a Chinese character is limited to a square composed of 16*16 dots. Chinese characters are displayed by whether the point is displayed on the screen.
When using the Chinese character library, the position of the Chinese character in the Chinese character library is determined by the area code and bit code, and then 32 bytes are read out continuously. These 32 bytes are arranged in 16 lines, with 2 bytes in each line.
If this bit in a byte is 1, use the foreground color to draw a pixel on the screen, otherwise it will not be drawn, so that a Chinese character can be displayed.
As long as there is the idea that the screen is composed of pixels and shifted, it is completely possible to display Chinese characters in Western languages.
I hope that the display of Chinese characters can give you a better understanding of the C language.
16*16 font model:
Calculate the HZK16 offset address. The internal code is ABCD (AB is first, which is the area code) ADDRESS=[(AB-0xa1)*94 (base array)+(CD-0xa1)]*32( hex array)
The order of appearance in the model is high:
it works
it works
it works