9 Void1b = (0xC6-0xA2)*Charsperfont+0x3f,
10 Void1e = (0xC9-0xA2)*Charsperfont - 1
14 breadbits(char *file, int n, long *chars, int size, uchar *bits, int **doneptr)
23 static uchar missing[32] = {0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x08, 0x00, 0x04, 0x00, 0x02, 0x00, 0x01, 0x00, 0x00, 0x80, 0x00, 0x40, 0x00, 0x20, 0x00, 0x10, 0x00, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
26 bf = Bopen(file, OREAD);
28 fprint(2, "%s: %s: %r\n", argv0, file);
29 exits("bitfile open error");
31 done = (int *)malloc(n*sizeof(done[0]));
33 fprint(2, "%s: malloc error (%d bytes)\n", argv0, n);
34 exits("malloc error");
39 for(i = 0; i < n; i++){
43 if((c >= Void1b) && (c <= Void1e)){
48 /* magic via presotto for calculating the seek */
50 if(c >= 2*Charsperfont)
51 j += 294; /* baffling hole between A3 and A4 */
53 j -= 3*Charsperfont - 0x3F;
54 j *= byt*size; /* bytes per char */
55 j += 256; /* 256 front matter */
57 Bread(bf, buf, sizeof(missing));
58 if(memcmp(buf, missing, sizeof(missing)) == 0){
65 for(j = 0; j < size; j++){ /* rows */
70 nbits = (uchar *)malloc(nch*byt*size);
72 fprint(2, "%s: malloc error (%d bytes)\n", argv0, nch*byt);
73 exits("malloc error");
76 for(i = 0; i < n; i++)
78 for(j = 0; j < size; j++)
79 memmove(nbits+c*byt+j*nch*byt, bits+i*byt+j*n*byt, byt);
82 bm = balloc((Rectangle){(Point){0, 0}, (Point){nch*size, size}}, 0);
84 fprint(2, "%s: balloc failure\n", argv0);
85 exits("balloc failure");
87 wrbitmap(bm, 0, size, nbits);