140 |
|
/* convert text to bitmap */ |
141 |
|
maptext(); |
142 |
|
/* print header */ |
143 |
+ |
newheader("RADIANCE", stdout); |
144 |
|
printargs(argc, argv, stdout); |
145 |
|
fputformat(COLRFMT, stdout); |
146 |
|
putchar('\n'); |
169 |
|
else |
170 |
|
xsiz = ysiz/pictaspect + 0.5; |
171 |
|
cheight = ysiz/nlines; |
172 |
< |
cwidth = cheight/aspect + 0.5; |
172 |
> |
cwidth = cheight/aspect; |
173 |
|
} else { |
174 |
|
if (ysiz <= 0) |
175 |
|
ysiz = cheight*nlines; |
176 |
|
pictaspect = (double)ysiz/xsiz; |
177 |
|
aspect = pictaspect*maxwidth/(256*nlines); |
178 |
|
cheight = ysiz/nlines; |
179 |
< |
cwidth = cheight/aspect + 0.5; |
179 |
> |
cwidth = cheight/aspect; |
180 |
|
} |
181 |
|
} else { /* reverse orientation */ |
182 |
|
if (ysiz <= 0) { |
192 |
|
else |
193 |
|
xsiz = ysiz/pictaspect + 0.5; |
194 |
|
cheight = xsiz/nlines; |
195 |
< |
cwidth = cheight/aspect + 0.5; |
195 |
> |
cwidth = cheight/aspect; |
196 |
|
} else { |
197 |
|
if (xsiz <= 0) |
198 |
|
xsiz = cheight*nlines; |
199 |
|
pictaspect = (double)ysiz/xsiz; |
200 |
|
aspect = maxwidth/(256*nlines*pictaspect); |
201 |
|
cheight = xsiz/nlines; |
202 |
< |
cwidth = cheight/aspect + 0.5; |
202 |
> |
cwidth = cheight/aspect; |
203 |
|
} |
204 |
|
} |
205 |
|
if (xsiz % SSS) |
217 |
|
gettext(fp) /* get text from a file */ |
218 |
|
FILE *fp; |
219 |
|
{ |
219 |
– |
char *fgets(); |
220 |
|
char buf[MAXLINE]; |
221 |
|
register LINE *curl; |
222 |
|
int len; |
239 |
|
curl->s[len] = '\0'; |
240 |
|
if (spacing < -1./256.) |
241 |
|
len = squeeztext(curl->sp, curl->s, ourfont, |
242 |
< |
(int)(spacing*-256.0)); |
242 |
> |
(int)(spacing*-256.)); |
243 |
|
else if (spacing > 1./256.) |
244 |
|
len = proptext(curl->sp, curl->s, ourfont, |
245 |
< |
(int)(spacing*256.0), 3); |
245 |
> |
(int)(spacing*256.), 3); |
246 |
|
else |
247 |
|
len = uniftext(curl->sp, curl->s, ourfont); |
248 |
|
if (len > maxwidth) |
280 |
|
ourtext->sp = (short *)malloc(sizeof(short)*(maxline+1)); |
281 |
|
if (ourtext->sp == NULL) |
282 |
|
goto memerr; |
283 |
< |
if (spacing < 0.0) |
283 |
> |
if (spacing < -1./256.) |
284 |
|
maxwidth = squeeztext(ourtext->sp, ourtext->s, ourfont, |
285 |
< |
(int)(spacing*-256.0)); |
286 |
< |
else if (spacing > 0.0) |
285 |
> |
(int)(spacing*-256.)); |
286 |
> |
else if (spacing > 1./256.) |
287 |
|
maxwidth = proptext(ourtext->sp, ourtext->s, ourfont, |
288 |
< |
(int)(spacing*256.0), 3); |
288 |
> |
(int)(spacing*256.), 3); |
289 |
|
else |
290 |
|
maxwidth = uniftext(ourtext->sp, ourtext->s, ourfont); |
291 |
|
nlines = 1; |