A very simple small program demonstrates how to display the dot matrix font. If you have time, explain it again.
# Include <stdio. h> # include <stdlib. h> struct hzkinfostruct {int hzkselect; int hzksquare; char * filename; file * file; int martixbytescount; unsigned char * pmatrix;}; typedef struct hzkinfostruct hzkinfo; void selecthzk (hzkinfo * records); void loadhzkinfo (hzkinfo * phzkinfo); void records (hzkinfo); void getquwh (unsigned char * chineaseword, int * Qu, int * Wh ); void fillmartix (hzkinfo * phzkinf O, const int Qu, const int Wh); void printmartix (hzkinfo); int _ tmain (INT argc, _ tchar * argv []) {unsigned char chinamoocs [3] = ""; hzkinfo; int qu; int Wh; selecthzk (& hzkinfo); If (hzkinfo. file = NULL | hzkinfo. pmatrix = NULL) {printf ("hzk loading failed. will exit now. \ n "); goto exit;} getquwh (chinquwh, & Qu, & Wh); fillmartix (& hzkinfo, Qu, Wh); printmartix (hzkinfo); Exit: cleanuphzkinfo (hzkinfo); Return 0;} void getquwh (unsigned char * chineaseword, int * Qu, int * Wh) {* Qu = chineaseword [0]-0xa0; * wh = chineaseword [1]-0xa0;} void fillmartix (hzkinfo * phzkinfo, const int Qu, const int Wh) {fseek (phzkinfo-> file, (94 * (qu-1) + (Wh-1) * phzkinfo-> martixbytescount, seek_set); fread (phzkinfo-> pmatrix, phzkinfo-> martixbytescount, 1, phzkinfo-> file);} void printmartix (hzkinfo) {int I, j, K; int I _steps = hzkinfo. hzksquare/8; unsigned char * pmatrix = hzkinfo. pmatrix; printf ("\ n"); For (j = 0; j
Demo effect:
Use a 16*16 Font:
Use a 32*32 Font: