user-0 提问: 根据多字节字符串，怎么从freetype里面获取中文字符的位图

回复:
user: user-0
content: 首先，非常感谢赵4老师的热心。因为技术不够强大，加上最近比较忙，对老师提供的代码没有理解透彻。然后在网上找到了另一种方法。后面有空了，我再贴出来。先把帖子结了。

user: user-1
content: 我也遇到同样问题了，请问您找的另一种方法是怎么解决的

user: user-2
content: 再供参考： #include <stdio.h> #include <conio.h> const unsigned char bit[8]={128,64,32,16,8,4,2,1}; unsigned char buffer[32]; FILE *hzk; unsigned long offset; unsigned int q,w; int x,y,qw; //-------------------------------------------------------- void display(char *hz) {      qw=*((int *)hz);     q=(qw&0x00FF)-0xA1;     w=((qw>>8)&0x00FF)-0xA1;     offset=q*0x5E+w;     offset*=32;     if ((hzk=fopen("HZK16","rb"))==NULL) {         printf("Can not open file HZK16!\n");         return;     }     fseek(hzk,offset,SEEK_SET);     fread(buffer,1,32,hzk);     fclose(hzk);     for (y=0;y<16;y++) {         for (x=0;x<16;x++) {             if (buffer[y*2+x/8] & bit[x%8]) {                 printf("%s",hz);             } else {                 printf("  ");             }         }         printf("\n");     } } void main() {     display("啊");     getch(); } //                          啊 //    啊  啊啊啊啊  啊啊啊啊啊啊 //啊啊啊啊啊    啊          啊 //啊  啊  啊    啊          啊 //啊  啊  啊  啊        啊  啊 //啊  啊  啊  啊    啊啊啊啊啊 //啊  啊  啊啊      啊  啊  啊 //啊  啊  啊  啊    啊  啊  啊 //啊  啊  啊  啊    啊  啊  啊 //啊  啊  啊    啊  啊  啊  啊 //啊啊啊  啊    啊  啊啊啊  啊 //啊  啊  啊啊  啊  啊  啊  啊 //        啊  啊            啊 //        啊                啊 //        啊            啊  啊 //        啊              啊啊

user: user-2
content: 仅供参考：#include <mem.h> #include <stdlib.h> #include <stdio.h> #include <conio.h> #include <graphics.h> const unsigned char bit[8]={128,64,32,16,8,4,2,1}; //-------------------------------------------------------- void dis(xoff,code) 	unsigned int xoff,code; { 	unsigned char *buffer; 	FILE *hzk; 	unsigned long offset; 	unsigned int q,w; 	int	x,y,width;  	buffer=calloc(32,1); 	if ((code&0xFF00)!=0) { 		w=(code&0x00FF)-0xA1; 		q=((code>>8)&0x00FF)-0xA1; 		offset=q*0x5E+w; 		offset*=32; 		if ((hzk=fopen("HZK16","rb"))==NULL) { 			closegraph(); 			printf("Can not open HZK16\r\n"); 			exit(1); 		} 		fseek(hzk,offset,SEEK_SET); 		fread(buffer,1,32,hzk); 		fclose(hzk); 		width=2; 	} 	else { 		if ((hzk=fopen("ASC16","rb"))==NULL) { 			closegraph(); 			printf("Can not open ASC16\r\n"); 			exit(1); 		} 		offset=code*16; 		fseek(hzk,offset,SEEK_SET); 		fread(buffer,1,16,hzk); 		fclose(hzk); 		width=1; 	} 	for	(y=0;y<16;y++) for (x=0;x<8*width;x++) { 		if (buffer[y*width+x/8]&bit[x%8]) putpixel(xoff+x,y,15); 	} 	free(buffer); } //-------------------------------------------------------- void display(p) 	unsigned char *p; {    int i;   unsigned int qw;    i=0;   while (1) { 	if (p[i]==0x0D||p[i]==0x1A)	break; 	if (p[i]>0xA0) { 		qw=((unsigned int)p[i]<<8)|((unsigned int)p[i+1]&0x00FF); 		dis(8*i,qw); 		i+=2; 	} 	else { 		qw=(unsigned int)p[i]&0x00FF; 		dis(8*i,qw); 		i++; 	}   }  } //-------------------------------------------------------- void main() { 	int gdriver = DETECT, gmode, errorcode; 	long fl; 	FILE *hz; 	unsigned char *p;  	initgraph(&gdriver, &gmode, "c:\\borlandc\\bgi"); 	errorcode = graphresult(); 	if (errorcode != grOk) { 	   printf("Graphics error: %s\n", grapherrormsg(errorcode)); 	   exit(1); 	} 	hz=fopen("hz","rb"); 	fseek(hz,0,SEEK_END); 	fl=ftell(hz); 	p=calloc((int)fl,sizeof(unsigned char)); 	rewind(hz); 	fread(p,1,(int)fl,hz); 	fclose(hz); 	display(p); 	free(p); 	getch(); 	closegraph(); }  Win-TC里面有HZK16