2 |
- |
1 |
static char *PS_head[] = {
|
|
|
2 |
"%ps_include: begin\n",
|
|
|
3 |
"save\n",
|
|
|
4 |
"/ed {exch def} def\n",
|
|
|
5 |
"{} /showpage ed\n",
|
|
|
6 |
"{} /copypage ed\n",
|
|
|
7 |
"{} /erasepage ed\n",
|
|
|
8 |
"{} /letter ed\n",
|
|
|
9 |
"currentdict /findfont known systemdict /findfont known and {\n",
|
|
|
10 |
" /findfont systemdict /findfont get def\n",
|
|
|
11 |
"} if\n",
|
|
|
12 |
"36 dict dup /PS-include-dict-dw ed begin\n",
|
|
|
13 |
"/context ed\n",
|
|
|
14 |
"count array astore /o-stack ed\n",
|
|
|
15 |
"%ps_include: variables begin\n",
|
|
|
16 |
|
|
|
17 |
};
|
|
|
18 |
|
|
|
19 |
static char *PS_setup[] = {
|
|
|
20 |
"%ps_include: variables end\n",
|
|
|
21 |
"{llx lly urx ury} /bbox ed\n",
|
|
|
22 |
"{newpath 2 index exch 2 index exch dup 6 index exch\n",
|
|
|
23 |
" moveto 3 {lineto} repeat closepath} /boxpath ed\n",
|
|
|
24 |
"{dup mul exch dup mul add sqrt} /len ed\n",
|
|
|
25 |
"{2 copy gt {exch} if pop} /min ed\n",
|
|
|
26 |
"{2 copy lt {exch} if pop} /max ed\n",
|
|
|
27 |
"{transform round exch round exch A itransform} /nice ed\n",
|
|
|
28 |
"{6 array} /n ed\n",
|
|
|
29 |
"n defaultmatrix n currentmatrix n invertmatrix n concatmatrix /A ed\n",
|
|
|
30 |
"urx llx sub 0 A dtransform len /Sx ed\n",
|
|
|
31 |
"0 ury lly sub A dtransform len /Sy ed\n",
|
|
|
32 |
"llx urx add 2 div lly ury add 2 div A transform /Cy ed /Cx ed\n",
|
|
|
33 |
"rot dup sin abs /S ed cos abs /C ed\n",
|
|
|
34 |
"Sx S mul Sy C mul add /H ed\n",
|
|
|
35 |
"Sx C mul Sy S mul add /W ed\n",
|
|
|
36 |
"sy H div /Scaley ed\n",
|
|
|
37 |
"sx W div /Scalex ed\n",
|
|
|
38 |
"s 0 eq {Scalex Scaley min dup /Scalex ed /Scaley ed} if\n",
|
|
|
39 |
"sx Scalex W mul sub 0 max ax 0.5 sub mul cx add /cx ed\n",
|
|
|
40 |
"sy Scaley H mul sub 0 max ay 0.5 sub mul cy add /cy ed\n",
|
|
|
41 |
"urx llx sub 0 A dtransform exch atan rot exch sub /rot ed\n",
|
|
|
42 |
"n currentmatrix initgraphics setmatrix\n",
|
|
|
43 |
"cx cy translate\n",
|
|
|
44 |
"Scalex Scaley scale\n",
|
|
|
45 |
"rot rotate\n",
|
|
|
46 |
"Cx neg Cy neg translate\n",
|
|
|
47 |
"A concat\n",
|
|
|
48 |
"bbox boxpath clip newpath\n",
|
|
|
49 |
"w 0 ne {gsave bbox boxpath 1 setgray fill grestore} if\n",
|
|
|
50 |
"end\n",
|
|
|
51 |
"gsave\n",
|
|
|
52 |
"%ps_include: inclusion begin\n",
|
|
|
53 |
|
|
|
54 |
};
|
|
|
55 |
|
|
|
56 |
static char *PS_tail[] = {
|
|
|
57 |
"%ps_include: inclusion end\n",
|
|
|
58 |
"grestore\n",
|
|
|
59 |
"PS-include-dict-dw begin\n",
|
|
|
60 |
"o 0 ne {gsave A defaultmatrix /A ed llx lly nice urx ury nice\n",
|
|
|
61 |
" initgraphics 0.1 setlinewidth boxpath stroke grestore} if\n",
|
|
|
62 |
"clear o-stack aload pop\n",
|
|
|
63 |
"context end restore\n",
|
|
|
64 |
"%ps_include: end\n",
|
|
|
65 |
|
|
|
66 |
};
|