w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

libpbm5.c
Go to the documentation of this file.
1 /* libpbm5.c - pbm utility library part 5
2 **
3 ** Font routines.
4 **
5 ** Support for BDF fonts Copyright 1993 by George Phillips.
6 **
7 ** Copyright (C) 1991 by Jef Poskanzer.
8 **
9 ** Permission to use, copy, modify, and distribute this software and its
10 ** documentation for any purpose and without fee is hereby granted, provided
11 ** that the above copyright notice appear in all copies and that both that
12 ** copyright notice and this permission notice appear in supporting
13 ** documentation. This software is provided "as is" without express or
14 ** implied warranty.
15 */
16 
17 #include <string.h>
18 #include "pbm.h"
19 #include "pbmfont.h"
20 
21 /* The default font, packed in hex so this source file doesn't get huge.
22 ** You can replace this with your own font using pbm_dumpfont().
23 */
24 #define DEFAULTFONT_ROWS 155
25 #define DEFAULTFONT_COLS 112
26 static unsigned long defaultfont_bits[DEFAULTFONT_ROWS][(DEFAULTFONT_COLS+31)/32] = {
27  {0x00000000L,0x20000c00L,0x10000000L,0x00000000L},
28  {0xc600a000L,0x42000810L,0x00000002L,0x00000063L},
29  {0x6c00a000L,0x45000810L,0x00000002L,0x00000036L},
30  {0x6c00a000L,0x88800808L,0xf2e1dee2L,0x00000036L},
31  {0x54000000L,0x80000800L,0x11122442L,0x0000002aL},
32  {0x54000001L,0x00000800L,0x11122442L,0x0000002aL},
33  {0x54000001L,0x00000800L,0x11122282L,0x0000002aL},
34  {0x44000102L,0x00000800L,0x11122382L,0x00000022L},
35  {0xee000102L,0x00000800L,0x11e1e102L,0x00000077L},
36  {0x00000204L,0x00000800L,0x11002102L,0x00000000L},
37  {0x00000000L,0x00000c00L,0x11002102L,0x00000000L},
38  {0x00000000L,0x003f8000L,0xe3807600L,0x00000000L},
39  {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
40  {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
41  {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
42  {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
43  {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
44  {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
45  {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
46  {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
47  {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
48  {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
49  {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
50  {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
51  {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
52  {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
53  {0x02000080L,0x00040000L,0x00120000L,0x00000001L},
54  {0x04000082L,0x828e1838L,0x20210100L,0x00000002L},
55  {0x04000082L,0x82912448L,0x20210100L,0x00000002L},
56  {0x08000082L,0x8fd01940L,0x404087c2L,0x00000004L},
57  {0x08000080L,0x050c0622L,0x00408102L,0x00000004L},
58  {0x10000080L,0x05061874L,0x0040828fL,0x00008008L},
59  {0x10000080L,0x1f912688L,0x00408002L,0x00000008L},
60  {0x20000000L,0x0a11098cL,0x00408002L,0x00000010L},
61  {0x20000080L,0x0a0e0672L,0x00210000L,0x00000010L},
62  {0x40000000L,0x00040000L,0x00210000L,0x00000020L},
63  {0x00000000L,0x00000000L,0x00120000L,0x00000000L},
64  {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
65  {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
66  {0x00000000L,0x004e0838L,0x7023e1cfL,0x00008000L},
67  {0x00000000L,0x00913844L,0x88620208L,0x00008000L},
68  {0x08000000L,0x00910844L,0x08a20401L,0x00000004L},
69  {0x10000000L,0x01110844L,0x08a20401L,0x00000008L},
70  {0x20000000L,0x01110808L,0x3123c781L,0x00000010L},
71  {0x400003e0L,0x02110810L,0x0a202441L,0x00000020L},
72  {0x20000000L,0x02110820L,0x0bf02442L,0x00000010L},
73  {0x10008000L,0x04110844L,0x88242442L,0x00000008L},
74  {0x08008002L,0x040e3e7cL,0x7073c382L,0x00000004L},
75  {0x00010000L,0x08000000L,0x00000000L,0x00000000L},
76  {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
77  {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
78  {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
79  {0x0000e1c0L,0x00000000L,0x00000000L,0x00000000L},
80  {0x00011220L,0x00000000L,0x70e38f87L,0x00000000L},
81  {0x20011220L,0x00020020L,0x89108448L,0x00008010L},
82  {0x10011220L,0x00040010L,0x09314448L,0x00008008L},
83  {0x0800e221L,0x02083e08L,0x11514788L,0x00000004L},
84  {0x040111e0L,0x00100004L,0x2153e448L,0x00000002L},
85  {0x08011020L,0x00083e08L,0x213a2448L,0x00008004L},
86  {0x10011040L,0x02040010L,0x01022448L,0x00008008L},
87  {0x2000e381L,0x02020020L,0x20e77f87L,0x00000010L},
88  {0x00000000L,0x04000000L,0x00000000L,0x00000000L},
89  {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
90  {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
91  {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
92  {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
93  {0x3803e7efL,0xc73bbe3dL,0xdb863ce7L,0x0000001cL},
94  {0x44011224L,0x48910808L,0x91036648L,0x00008022L},
95  {0x4c011285L,0x48910808L,0xa1036648L,0x00008026L},
96  {0x54011387L,0x081f0808L,0xc102a548L,0x0000802aL},
97  {0x54011285L,0x09910808L,0xe102a548L,0x0000802aL},
98  {0x4e011204L,0x08910848L,0x9112a4c8L,0x00008027L},
99  {0x40011224L,0x08910848L,0x891224c8L,0x00008020L},
100  {0x3803e7efL,0x073bbe31L,0xcff77e47L,0x0000001cL},
101  {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
102  {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
103  {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
104  {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
105  {0x00000000L,0x00000000L,0x00000003L,0x00000000L},
106  {0x0003e1cfL,0x87bff7efL,0xdfbf77c2L,0x00000000L},
107  {0x00013224L,0x48a4a244L,0x89122442L,0x00000000L},
108  {0x00011224L,0x4824a244L,0xa8a14482L,0x00000000L},
109  {0x00013227L,0x8e04226cL,0xa8414102L,0x00000000L},
110  {0x0001e224L,0x83842228L,0xa8a08102L,0x00000000L},
111  {0x00010224L,0x40842228L,0xd8a08242L,0x00000000L},
112  {0x00010224L,0x48843638L,0x51108442L,0x00000000L},
113  {0x0003c1ceL,0x6f1f1c10L,0x53b9c7c2L,0x00000000L},
114  {0x00000060L,0x00000000L,0x00000002L,0x00000000L},
115  {0x00000000L,0x00000000L,0x00000003L,0x00000000L},
116  {0xfe000000L,0x00000000L,0x00000000L,0x0000007fL},
117  {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
118  {0x00010180L,0x000000c0L,0x003001c0L,0x00000000L},
119  {0x08008081L,0x00040040L,0x00100200L,0x00000004L},
120  {0x10008082L,0x80040040L,0x00100200L,0x00000008L},
121  {0x10004084L,0x40023c78L,0x70f1c7c7L,0x00004008L},
122  {0x10004080L,0x00000244L,0x89122208L,0x00008008L},
123  {0x20002080L,0x00001e44L,0x8113e208L,0x00008010L},
124  {0x10002080L,0x00002244L,0x81120208L,0x00008008L},
125  {0x10001080L,0x00002244L,0x89122208L,0x00008008L},
126  {0x10001080L,0x00001db8L,0x70e9c787L,0x00008008L},
127  {0x10000880L,0x00000000L,0x00000000L,0x00008008L},
128  {0x08000180L,0x00000000L,0x00000000L,0x00008004L},
129  {0x00000000L,0x1fc00000L,0x00000007L,0x00000000L},
130  {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
131  {0x00030080L,0x981c0000L,0x00000000L,0x00000000L},
132  {0x20010000L,0x08040000L,0x00000000L,0x00000010L},
133  {0x10010000L,0x08040000L,0x00000000L,0x00000008L},
134  {0x10016387L,0x898474b8L,0x72e1d5c7L,0x00000008L},
135  {0x10019080L,0x8a042a64L,0x89122208L,0x00008008L},
136  {0x08011080L,0x8c042a44L,0x89122207L,0x00000004L},
137  {0x10011080L,0x8a042a44L,0x89122200L,0x00008008L},
138  {0x10011080L,0x89042a44L,0x89122208L,0x00008008L},
139  {0x1003bbe0L,0x98dfebe6L,0x71e1e787L,0x00000008L},
140  {0x10000000L,0x80000000L,0x01002000L,0x00000008L},
141  {0x20000000L,0x80000000L,0x01002000L,0x00000010L},
142  {0x00000007L,0x00000000L,0x03807000L,0x00000000L},
143  {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
144  {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
145  {0x00008000L,0x00000000L,0x10410000L,0x00000000L},
146  {0x00008000L,0x00000000L,0x20408000L,0x00000000L},
147  {0x0001f66eL,0xfdfbf77cL,0x20408000L,0x00000000L},
148  {0x24008224L,0x488a2248L,0x20408240L,0x00000012L},
149  {0x54008224L,0x4a842210L,0x40404540L,0x0000002aL},
150  {0x48008222L,0x8a8a1420L,0x20408480L,0x00000024L},
151  {0x00008a23L,0x85111c44L,0x20408000L,0x00000000L},
152  {0x000071d1L,0x0531887cL,0x20408000L,0x00000000L},
153  {0x00000000L,0x00000800L,0x20408000L,0x00000000L},
154  {0x00000000L,0x00000800L,0x10410000L,0x00000000L},
155  {0x00000000L,0x00003000L,0x00000000L,0x00000000L},
156  {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
157  {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
158  {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
159  {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
160  {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
161  {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
162  {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
163  {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
164  {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
165  {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
166  {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
167  {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
168  {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
169  {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
170  {0x00000000L,0x20000c00L,0x10000000L,0x00000000L},
171  {0xc600a000L,0x42000810L,0x00000002L,0x00000063L},
172  {0x6c00a000L,0x45000810L,0x00000002L,0x00000036L},
173  {0x6c00a000L,0x88800808L,0xf2e1dee2L,0x00000036L},
174  {0x54000000L,0x80000800L,0x11122442L,0x0000002aL},
175  {0x54000001L,0x00000800L,0x11122442L,0x0000002aL},
176  {0x54000001L,0x00000800L,0x11122282L,0x0000002aL},
177  {0x44000102L,0x00000800L,0x11122382L,0x00000022L},
178  {0xee000102L,0x00000800L,0x11e1e102L,0x00000077L},
179  {0x00000204L,0x00000800L,0x11002102L,0x00000000L},
180  {0x00000000L,0x00000c00L,0x11002102L,0x00000000L},
181  {0x00000000L,0x003f8000L,0xe3807600L,0x00000000L}
182  };
183 
184 /* A default BDF font */
185 /* Not as nicely compacted as the PBM font, oh well. */
186 
187 static struct glyph _g[190] = {
188  { 1, 1, 0, 0, 3, "\0" },
189  { 1, 9, 1, 0, 3, "\1\1\1\1\1\1\1\0\1" },
190  { 3, 3, 1, 6, 5, "\1\0\1\1\0\1\1\0\1" },
191  { 5, 8, 0, 0, 6, "\0\1\0\1\0\0\1\0\1\0\1\1\1\1\1\0\1\0\1\0\0\1\0\1\0\1\1\1\1\1\0\1\0\1\0\0\1\0\1\0" },
192  { 5, 11, 0, -1, 6, "\0\0\1\0\0\0\1\1\1\0\1\0\1\0\1\1\0\1\0\0\0\1\1\0\0\0\0\1\1\0\0\0\1\0\1\0\0\1\0\1\1\0\1\0\1\0\1\1\1\0\0\0\1\0\0" },
193  { 8, 9, 0, 0, 9, "\0\1\1\0\0\0\1\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1\0\1\0\0\0\0\0\0\0\0\1\1\0\1\1\0\0\1\0\0\1\0\0\1\0\0\1\0\0\1\0\0\1\0\0\1\0\0\1\0\0\0\1\1\0\1" },
374  { 6, 8, 0, 0, 6, "\0\1\0\1\0\0\0\0\0\0\0\0\1\1\0\1\1\0\0\1\0\0\1\0\0\1\0\0\1\0\0\1\0\0\1\0\0\1\0\0\1\0\0\0\1\1\0\1" },
375  { 6, 12, 0, -3, 6, "\0\0\0\0\1\0\0\0\0\1\0\0\0\0\0\0\0\0\1\1\0\0\1\1\0\1\0\0\1\0\0\1\0\1\1\0\0\1\0\1\0\0\0\0\1\1\0\0\0\0\1\0\0\0\0\0\1\0\0\0\0\1\0\0\0\0\1\1\0\0\0\0" },
376  { 5, 12, 0, -3, 6, "\1\1\0\0\0\0\1\0\0\0\0\1\0\0\0\0\1\1\1\0\0\1\0\0\1\0\1\0\0\1\0\1\0\0\1\0\1\0\0\1\0\1\1\1\0\0\1\0\0\0\0\1\0\0\0\1\1\1\0\0" },
377  { 6, 11, 0, -3, 6, "\0\1\0\0\1\0\0\0\0\0\0\0\1\1\0\0\1\1\0\1\0\0\1\0\0\1\0\1\1\0\0\1\0\1\0\0\0\0\1\1\0\0\0\0\1\0\0\0\0\0\1\0\0\0\0\1\0\0\0\0\1\1\0\0\0\0" }
378 };
379 
380 static struct font default_bdffont = { 14, 15, -1, -3, {
381  0,
382  0,
383  0,
384  0,
385  0,
386  0,
387  0,
388  0,
389  0,
390  0,
391  0,
392  0,
393  0,
394  0,
395  0,
396  0,
397  0,
398  0,
399  0,
400  0,
401  0,
402  0,
403  0,
404  0,
405  0,
406  0,
407  0,
408  0,
409  0,
410  0,
411  0,
412  0,
413  _g + 0,
414  _g + 1,
415  _g + 2,
416  _g + 3,
417  _g + 4,
418  _g + 5,
419  _g + 6,
420  _g + 7,
421  _g + 8,
422  _g + 9,
423  _g + 10,
424  _g + 11,
425  _g + 12,
426  _g + 13,
427  _g + 14,
428  _g + 15,
429  _g + 16,
430  _g + 17,
431  _g + 18,
432  _g + 19,
433  _g + 20,
434  _g + 21,
435  _g + 22,
436  _g + 23,
437  _g + 24,
438  _g + 25,
439  _g + 26,
440  _g + 27,
441  _g + 28,
442  _g + 29,
443  _g + 30,
444  _g + 31,
445  _g + 32,
446  _g + 33,
447  _g + 34,
448  _g + 35,
449  _g + 36,
450  _g + 37,
451  _g + 38,
452  _g + 39,
453  _g + 40,
454  _g + 41,
455  _g + 42,
456  _g + 43,
457  _g + 44,
458  _g + 45,
459  _g + 46,
460  _g + 47,
461  _g + 48,
462  _g + 49,
463  _g + 50,
464  _g + 51,
465  _g + 52,
466  _g + 53,
467  _g + 54,
468  _g + 55,
469  _g + 56,
470  _g + 57,
471  _g + 58,
472  _g + 59,
473  _g + 60,
474  _g + 61,
475  _g + 62,
476  _g + 63,
477  _g + 64,
478  _g + 65,
479  _g + 66,
480  _g + 67,
481  _g + 68,
482  _g + 69,
483  _g + 70,
484  _g + 71,
485  _g + 72,
486  _g + 73,
487  _g + 74,
488  _g + 75,
489  _g + 76,
490  _g + 77,
491  _g + 78,
492  _g + 79,
493  _g + 80,
494  _g + 81,
495  _g + 82,
496  _g + 83,
497  _g + 84,
498  _g + 85,
499  _g + 86,
500  _g + 87,
501  _g + 88,
502  _g + 89,
503  _g + 90,
504  _g + 91,
505  _g + 92,
506  _g + 93,
507  _g + 94,
508  0,
509  0,
510  0,
511  0,
512  0,
513  0,
514  0,
515  0,
516  0,
517  0,
518  0,
519  0,
520  0,
521  0,
522  0,
523  0,
524  0,
525  0,
526  0,
527  0,
528  0,
529  0,
530  0,
531  0,
532  0,
533  0,
534  0,
535  0,
536  0,
537  0,
538  0,
539  0,
540  0,
541  0,
542  _g + 95,
543  _g + 96,
544  _g + 97,
545  _g + 98,
546  _g + 99,
547  _g + 100,
548  _g + 101,
549  _g + 102,
550  _g + 103,
551  _g + 104,
552  _g + 105,
553  _g + 106,
554  _g + 107,
555  _g + 108,
556  _g + 109,
557  _g + 110,
558  _g + 111,
559  _g + 112,
560  _g + 113,
561  _g + 114,
562  _g + 115,
563  _g + 116,
564  _g + 117,
565  _g + 118,
566  _g + 119,
567  _g + 120,
568  _g + 121,
569  _g + 122,
570  _g + 123,
571  _g + 124,
572  _g + 125,
573  _g + 126,
574  _g + 127,
575  _g + 128,
576  _g + 129,
577  _g + 130,
578  _g + 131,
579  _g + 132,
580  _g + 133,
581  _g + 134,
582  _g + 135,
583  _g + 136,
584  _g + 137,
585  _g + 138,
586  _g + 139,
587  _g + 140,
588  _g + 141,
589  _g + 142,
590  _g + 143,
591  _g + 144,
592  _g + 145,
593  _g + 146,
594  _g + 147,
595  _g + 148,
596  _g + 149,
597  _g + 150,
598  _g + 151,
599  _g + 152,
600  _g + 153,
601  _g + 154,
602  _g + 155,
603  _g + 156,
604  _g + 157,
605  _g + 158,
606  _g + 159,
607  _g + 160,
608  _g + 161,
609  _g + 162,
610  _g + 163,
611  _g + 164,
612  _g + 165,
613  _g + 166,
614  _g + 167,
615  _g + 168,
616  _g + 169,
617  _g + 170,
618  _g + 171,
619  _g + 172,
620  _g + 173,
621  _g + 174,
622  _g + 175,
623  _g + 176,
624  _g + 177,
625  _g + 178,
626  _g + 179,
627  _g + 180,
628  _g + 181,
629  _g + 182,
630  _g + 183,
631  _g + 184,
632  _g + 185,
633  _g + 186,
634  _g + 187,
635  _g + 188,
636  _g + 189
637  }
638 };
639 
640 struct font*
642  char* name;
643  {
644  bit** defaultfont;
645  int row, col, scol;
646  unsigned long l;
647 
648  if (!strcmp(name, "bdf"))
649  return &default_bdffont;
650 
651  if (strcmp(name, "fixed"))
652  pm_error( "built-in font name unknown, try 'bdf' or 'fixed'" );
653 
655  for ( row = 0; row < DEFAULTFONT_ROWS; ++row )
656  {
657  for ( col = 0; col < DEFAULTFONT_COLS; col += 32 )
658  {
659  l = defaultfont_bits[row][col / 32];
660  for ( scol = min( col + 32, DEFAULTFONT_COLS ) - 1;
661  scol >= col; --scol )
662  {
663  if ( l & 1 )
664  defaultfont[row][scol] = 1;
665  else
666  defaultfont[row][scol] = 0;
667  l >>= 1;
668  }
669  }
670  }
671 
672  return pbm_dissectfont( defaultfont, DEFAULTFONT_ROWS, DEFAULTFONT_COLS );
673  }
674 
675 struct font*
677  bit** font;
678  int frows;
679  int fcols;
680  {
681  /*
682  ** This routine expects a font bitmap representing the following text:
683  **
684  ** (0,0)
685  ** M ",/^_[`jpqy| M
686  **
687  ** / !"#$%&'()*+ /
688  ** < ,-./01234567 <
689  ** > 89:;<=>?@ABC >
690  ** @ DEFGHIJKLMNO @
691  ** _ PQRSTUVWXYZ[ _
692  ** { \]^_`abcdefg {
693  ** } hijklmnopqrs }
694  ** ~ tuvwxyz{|}~ ~
695  **
696  ** M ",/^_[`jpqy| M
697  **
698  ** The bitmap must be cropped exactly to the edges.
699  **
700  ** The dissection works by finding the first blank row and column; that
701  ** gives the height and width of the maximum-sized character, which is
702  ** not too useful. But the distance from there to the opposite side is
703  ** an integral multiple of the cell size, and that's what we need. Then
704  ** it's just a matter of filling in all the coordinates.
705  **
706  ** The difference between char_height, char_width and char_aheight,
707  ** char_awidth is that the first is the size of the cell including
708  ** spacing, while the second is just the actual maximum-size character.
709  */
710  int char_width, char_height, char_awidth, char_aheight;
711  int brow, bcol, row, col, d, ch, r, c, i;
712  struct font* fn;
713  struct glyph* glyph;
714  char* bmap;
715  bit b;
716 
717  /* Find first blank row. */
718  for ( brow = 0; brow < frows / 6; ++brow )
719  {
720  b = font[brow][0];
721  for ( col = 1; col < fcols; ++col )
722  if ( font[brow][col] != b )
723  goto nextrow;
724  goto gotblankrow;
725  nextrow: ;
726  }
727  pm_error( "couldn't find blank row in font" );
728 
729 gotblankrow:
730  /* Find first blank col. */
731  for ( bcol = 0; bcol < fcols / 8; ++bcol )
732  {
733  b = font[0][bcol];
734  for ( row = 1; row < frows; ++row )
735  if ( font[row][bcol] != b )
736  goto nextcol;
737  goto gotblankcol;
738  nextcol: ;
739  }
740  pm_error( "couldn't find blank col in font" );
741 
742 gotblankcol:
743  /* Now compute character cell size. */
744  d = frows - brow;
745  char_height = d / 11;
746  if ( char_height * 11 != d )
747  pm_error( "problem computing character cell height" );
748  d = fcols - bcol;
749  char_width = d / 15;
750  if ( char_width * 15 != d )
751  pm_error( "problem computing character cell width" );
752  char_aheight = brow;
753  char_awidth = bcol;
754 
755  /* Now convert to a general font */
756 
757  fn = (struct font*) malloc( sizeof(struct font) );
758  if ( fn == (struct font*) 0 )
759  pm_error( "out of memory allocating font structure" );
760 
761  fn->maxwidth = char_awidth;
762  fn->maxheight = char_height;
763  fn->x = fn->y = 0;
764  for (i = 0; i < 256; i++)
765  fn->glyph[i] = 0;
766  fn->oldfont = font;
767  fn->frows = frows;
768  fn->fcols = fcols;
769 
770  glyph = (struct glyph*) malloc( sizeof(struct glyph) * 95 );
771  if ( glyph == (struct glyph*) 0 )
772  pm_error( "out of memory allocating glyphs" );
773 
774  bmap = (char*) malloc( fn->maxwidth * fn->maxheight * 95 );
775  if ( bmap == (char*) 0)
776  pm_error( "out of memory allocating glyph data" );
777 
778  /* Now fill in the 0,0 coords. */
779  row = char_height * 2;
780  col = char_width * 2;
781  for ( ch = 0; ch < 95; ++ch )
782  {
783  glyph[ch].width = fn->maxwidth;
784  glyph[ch].height = fn->maxheight;
785  glyph[ch].x = glyph[ch].y = 0;
786  glyph[ch].xadd = char_width;
787 
788  for ( r = 0; r < glyph[ch].height; ++r )
789  for ( c = 0; c < glyph[ch].width; ++c )
790  bmap[r * glyph[ch].width + c] = font[row + r][col + c];
791 
792  glyph[ch].bmap = bmap;
793  bmap += glyph[ch].width * glyph[ch].height;
794 
795  fn->glyph[ch + 32] = glyph + ch;
796 
797  col += char_width;
798  if ( col >= char_width * 14 )
799  {
800  col = char_width * 2;
801  row += char_height;
802  }
803  }
804 
805  return fn;
806  }
807 
808 
809 
810 struct font*
812 char* filename;
813 {
814  FILE* fp;
815  struct font* fn;
816  char line[256];
817 
818  fp = pm_openr( filename );
819  fgets(line, 256, fp);
820  pm_close( fp );
821 
822  if (line[0] == PBM_MAGIC1 &&
823  (line[1] == PBM_MAGIC2 || line[1] == RPBM_MAGIC2)) {
824  return pbm_loadpbmfont( filename );
825  } else if (!strncmp(line, "STARTFONT", 9)) {
826  if (!(fn = pbm_loadbdffont( filename )))
827  pm_error( "could not load BDF font file" );
828  return fn;
829  } else {
830  pm_error( "font file not in a recognized format ");
831  return NULL; /* should never reach here */
832  }
833 }
834 
835 
836 
838 char* filename;
839 {
840  FILE* ifp;
841  bit** font;
842  int fcols, frows;
843 
844  ifp = pm_openr( filename );
845  font = pbm_readpbm( ifp, &fcols, &frows );
846  pm_close( ifp );
847  return pbm_dissectfont( font, frows, fcols );
848 }
849 
850 void
852  struct font* fn;
853 {
854  /* Dump out font as C source code. */
855  int row, col, scol, lperrow;
856  unsigned long l;
857 
858  if (fn->oldfont) {
859  printf( "#define DEFAULTFONT_ROWS %d\n", fn->frows );
860  printf( "#define DEFAULTFONT_COLS %d\n", fn->fcols );
861  printf( "static unsigned long defaultfont_bits[DEFAULTFONT_ROWS][(DEFAULTFONT_COLS+31)/32] = {\n" );
862  for ( row = 0; row < fn->frows; ++row )
863  {
864  lperrow = 0;
865  for ( col = 0; col < fn->fcols; col += 32 )
866  {
867  if ( lperrow == 0 )
868  printf( " {" );
869  else if ( lperrow % 6 == 0 )
870  {
871  printf( ",\n " );
872  lperrow = 0;
873  }
874  else
875  printf( "," );
876  l = 0;
877  for ( scol = col; scol < min( col + 32, fn->fcols ); ++scol )
878  {
879  l <<= 1;
880  if ( fn->oldfont[row][scol] )
881  l |= 1;
882  }
883  printf( "0x%08lxL", l );
884  ++lperrow;
885  }
886  printf( "}%s\n", row == fn->frows - 1 ? "" : "," );
887  }
888  printf( " };\n" );
889  }
890  else {
891  struct glyph* glyph;
892  int i, j, ng;
893 
894  ng = 0;
895  for (i = 0; i < 256; i++)
896  if (fn->glyph[i])
897  ng++;
898 
899  printf("static struct glyph _g[%d] = {\n", ng);
900  for (i = 0; i < 256; i++) {
901  if (!(glyph = fn->glyph[i]))
902  continue;
903 
904  printf(" { %d, %d, %d, %d, %d, \"", glyph->width, glyph->height,
905  glyph->x, glyph->y, glyph->xadd);
906 
907  for (j = 0; j < glyph->width * glyph->height; j++)
908  if (glyph->bmap[j])
909  printf("\\1");
910  else
911  printf("\\0");
912 
913  ng--;
914  printf("\" }%s\n", ng ? "," : "");
915  }
916  printf("};\n");
917 
918  printf("static struct font default_bdffont = { %d, %d, %d, %d, {\n",
919  fn->maxwidth, fn->maxheight, fn->x, fn->y);
920 
921  for (i = 0; i < 256; i++) {
922  if (fn->glyph[i])
923  printf(" _g + %d", ng++);
924  else
925  printf(" 0");
926 
927  if (i != 255) printf(",");
928  printf("\n");
929  }
930 
931  printf(" }\n};\n");
932  exit(0);
933 
934  }
935 
936 }
937 
938 
939 /* Routines for loading a BDF font file */
940 
941 static int readline ARGS((FILE* fp, char* buf, char* arg[]));
942 
943 #define expect(str) if (readline(fp, line, arg) < 0 || strcmp(arg[0], (str))) \
944  { fclose(fp); return 0; }
945 
947 char* name;
948 {
949  FILE* fp;
950  char line[1024], *arg[32], *b, *hex;
951  int n, numchar, hdig, encoding;
952  struct font* font;
953  struct glyph* glyph;
954 
955  if (!(fp = fopen(name, "rb")))
956  return 0;
957 
958  expect("STARTFONT");
959 
960  if (!(font = (struct font*)malloc(sizeof(struct font))))
961  pm_error("no memory for font");
962  font->oldfont = 0;
963  {
964  /* Initialize all characters to nonexistent; we will fill the ones we
965  find in the bdf file later.
966  */
967  int i;
968  for (i = 0; i < 256; i++)
969  font->glyph[i] = NULL;
970  }
971 
972  while (readline(fp, line, arg) >= 0) {
973  if (!strcmp(arg[0], "COMMENT"))
974  continue;
975  if (!strcmp(arg[0], "SIZE"))
976  continue;
977 
978  if (!strcmp(arg[0], "STARTPROPERTIES")) {
979  n = atoi(arg[1]);
980  for (; n > 0 && readline(fp, line, arg) >= 0; n--)
981  ;
982  }
983  else if (!strcmp(arg[0], "FONTBOUNDINGBOX")) {
984  font->maxwidth = atoi(arg[1]);
985  font->maxheight = atoi(arg[2]);
986  font->x = atoi(arg[3]);
987  font->y = atoi(arg[4]);
988  }
989  else if (!strcmp(arg[0], "ENDFONT")) {
990  fclose(fp);
991  return font;
992  }
993  else if (!strcmp(arg[0], "CHARS")) {
994  numchar = atoi(arg[1]);
995  while (numchar > 0) {
996  if (readline(fp, line, arg) < 0) { fclose(fp); return 0; }
997  if (!strcmp(arg[0], "COMMENT"))
998  continue;
999  if (strcmp(arg[0], "STARTCHAR")) { fclose(fp); return 0; }
1000  if (!(glyph = (struct glyph*)malloc(sizeof(struct glyph))))
1001  pm_error("no memory for font glyph");
1002 
1003  expect("ENCODING");
1004  if ((encoding = atoi(arg[1])) < 0) {
1005  if (arg[2])
1006  encoding = atoi(arg[2]);
1007  else {
1008  while (readline(fp, line, arg) >= 0)
1009  if (!strcmp(arg[0], "ENDCHAR"))
1010  break;
1011 
1012  numchar--;
1013  continue;
1014  }
1015  }
1016  expect("SWIDTH");
1017  expect("DWIDTH");
1018  glyph->xadd = atoi(arg[1]);
1019  expect("BBX");
1020  glyph->width = atoi(arg[1]);
1021  glyph->height = atoi(arg[2]);
1022  glyph->x = atoi(arg[3]);
1023  glyph->y = atoi(arg[4]);
1024 
1025  if (!(glyph->bmap = (char*)malloc(glyph->width * glyph->height)))
1026  pm_error("no memory for font glyph byte map");
1027 
1028  if (readline(fp, line, arg) < 0) { fclose(fp); return 0; }
1029  if (!strcmp(arg[0], "ATTRIBUTES"))
1030  if (readline(fp, line, arg) < 0) { fclose(fp); return 0; }
1031 
1032  b = glyph->bmap;
1033  for (n = glyph->height; n > 0; n--) {
1034  int i; /* dot counter */
1035  if (readline(fp, line, arg) < 0) { fclose(fp); return 0; }
1036  hex = line;
1037  for (i = glyph->width; i > 0; i -= 4) {
1038  hdig = *hex++;
1039  if (hdig >= '0' && hdig <= '9')
1040  hdig -= '0';
1041  else if (hdig >= 'a' && hdig <= 'f')
1042  hdig -= 'a' - 10;
1043  else if (hdig >= 'A' && hdig <= 'F')
1044  hdig -= 'A' - 10;
1045 
1046  *b++ = hdig & 8 ? 1 : 0;
1047  if (i > 1) *b++ = hdig & 4 ? 1 : 0;
1048  if (i > 2) *b++ = hdig & 2 ? 1 : 0;
1049  if (i > 3) *b++ = hdig & 1;
1050  }
1051  }
1052 
1053  expect("ENDCHAR");
1054 
1055  if (encoding < 256)
1056  /* We ignore any characters with codes that don't fit
1057  in 8 bits. We may want to change this someday.
1058  */
1059  font->glyph[encoding] = glyph;
1060 
1061  numchar--;
1062  }
1063  }
1064  }
1065  return font;
1066 }
1067 
1068 static int readline(fp, buf, arg)
1069 FILE* fp;
1070 char* buf;
1071 char* arg[];
1072 {
1073  if (!fgets(buf, 1024, fp))
1074  return -1;
1075 
1076  return mk_argvn(buf, arg, 32);
1077 }
1078 
1079 int mk_argvn(s, vec, mk_max)
1080 char* s;
1081 char* vec[];
1082 int mk_max;
1083 {
1084  int n;
1085 
1086  n = 0;
1087  while (*s) {
1088  if (isspace(*s)) {
1089  *s++ = '\0';
1090  continue;
1091  }
1092  vec[n++] = s;
1093  if (n >= mk_max)
1094  break;
1095  while (*s && !isspace(*s))
1096  s++;
1097  }
1098  vec[n] = 0;
1099  return n;
1100 }
#define char_height(a, b)
#define font
Definition: aptex-macros.h:175
#define width(a)
Definition: aptex-macros.h:198
#define name
#define char_width(a, b)
#define n
Definition: t4ht.c:1290
#define b
Definition: jpegint.h:372
#define hex(c)
Definition: kanji.c:63
#define fopen
Definition: xxstdio.h:21
#define fgets
Definition: xxstdio.h:29
int strcmp()
Definition: coll.cpp:143
int printf()
#define s
Definition: afcover.h:80
#define c(n)
Definition: gpos-common.c:150
#define d(n)
Definition: gpos-common.c:151
int col
Definition: gsftopk.c:443
#define NULL
Definition: ftobjs.h:61
small capitals from c petite p scientific i
Definition: afcover.h:80
FT_Vector * vec
Definition: ftbbox.c:469
void exit()
int atoi(const char *)
#define buf
#define fclose
Definition: debug.h:100
#define malloc
Definition: alloca.c:91
int strncmp()
string fn
Definition: fc-lang.py:335
FILE * pm_openr(char *name)
Definition: libpbm1.c:600
bit ** pbm_readpbm(FILE *file, int *colsP, int *rowsP)
Definition: libpbm2.c:161
struct font * pbm_loadpbmfont(char *filename)
Definition: libpbm5.c:837
void pbm_dumpfont(struct font *fn)
Definition: libpbm5.c:851
struct font * pbm_loadbdffont(char *name)
Definition: libpbm5.c:946
int mk_argvn(char *s, vec, int mk_max)
Definition: libpbm5.c:1079
struct font * pbm_defaultfont(char *name)
Definition: libpbm5.c:641
struct font * pbm_loadfont(char *filename)
Definition: libpbm5.c:811
struct font * pbm_dissectfont(bit **font, int frows, int fcols)
Definition: libpbm5.c:676
#define PBM_MAGIC1
Definition: pbm.h:16
unsigned char bit
Definition: pbm.h:9
#define pbm_allocarray(cols, rows)
Definition: pbm.h:34
#define PBM_MAGIC2
Definition: pbm.h:17
#define RPBM_MAGIC2
Definition: pbm.h:18
void nextrow()
static short * fcols
Definition: pbmmask.c:141
static short * frows
Definition: pbmmask.c:142
#define ARGS(alist)
Definition: pbmplus.h:235
#define min(a, b)
Definition: pbmplus.h:223
char * filename[256]
Definition: pbmtopk.c:46
#define fp
#define pm_error
Definition: png22pnm.c:118
#define pm_close(file)
Definition: png22pnm.c:120
int r
Definition: ppmqvga.c:68
char line[1024]
Definition: process_score.c:29
static int row
Definition: ps2pk.c:587
#define isspace(ch)
Definition: utype.h:87
Definition: pbmfont.h:11
int y
Definition: pbmfont.h:13
int x
Definition: pbmfont.h:13
bit ** oldfont
Definition: pbmfont.h:17
int maxheight
Definition: pbmfont.h:12
struct glyph * glyph[256]
Definition: pbmfont.h:14
int maxwidth
Definition: pbmfont.h:12
Definition: pbmfont.h:4
int width
Definition: pbmfont.h:5
int x
Definition: pbmfont.h:6
int height
Definition: pbmfont.h:5
int y
Definition: pbmfont.h:6
char * bmap
Definition: pbmfont.h:8
int xadd
Definition: pbmfont.h:7
Definition: bdf.c:133
#define FILE
Definition: t1stdio.h:34
ch
Definition: t4ht.c:1443
int j
Definition: t4ht.c:1589
FILE * ifp
Definition: t1asm.c:88
TT_Glyph glyph
Definition: ttf2pfb.c:162
#define expect(str)
Definition: libpbm5.c:943
static int readline()
static struct glyph _g[190]
Definition: libpbm5.c:187
#define DEFAULTFONT_COLS
Definition: libpbm5.c:25
static unsigned long defaultfont_bits[155][(112+31)/32]
Definition: libpbm5.c:26
static struct font default_bdffont
Definition: libpbm5.c:380
#define DEFAULTFONT_ROWS
Definition: libpbm5.c:24
#define encoding
Definition: xmlparse.c:588