8 produces the bitmap for the designated han characters
11 static void usage(void);
12 enum { Jis = 0, Big5, Gb_bdf, Gb_qw };
13 enum { Size24 = 0, Size16 };
19 [Jis] { "../han/jis.bits", "../han/jis16.bits", kmap, kreadbits },
20 [Big5] { "no 24 bit file", "../han/big5.16.bits", bmap, breadbits },
21 [Gb_bdf] { "no 24 bit file", "../han/cclib16fs.bdf", gmap, greadbits },
22 [Gb_qw] { "no 24 bit file", "no 16bit file", gmap, qreadbits }
26 main(int argc, char **argv)
42 case 'f': file = ARGF(); break;
43 case 'r': raw = 1; break;
44 case '5': src = Big5; break;
45 case 's': size = 16; break;
46 case 'g': src = Gb_bdf; break;
47 case 'q': src = Gb_qw; break;
51 file = source[src].names[(size==24)? Size24:Size16];
54 from = strtol(argv[0], (char **)0, 0);
55 to = strtol(argv[1], (char **)0, 0);
56 binit(0, 0, "fontgen");
58 nb = size*size/8; /* bytes per char */
60 bits = (uchar *)malloc(nb);
61 chars = (long *)malloc(sizeof(long)*nc);
62 found = (int *)malloc(sizeof(found[0])*nc);
63 if(bits == 0 || chars == 0){
64 fprint(2, "%s: couldn't malloc %d bytes for %d chars\n", argv0, nb, nc);
65 exits("out of memory");
68 for(x = from; x <= to; x++)
71 source[src].mfn(from, to, chars);
73 b = source[src].bfn(file, nc, chars, size, bits, &found);
74 b1 = balloc(b->r, b->ldepth);
75 bitblt(b1, b1->r.min, b, b->r, S);
76 f = bf(nc, size, b1, found);
78 wrsubfontfile(1, f);/**/
85 fprint(2, "Usage: %s [-s] from to\n", argv0);