| 117 |
|
break; |
| 118 |
|
case 'h': /* height of characters */ |
| 119 |
|
cheight = atoi(argv[++an])*SSS; |
| 120 |
– |
xsiz = xsiz = 0; |
| 120 |
|
break; |
| 121 |
|
case 'a': /* aspect ratio */ |
| 122 |
|
aspect = atof(argv[++an]); |
| 160 |
|
double pictaspect; |
| 161 |
|
|
| 162 |
|
if (direct == 'r' || direct == 'l') { |
| 163 |
< |
if (xsiz == 0 || ysiz == 0) { |
| 163 |
> |
if (xsiz <= 0) { |
| 164 |
|
cwidth = cheight/aspect + 0.5; |
| 165 |
|
xsiz = (long)maxwidth*cwidth >> 8; |
| 166 |
|
ysiz = nlines*cheight; |
| 167 |
< |
} else { |
| 167 |
> |
} else if (aspect > FTINY) { |
| 168 |
> |
if (ysiz <= 0) |
| 169 |
> |
ysiz = cheight*nlines; |
| 170 |
|
pictaspect = 256*nlines*aspect/maxwidth; |
| 171 |
|
if (pictaspect*xsiz < ysiz) |
| 172 |
|
ysiz = pictaspect*xsiz + 0.5; |
| 174 |
|
xsiz = ysiz/pictaspect + 0.5; |
| 175 |
|
cheight = ysiz/nlines; |
| 176 |
|
cwidth = cheight/aspect + 0.5; |
| 177 |
+ |
} else { |
| 178 |
+ |
if (ysiz <= 0) |
| 179 |
+ |
ysiz = cheight*nlines; |
| 180 |
+ |
pictaspect = (double)ysiz/xsiz; |
| 181 |
+ |
aspect = pictaspect*maxwidth/(256*nlines); |
| 182 |
+ |
cheight = ysiz/nlines; |
| 183 |
+ |
cwidth = cheight/aspect + 0.5; |
| 184 |
|
} |
| 185 |
|
} else { /* reverse orientation */ |
| 186 |
< |
if (xsiz == 0 || ysiz == 0) { |
| 186 |
> |
if (ysiz <= 0) { |
| 187 |
|
cwidth = cheight/aspect + 0.5; |
| 188 |
|
xsiz = nlines*cheight; |
| 189 |
|
ysiz = (long)maxwidth*cwidth >> 8; |
| 190 |
< |
} else { |
| 190 |
> |
} else if (aspect > FTINY) { |
| 191 |
> |
if (xsiz <= 0) |
| 192 |
> |
xsiz = cheight*nlines; |
| 193 |
|
pictaspect = maxwidth/(256*nlines*aspect); |
| 194 |
|
if (pictaspect*xsiz < ysiz) |
| 195 |
|
ysiz = pictaspect*xsiz + 0.5; |
| 196 |
|
else |
| 197 |
|
xsiz = ysiz/pictaspect + 0.5; |
| 198 |
+ |
cheight = xsiz/nlines; |
| 199 |
+ |
cwidth = cheight/aspect + 0.5; |
| 200 |
+ |
} else { |
| 201 |
+ |
if (xsiz <= 0) |
| 202 |
+ |
xsiz = cheight*nlines; |
| 203 |
+ |
pictaspect = (double)ysiz/xsiz; |
| 204 |
+ |
aspect = maxwidth/(256*nlines*pictaspect); |
| 205 |
|
cheight = xsiz/nlines; |
| 206 |
|
cwidth = cheight/aspect + 0.5; |
| 207 |
|
} |