]> git.lizzy.rs Git - plan9front.git/blob - sys/lib/ghostscript/caption.ps
merge
[plan9front.git] / sys / lib / ghostscript / caption.ps
1 %!
2 %    Copyright (C) 1995 Aladdin Enterprises.  All rights reserved.
3
4 % This software is provided AS-IS with no warranty, either express or
5 % implied.
6
7 % This software is distributed under license and may not be copied,
8 % modified or distributed except as expressly authorized under the terms
9 % of the license contained in the file LICENSE in this distribution.
10
11 % For more information about licensing, please refer to
12 % http://www.ghostscript.com/licensing/. For information on
13 % commercial licensing, go to http://www.artifex.com/licensing/ or
14 % contact Artifex Software, Inc., 101 Lucas Valley Road #110,
15 % San Rafael, CA  94903, U.S.A., +1(415)492-9861.
16
17 % $Id: caption.ps,v 1.4 2002/02/21 21:49:28 giles Exp $
18 % Add a "caption" to the bottom of each page.
19 /captionsize 20 def
20 /caption
21  { /Helvetica //captionsize selectfont
22    (Printed by Aladdin's XXYYZZ) show
23    /Symbol //captionsize selectfont
24    (\324) show          % trademarkserif
25    /Helvetica //captionsize selectfont
26    ( product) show
27  } bind def
28
29 10 dict begin
30 gsave
31   initgraphics
32   clippath pathbbox
33   pop exch 36 add /by exch def
34                 % We can't use stringwidth, so we have to show and measure.
35   gsave
36     0 0 0 0 rectclip
37     0 0 moveto caption currentpoint pop /bw exch def
38   grestore
39   add bw sub 2 div /bx exch def
40                 % We don't have the font bbox available, so we guess.
41   /bh captionsize 1.05 mul def
42 grestore
43 /showcaption
44  { gsave
45      initgraphics
46      //bx 9 sub //by 9 sub //bw 18 add //bh 18 add
47      1 setgray 4 copy rectfill 0 setgray 1.5 setlinewidth rectstroke
48      //bx //by moveto //caption exec
49    grestore
50  } bind def
51 << /EndPage [
52    /showcaption load /exec load
53    currentpagedevice /EndPage get /exec load
54    ] cvx
55 >> setpagedevice
56 end