summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-03-14 01:35:15 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-03-14 01:35:15 +0000
commit1868a0d4224f0f94adf4fa7d103cf10e2020f5ea (patch)
tree472b810b4d3e36db400d05c88562b4002fca2d74
parent54d1a62fbd61f3e802d86ef0900c4403294f2beb (diff)
downloadmandoc-1868a0d4224f0f94adf4fa7d103cf10e2020f5ea.tar.gz
Slightly increase widths calculated from string lengths (mainly
for .Bl -tag lists and SYNOPSIS .Nm blocks), such that the text still fits even if it is printed in bold font. This is an ugly band aid - but implementing font-dependent width measurements would be a major project and even more difficult for HTML than for PostScript. Issue reported by Jan Stary <hans at stare dot cz>.
-rw-r--r--html.c2
-rw-r--r--mdoc_html.c3
2 files changed, 4 insertions, 1 deletions
diff --git a/html.c b/html.c
index ea21d49f..c477fd1b 100644
--- a/html.c
+++ b/html.c
@@ -591,6 +591,8 @@ print_otag(struct html *h, enum htmltag tag, const char *fmt, ...)
break;
su = &mysu;
a2width(arg2, su);
+ /* Increase width to make even bold text fit. */
+ su->scale *= 1.1;
if (fmt[-1] == 'W')
su->scale *= -1.0;
break;
diff --git a/mdoc_html.c b/mdoc_html.c
index b628bb56..3a0b774b 100644
--- a/mdoc_html.c
+++ b/mdoc_html.c
@@ -628,7 +628,8 @@ mdoc_nm_pre(MDOC_ARGS)
len = html_strlen(meta->name);
t = print_otag(h, TAG_COLGROUP, "");
- print_otag(h, TAG_COL, "shw", len);
+ /* Increase width to make even bold text fit. */
+ print_otag(h, TAG_COL, "shw", len + 2);
print_otag(h, TAG_COL, "");
print_tagq(h, t);
print_otag(h, TAG_TR, "");