From 5d1669e2730d21e3f48739002619b3605c32ed23 Mon Sep 17 00:00:00 2001 From: Manolo Gouy Date: Tue, 15 Feb 2011 13:48:06 +0000 Subject: Corrected PostScript show_pos_width procedure that writes text with pre-determined width: division by length is replaced by division by (length/2 - 1), the correct value. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8424 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_PostScript.cxx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Fl_PostScript.cxx') diff --git a/src/Fl_PostScript.cxx b/src/Fl_PostScript.cxx index 75cc987fe..92ad12491 100644 --- a/src/Fl_PostScript.cxx +++ b/src/Fl_PostScript.cxx @@ -268,7 +268,8 @@ static const char * prolog = // show at position with desired width // usage: // width (string) x y show_pos_width -"/show_pos_width {GS moveto dup dup stringwidth pop exch length exch 3 index exch sub exch " +"/show_pos_width {GS moveto dup dup stringwidth pop exch length 2 div 1 sub dup 0 eq {pop 1} if " +"exch 3 index exch sub exch " "div 0 2 index 1 -1 scale ashow pop pop GR} bind def\n" // spacing altered to match desired width //"/show_pos_width {GS moveto dup stringwidth pop 3 2 roll exch div -1 matrix scale concat " //"show GR } bind def\n" // horizontally scaled text to match desired width -- cgit v1.2.3