summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/Fl_PostScript.cxx3
1 files changed, 2 insertions, 1 deletions
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