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
This commit is contained in:
Manolo Gouy 2011-02-15 13:48:06 +00:00
parent f397c36c06
commit 5d1669e273
1 changed files with 2 additions and 1 deletions

View File

@ -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