9 static char *afm_charfield(char *s
, char *d
)
11 while (*s
&& !isspace(*s
) && *s
!= ';')
13 while (isspace(*s
) || *s
== ';')
22 char ch
[TOKLEN
] = "", pos
[TOKLEN
] = "";
23 char c1
[TOKLEN
] = "", c2
[TOKLEN
] = "";
24 char wid
[TOKLEN
] = "", field
[TOKLEN
] = "";
25 char llx
[TOKLEN
] = "0", lly
[TOKLEN
] = "0";
26 char urx
[TOKLEN
] = "0", ury
[TOKLEN
] = "0";
28 while (fgets(ln
, sizeof(ln
), stdin
)) {
31 if (!strncmp("FontName ", ln
, 8)) {
32 sscanf(ln
, "FontName %s", ch
);
36 if (!strncmp("StartCharMetrics", ln
, 16))
39 while (fgets(ln
, sizeof(ln
), stdin
)) {
42 if (!strncmp("EndCharMetrics", ln
, 14))
46 s
= afm_charfield(s
, field
);
47 if (!strcmp("C", field
)) {
48 s
= afm_charfield(s
, pos
);
51 if (!strcmp("WX", field
)) {
52 s
= afm_charfield(s
, wid
);
55 if (!strcmp("N", field
)) {
56 s
= afm_charfield(s
, ch
);
59 if (!strcmp("B", field
)) {
60 s
= afm_charfield(s
, llx
);
61 s
= afm_charfield(s
, lly
);
62 s
= afm_charfield(s
, urx
);
63 s
= afm_charfield(s
, ury
);
66 if (!strcmp("L", field
)) {
67 s
= afm_charfield(s
, c1
);
68 s
= afm_charfield(s
, c2
);
73 if (ch
[0] && pos
[0] && wid
[0])
74 trfn_char(ch
, atoi(pos
), 0, atoi(wid
),
75 atoi(llx
), atoi(lly
), atoi(urx
), atoi(ury
));
77 while (fgets(ln
, sizeof(ln
), stdin
)) {
80 if (!strncmp("StartKernPairs", ln
, 14))
83 while (fgets(ln
, sizeof(ln
), stdin
)) {
86 if (!strncmp("EndKernPairs", ln
, 12))
88 if (sscanf(ln
, "KPX %s %s %s", c1
, c2
, wid
) == 3)
89 trfn_kern(c1
, c2
, atoi(wid
));