Commit ca9a63c9 authored by Peter Billam's avatar Peter Billam

roll in the proc from before it gets changed there

parent 64b93b74
......@@ -9,8 +9,33 @@
(/home/pjb/ps/lib/ run
(/home/pjb/ps/lib/ run
(/home/pjb/ps/lib/ run
% 20181122
% (/home/pjb/ps/lib/ run
% ( perhaps useful: a way to _scale_ a sequence of calls to a given width,
% or perhaps best just to do it, measure currentpoint, then re-do it ?)
% /str_in_rect { % str xmargin ymargin fgfunc bgfunc str_in_rect -> y_top ?
/str_in_rect { % str xmargin ymargin fgcolor bgcolor str_in_rect -> y_top
% See at 06:30
20 dict begin
[/bgb /bgg /bgr /fgb /fgg /fgr /ymargin /xmargin /str] {exch def} forall
currentpoint /cpy exch def /cpx exch def % remember the currentpoint
gsave % measure bbox of the string, including unwanted blanks llx and lly
0 0 moveto str true charpath flattenpath pathbbox
[ /ury /urx /lly /llx ] { exch def } forall
bgr bgg bgb setrgbcolor
cpx cpy
xmargin urx add llx sub xmargin add
ury lly sub ymargin add ymargin add rectfill
fgr fgg fgb setrgbcolor
xmargin llx sub ymargin lly sub rmoveto str show
% leave the currentpoint at the lower-right corner !
cpx llx sub xmargin add urx add xmargin add cpy moveto
ury lly sub ymargin add ymargin add cpy add % leave y_top on the stack !
} def
%%Page: 1 1
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment