2
%%Creator: arnold@skeeve (Aharon Robbins)
3
%%Title: rflashlight.small.xpic (xpic)
4
%%CreationDate: Tue Dec 12 09:51:27 2000
6
%%BoundingBox: 0 0 72 28.8
7
% (in inches) at 0 0, width 1, height 0.4
9
% Prolog for xpic to PostScript converter
11
% $Header: x2ps.pro,v 1.2 88/03/19 16:50:09 moraes Exp
12
% %d D - change style SOLID, DOTTED, SHORT-DASH, LONG-DASH, DOT-DASH
13
% %s F - change font to fontname
14
% %d S - change size (font size in points)
15
% (%s) rj %d t - text right just. (%d is TOPLINE, MIDLINE, BOTLINE)
16
% (%s) lj %d t - text left just. (%d is TOPLINE, MIDLINE, BOTLINE)
17
% (%s) ce %d t - text centered (%d is TOPLINE, MIDLINE, BOTLINE)
20
% %d %d s - spline segment
21
% x - flush line, spline
22
% <wid> <ht> <x> <y> b - box
23
% <wid> <ht> <x> <y> e - ellipse
25
% %d W - change linewidth
26
% getpagesize - gets the values of PAGEHEIGHT and PAGEWIDTH
27
% %d %d flip - translate by %d, PAGEHEIGHT - %d (this
28
% transforms to X windows coordinates)
29
save 50 dict begin /xpic exch def
30
/StartXpic {newpath 0 0 moveto [] 0 setdash 0 setgray 1 setlinecap} def
32
/fontname /Times-Roman def
34
% halign has the values for MIDLINE, TOPLINE, BOTLINE
41
/ury exch def /urx exch def /lly exch def /llx exch def
42
llx lly moveto urx lly lineto urx ury lineto
43
llx ury lineto llx lly lineto stroke
47
/yc exch def /xc exch def /yrad exch def /xrad exch def
49
/savematrix mtrx currentmatrix def
53
savematrix setmatrix stroke
55
% The next three take the text string, and moveto the right horiz. position
56
% leaving the string on the stack.
58
/rj {dup stringwidth pop neg 0 rmoveto} def
59
/ce {dup stringwidth pop 2 div neg 0 rmoveto} def
60
% And this is invoked after one of the three above, and
61
% computes the vert. pos, and then displays the string.
62
/t {halign exch get 0 exch rmoveto show newpath} def
63
% Store an array of patterns in /styles - a pattern is an array consisting
64
% of an array and an offset. Corresp to xpic patterns
65
% solid, dotted, short-dashed, long-dashed, dot-dashed
66
/styles [ [] 0 ] [ [1 3] 0 ] [ [4 4] 0 ] [ [8 4] 0 ] [ [1 4 4 4] 0 ]
68
% change style to arg.
69
/D {stroke styles exch get aload pop setdash newpath} def
70
/W {stroke 0.5 mul setlinewidth newpath} def
71
% fontbox takes a fontname off the stack, and returns an array
72
% containing the values of the bottom line of the bounding box, the
73
% mid line of the bounding box, and the top line of the bounding box
74
% of that font, taken from the baseline, scaled to a font of size 1
76
findfont dup /FontMatrix get /fm exch def /FontBBox get aload pop
77
/ytop exch def pop /ybot exch def pop
78
/ymid ytop ybot sub 2 div def
79
0 ybot fm dtransform exch pop % botline
80
dup neg exch % midline - this works better than (ytop-ybot)/2!
81
0 ytop fm dtransform exch pop exch %topline
82
% now in the order midline, topline, botline.
87
dup /fontname exch def fontbox
88
/thisfontbox exch def SF
91
/S {/ptsize exch def SF} def
94
fontname findfont ptsize curscale div scalefont setfont
97
pop ptsize mul curscale div neg 3 1 roll
101
% sets the scale to 72 / n, where n is on the stack, and stores the value
102
% in curscale for font scaling
104
/getpagesize{newpath clippath pathbbox /pageheight exch def
105
/pagewidth exch def pop pop newpath} def
106
/flip{pageheight exch sub translate} def
107
/ss {/curscale exch 72 exch div dup dup scale def} def
108
/land {90 rotate} def
133
% Trailer for xpic to PostScript converter
134
% $Header: x2ps.tra,v 1.2 89/07/02 15:59:53 moraes Exp $