/* From: YLu Subject: Re: cclib fonts -- ccf2lib.c To: xiaofei@ifcss.org (XiaoFei Wang) Date: Thu, 28 Jan 93 11:50:45 GMT The large .ccf font files used in gb2ps can be converted back to the smaller standard formats as cclib.24 with the following a couple of lines of C code. There is no need to ftp another large set of font files if you already have the .ccf files. */ #include #include /***** convert the .ccf file format to the common .lib format. assuming the .ccf file is line oriented, continuous, and the bitmaps are indexed in correct ascending order. 24x24 bitmap file with all legal planes filled should have ((0xF7-0xA1+1)*94)*(24*24/8) = (87*94)*72 = 8178*72 = 588816 bytes. Program usage: ccf2lib < csong24.ccf > cclib.j24 *****/ main() { char buf[BUFSIZ]; char qu_wei[BUFSIZ], hex_array[BUFSIZ]; char *ptr; char hex[3]; hex[3] = 0; while (gets(buf) != NULL) { sscanf(buf, "%s %s", qu_wei, hex_array); ptr = hex_array; while (*ptr != 0) { hex[0] = *ptr; hex[1] = *(++ptr); putchar((int) strtol(hex, (char **) NULL, 16)); ptr++; } } }