38 |
|
|
39 |
|
int cheight = 32*SSS; /* character height */ |
40 |
|
double aspect = 1.67; /* height/width character aspect */ |
41 |
+ |
double spacing = 0.0; /* character spacing */ |
42 |
|
int cwidth; /* computed character width */ |
43 |
|
|
44 |
|
unsigned char *ourbitmap; /* our output bitmap */ |
66 |
|
int maxwidth; /* maximum line width (dvi) */ |
67 |
|
|
68 |
|
extern char *getenv(); |
68 |
– |
extern char *malloc(), *calloc(); |
69 |
|
|
70 |
|
|
71 |
|
main(argc, argv) |
115 |
|
case 'a': /* aspect ratio */ |
116 |
|
aspect = atof(argv[++an]); |
117 |
|
break; |
118 |
+ |
case 's': /* spacing */ |
119 |
+ |
spacing = atof(argv[++an]); |
120 |
+ |
break; |
121 |
|
default:; |
122 |
|
unkopt: |
123 |
|
fprintf(stderr, "%s: unknown option: %s\n", |
164 |
|
if (ysiz % SSS) |
165 |
|
ysiz += SSS - ysiz%SSS; |
166 |
|
xdim = (xsiz+7)/8; |
167 |
< |
ourbitmap = (BYTE *)calloc(ysiz, xdim); |
167 |
> |
ourbitmap = (BYTE *)bmalloc(ysiz*xdim); |
168 |
|
if (ourbitmap == NULL) |
169 |
|
error(SYSTEM, "Out of memory in makemap"); |
170 |
+ |
bzero((char *)ourbitmap, ysiz*xdim); |
171 |
|
} |
172 |
|
|
173 |
|
|
195 |
|
maxline = len; |
196 |
|
strncpy(curl->s, buf, len); |
197 |
|
curl->s[len] = '\0'; |
198 |
< |
len = uniftext(curl->sp, curl->s, ourfont); |
198 |
> |
if (spacing < -1./256.) |
199 |
> |
len = squeeztext(curl->sp, curl->s, ourfont, |
200 |
> |
(int)(spacing*-256.0)); |
201 |
> |
else if (spacing > 1./256.) |
202 |
> |
len = proptext(curl->sp, curl->s, ourfont, |
203 |
> |
(int)(spacing*256.0), 3); |
204 |
> |
else |
205 |
> |
len = uniftext(curl->sp, curl->s, ourfont); |
206 |
|
if (len > maxwidth) |
207 |
|
maxwidth = len; |
208 |
|
curl->next = ourtext; |
238 |
|
ourtext->sp = (short *)malloc(sizeof(short)*(maxline+1)); |
239 |
|
if (ourtext->sp == NULL) |
240 |
|
goto memerr; |
241 |
< |
maxwidth = squeeztext(ourtext->sp, ourtext->s, ourfont, 50); |
241 |
> |
if (spacing < 0.0) |
242 |
> |
maxwidth = squeeztext(ourtext->sp, ourtext->s, ourfont, |
243 |
> |
(int)(spacing*-256.0)); |
244 |
> |
else if (spacing > 0.0) |
245 |
> |
maxwidth = proptext(ourtext->sp, ourtext->s, ourfont, |
246 |
> |
(int)(spacing*256.0), 3); |
247 |
> |
else |
248 |
> |
maxwidth = uniftext(ourtext->sp, ourtext->s, ourfont); |
249 |
|
nlines = 1; |
250 |
|
return; |
251 |
|
memerr: |