source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: Properly scale string length measurements for PostScript and PDF
@ 2014-10-13 22:00 schwarze
  0 siblings, 0 replies; only message in thread
From: schwarze @ 2014-10-13 22:00 UTC (permalink / raw)
  To: source

Log Message:
-----------
Properly scale string length measurements for PostScript and PDF output;
this doesn't change anything for ASCII and UTF-8.
Problem reported by bentley@.

Modified Files:
--------------
    mdocml:
        mdoc_term.c

Revision Data
-------------
Index: mdoc_term.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/mdoc_term.c,v
retrieving revision 1.282
retrieving revision 1.283
diff -Lmdoc_term.c -Lmdoc_term.c -u -p -r1.282 -r1.283
--- mdoc_term.c
+++ mdoc_term.c
@@ -541,8 +541,10 @@ a2width(const struct termp *p, const cha
 	struct roffsu	 su;
 
 	assert(v);
-	if ( ! a2roffsu(v, &su, SCALE_MAX))
+	if ( ! a2roffsu(v, &su, SCALE_MAX)) {
 		SCALE_HS_INIT(&su, term_strlen(p, v));
+		su.scale /= term_strlen(p, "0");
+	}
 
 	return(term_hspan(p, &su));
 }
@@ -560,8 +562,10 @@ a2offs(const struct termp *p, const char
 		return(term_len(p, p->defindent + 1));
 	else if (0 == strcmp(v, "indent-two"))
 		return(term_len(p, (p->defindent + 1) * 2));
-	else if ( ! a2roffsu(v, &su, SCALE_MAX))
+	else if ( ! a2roffsu(v, &su, SCALE_MAX)) {
 		SCALE_HS_INIT(&su, term_strlen(p, v));
+		su.scale /= term_strlen(p, "0");
+	}
 
 	return(term_hspan(p, &su));
 }
--
 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:[~2014-10-13 22:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-10-13 22:00 mdocml: Properly scale string length measurements for PostScript and PDF 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).