8#000 format is a "radix" number. That is, a number in a particular base, in this case, base-8, or octal. So octal 40 is the same as hex 20, 16#20, or decimal 32. Those are all the same numbers, and represent the ascii code for the "space" character.
The "widthshow" operator is usually used to define extra horizontal spacing between words. For example, to perform justification by padding extra space after each "space" character (or, conversely, subtracting it).
To return the current xy, use "currentpoint".
For your example, I would use "search". It returns three substrings, if the search is sucessful: post, match, pre. If the search fails, it will return the original string.
So something like this:
Code:
%!PS
% show the capital "W" 2 points higher
/myString (This Should Work) def
/x 72 def
/y 600 def
/Courier 24 selectfont
myString (W) search
{
x y moveto show
currentpoint 2 add moveto show
currentpoint 2 sub moveto show
}
{
x y moveto show
} ifelse
showpage
To code for all capital W's, you'll need to incorporate "search" into a loop:
Code:
%!PS
% show the capital "W" 2 points higher
/myString (This Should Work As Well!) def
/x 72 def
/y 600 def
/Courier 24 selectfont
myString
{
(W) search
{
x y moveto show
currentpoint 2 add moveto show
currentpoint 2 sub
/y exch def
/x exch def
}
{
x y moveto show
exit
} ifelse
} loop
showpage
None of the above code has been tested, it's all written "off-the-cuff", but looks right!
Thomas D. Greer
Providing PostScript & PDF
Training, Development & Consulting