source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: Slightly increase widths calculated from string lengths (mainly
@ 2017-03-14  1:35 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2017-03-14  1:35 UTC (permalink / raw)
  To: source

Log Message:
-----------
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>.

Modified Files:
--------------
    mdocml:
        html.c
        mdoc_html.c

Revision Data
-------------
Index: html.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/html.c,v
retrieving revision 1.208
retrieving revision 1.209
diff -Lhtml.c -Lhtml.c -u -p -r1.208 -r1.209
--- html.c
+++ html.c
@@ -591,6 +591,8 @@ print_otag(struct html *h, enum htmltag 
 				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;
Index: mdoc_html.c
===================================================================
RCS file: /home/cvs/mdocml/mdocml/mdoc_html.c,v
retrieving revision 1.275
retrieving revision 1.276
diff -Lmdoc_html.c -Lmdoc_html.c -u -p -r1.275 -r1.276
--- mdoc_html.c
+++ 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, "");
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2017-03-14  1:35 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-14  1:35 mdocml: Slightly increase widths calculated from string lengths (mainly schwarze

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).