Commit ca9a63c9 authored by Peter Billam's avatar Peter Billam

roll in the proc from text.ps before it gets changed there

parent 64b93b74
......@@ -9,8 +9,33 @@
%%EndComments
%%BeginProlog
(/home/pjb/ps/lib/colours.ps) run
(/home/pjb/ps/lib/text.ps) run
(/home/pjb/ps/lib/fonts.ps) run
% 20181122
% (/home/pjb/ps/lib/fonts.ps) 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 http://www.ubu.com/film/sackner_concrete.html 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
grestore
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 !
end
} def
%%EndProlog
%%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