version 1.28, 2014/08/10 23:54:41 |
version 1.29, 2014/08/13 20:34:29 |
Line 230 ascii_hspan(const struct termp *p, const struct roffsu |
|
Line 230 ascii_hspan(const struct termp *p, const struct roffsu |
|
double r; |
double r; |
|
|
/* |
/* |
* Approximate based on character width. These are generated |
* Approximate based on character width. |
* entirely by eyeballing the screen, but appear to be correct. |
* None of these will be actually correct given that an inch on |
|
* the screen depends on character size, terminal, etc., etc. |
*/ |
*/ |
|
|
switch (su->unit) { |
switch (su->unit) { |
|
case SCALE_BU: |
|
r = su->scale * 10.0 / 240.0; |
|
break; |
case SCALE_CM: |
case SCALE_CM: |
r = su->scale * 4.0; |
r = su->scale * 10.0 / 2.54; |
break; |
break; |
|
case SCALE_FS: |
|
r = su->scale * 2730.666; |
|
break; |
case SCALE_IN: |
case SCALE_IN: |
r = su->scale * 10.0; |
r = su->scale * 10.0; |
break; |
break; |
|
case SCALE_MM: |
|
r = su->scale / 100.0; |
|
break; |
case SCALE_PC: |
case SCALE_PC: |
r = (su->scale * 10.0) / 6.0; |
r = su->scale * 10.0 / 6.0; |
break; |
break; |
case SCALE_PT: |
case SCALE_PT: |
r = (su->scale * 10.0) / 72.0; |
r = su->scale * 10.0 / 72.0; |
break; |
break; |
case SCALE_MM: |
|
r = su->scale / 1000.0; |
|
break; |
|
case SCALE_VS: |
case SCALE_VS: |
r = su->scale * 2.0 - 1.0; |
r = su->scale * 2.0 - 1.0; |
break; |
break; |
default: |
case SCALE_EN: |
|
case SCALE_EM: |
r = su->scale; |
r = su->scale; |
|
break; |
|
case SCALE_MAX: |
|
abort(); |
break; |
break; |
} |
} |
|
|