Index: html.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/html.c,v
retrieving revision 1.160
diff -u -p -r1.160 html.c
--- html.c 10 Aug 2014 23:54:41 -0000 1.160
+++ html.c 12 Aug 2014 01:02:16 -0000
@@ -759,6 +759,8 @@ bufcat_su(struct html *h, const char *p,
v = su->scale;
if (SCALE_MM == su->unit && 0.0 == (v /= 100.0))
v = 1.0;
+ else if (SCALE_BU == su->unit)
+ v /= 24.0;
bufcat_fmt(h, "%s: %.2f%s;", p, v, roffscales[su->unit]);
}
Index: term_ascii.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/term_ascii.c,v
retrieving revision 1.28
diff -u -p -r1.28 term_ascii.c
--- term_ascii.c 10 Aug 2014 23:54:41 -0000 1.28
+++ term_ascii.c 12 Aug 2014 01:02:16 -0000
@@ -230,31 +230,41 @@ ascii_hspan(const struct termp *p, const
double r;
/*
- * Approximate based on character width. These are generated
- * entirely by eyeballing the screen, but appear to be correct.
+ * Approximate based on character width.
+ * None of these will be actually correct given that an inch on
+ * the screen depends on character size, terminal, etc., etc.
*/
-
switch (su->unit) {
+ case SCALE_BU:
+ r = su->scale * 10.0 / 240.0;
+ break;
case SCALE_CM:
- r = su->scale * 4.0;
+ r = su->scale * 10.0 / 2.54;
+ break;
+ case SCALE_FS:
+ r = su->scale * 2750.0;
break;
case SCALE_IN:
r = su->scale * 10.0;
break;
+ case SCALE_MM:
+ r = su->scale / 100.0;
+ break;
case SCALE_PC:
- r = (su->scale * 10.0) / 6.0;
+ r = su->scale * 10.0 / 6.0;
break;
case SCALE_PT:
- r = (su->scale * 10.0) / 72.0;
- break;
- case SCALE_MM:
- r = su->scale / 1000.0;
+ r = su->scale * 10.0 / 72.0;
break;
case SCALE_VS:
r = su->scale * 2.0 - 1.0;
break;
- default:
+ case SCALE_EN:
+ case SCALE_EM:
r = su->scale;
+ break;
+ case SCALE_MAX:
+ abort();
break;
}
Index: term_ps.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/term_ps.c,v
retrieving revision 1.63
diff -u -p -r1.63 term_ps.c
--- term_ps.c 10 Aug 2014 23:54:41 -0000 1.63
+++ term_ps.c 12 Aug 2014 01:02:17 -0000
@@ -1117,28 +1117,32 @@ ps_hspan(const struct termp *p, const st
*/
switch (su->unit) {
- case SCALE_CM:
- r = PNT2AFM(p, su->scale * 28.34);
- break;
- case SCALE_IN:
- r = PNT2AFM(p, su->scale * 72.0);
+ case SCALE_BU:
+ r = PNT2AFM(p, su->scale * 6.0 / 240.0);
break;
- case SCALE_PC:
- r = PNT2AFM(p, su->scale * 12.0);
- break;
- case SCALE_PT:
- r = PNT2AFM(p, su->scale * 100.0);
+ case SCALE_CM:
+ r = PNT2AFM(p, su->scale * 72.0 / 2.54);
break;
case SCALE_EM:
r = su->scale *
fonts[(int)TERMFONT_NONE].gly[109 - 32].wx;
break;
- case SCALE_MM:
- r = PNT2AFM(p, su->scale * 2.834);
- break;
case SCALE_EN:
r = su->scale *
fonts[(int)TERMFONT_NONE].gly[110 - 32].wx;
+ break;
+ case SCALE_IN:
+ r = PNT2AFM(p, su->scale * 72.0);
+ break;
+ case SCALE_MM:
+ r = su->scale *
+ fonts[(int)TERMFONT_NONE].gly[109 - 32].wx / 100.0;
+ break;
+ case SCALE_PC:
+ r = PNT2AFM(p, su->scale * 12.0);
+ break;
+ case SCALE_PT:
+ r = PNT2AFM(p, su->scale * 1.0);
break;
case SCALE_VS:
r = su->scale * p->ps->lineheight;