- /*MAKE 自造字库 MAKE*/
- main()
- {FILE *zkfp, *zk1fp;
- unsigned char *s[S_NUMBER];
- int len[S_NUMBER], i, j, m;
- int qu, wei, l;
- long offset;
- int a[ZISHU], number = 0, xn;
- s[0] = "自造小字库显示软件";
- s[1] = "把所用到的汉字字模提取出来重新组成小字库,";
- s[2] = "使用时即可把原字库抛开。";
- s[3] = "愿与各位朋友商榷。";
- s[4] = "欢迎常到松鼠之家来";
- s[5] = "松鼠拜上。";
- zk1fp = fopen("c:\\xzku.dat", "wb");
- zkfp = fopen("c:\\hzk16", "rb");
- if (zkfp == NULL) {printf("Can't open the cclib");
- exit(0);
- }
- for(i = 0; i < s_number; i++)
- {while(*s[i])
- {
- qu = *(s[i]++)-0xa0;
- wei = *(s[i]++)-0xa0;
- l = qu*94+wei;
- for(j = 0; j < number&&a[j] != l; j++);
- if(j!=number)
- continue;
- a[number++] = l;
- offset = (94l*(qu-1)+(wei-1))*32l;
- fseek(zkfp, offset, SEEK_SET);
- for(m = 0;m <32;m++)
- putc(getc(zkfp), zk1fp);
- }
- }
- fclose(zkfp);
- fclose(zk1fp);
- printf("\\nOK!\\n");
- }
- //该片段来自于http://www.codesnippet.cn/detail/12122012928.html
来源: http://www.codesnippet.cn/detail/12122012928.html