Files: b2d0368816eaed34a39c0101fed0639cdf4146b3 / cards.ps
3637 bytesRaw
1 | %!PS-Adobe-3.0 |
2 | %%Title: SSB Invitation Cards |
3 | %%LanguageLevel: 2 |
4 | %%EndComments |
5 | %%BeginProlog |
6 | |
7 | /inch {72 mul} def |
8 | |
9 | /MarginLeft {.75 inch} def |
10 | /MarginBottom {.5 inch} def |
11 | /NumRows 5 def |
12 | /NumCols 2 def |
13 | /CardWidth {3.5 inch} def |
14 | /CardHeight {2 inch} def |
15 | /GuideSize {.4 inch} def |
16 | |
17 | /line { |
18 | newpath |
19 | moveto |
20 | lineto |
21 | stroke |
22 | } def |
23 | |
24 | /centershow { |
25 | dup |
26 | stringwidth pop 2 div neg 0 rmoveto |
27 | show |
28 | } bind def |
29 | |
30 | /wrapshow { |
31 | /height exch def |
32 | /len exch def |
33 | { |
34 | dup length len lt { |
35 | show |
36 | exit |
37 | } { |
38 | dup % str str |
39 | 0 len getinterval % str strstart |
40 | dup show |
41 | stringwidth pop neg height neg rmoveto |
42 | dup length len sub len exch getinterval |
43 | } ifelse |
44 | } loop |
45 | } def |
46 | |
47 | /urlsfile (%stdin) (r) file def |
48 | /url 180 string def |
49 | |
50 | /DrawGuides { |
51 | gsave |
52 | .125 setlinewidth |
53 | |
54 | % draw horizontal lines from the sides of the page |
55 | 0 MarginBottom translate |
56 | NumRows 1 add { |
57 | 0 0 GuideSize 0 line |
58 | PageWidth 0 PageWidth GuideSize sub 0 line |
59 | 0 CardHeight translate |
60 | } repeat |
61 | 0 CardHeight NumRows 1 add mul neg translate |
62 | |
63 | % draw vertical lines from the top and bottom of the page |
64 | MarginLeft MarginBottom neg translate |
65 | NumCols 1 add { |
66 | 0 0 0 GuideSize line |
67 | 0 PageHeight 0 PageHeight GuideSize sub line |
68 | CardWidth 0 translate |
69 | } repeat |
70 | |
71 | grestore |
72 | } def |
73 | |
74 | /DrawBorder { |
75 | gsave |
76 | .25 setlinewidth |
77 | |
78 | MarginLeft MarginBottom translate |
79 | |
80 | % draw horizontal line |
81 | NumRows 1 add { |
82 | 0 0 CardWidth NumCols mul 0 line |
83 | 0 CardHeight translate |
84 | } repeat |
85 | 0 CardHeight NumRows 1 add mul neg translate |
86 | |
87 | % draw vertical lines |
88 | NumCols 1 add { |
89 | 0 0 0 CardHeight NumRows mul line |
90 | CardWidth 0 translate |
91 | } repeat |
92 | |
93 | grestore |
94 | } def |
95 | |
96 | /DrawEPS { |
97 | /filename exch def |
98 | /z exch def |
99 | /bottom exch def |
100 | /left exch def |
101 | save |
102 | left bottom translate |
103 | z z scale |
104 | /showpage { } def |
105 | filename run |
106 | |
107 | % see PLRM.pdf page 732 |
108 | 0 setgray |
109 | 0 setlinecap |
110 | 1 setlinewidth |
111 | 0 setlinejoin |
112 | 10 setmiterlimit |
113 | [ ] 0 setdash newpath |
114 | /languagelevel where { |
115 | pop languagelevel 1 ne { |
116 | false setstrokeadjust |
117 | false setoverprint |
118 | } if |
119 | } if |
120 | |
121 | %/Dict_Count countdictstack def |
122 | %/Op_Count count def |
123 | %begin |
124 | |
125 | %end |
126 | %count |
127 | restore |
128 | } def |
129 | |
130 | /DrawCardFront { |
131 | gsave |
132 | urlsfile url readline { |
133 | /url1 exch def |
134 | |
135 | /LiberationSans 16 selectfont |
136 | (Secure Scuttlebutt Network) |
137 | 126 117 moveto centershow |
138 | |
139 | /LiberationSans 13 selectfont |
140 | (Invitation Link:) |
141 | 126 96 moveto centershow |
142 | |
143 | currentrgbcolor |
144 | 0 0 1 setrgbcolor |
145 | /LiberationMono 14 selectfont |
146 | .25 inch 1 inch moveto |
147 | url1 |
148 | 25 14 wrapshow |
149 | setrgbcolor |
150 | |
151 | /w 48 def |
152 | /z 1.5 def |
153 | 126 w z mul 2 div sub |
154 | 12 |
155 | z |
156 | (small-hermes-hearts-0.eps) DrawEPS |
157 | |
158 | /drewsome true def |
159 | } if |
160 | grestore |
161 | } def |
162 | |
163 | /DrawCardBack { |
164 | gsave |
165 | |
166 | /LiberationSans 12 selectfont |
167 | 16 117 moveto |
168 | pub_name show |
169 | |
170 | /LiberationMono 8 selectfont |
171 | pub_id |
172 | 16 102 moveto |
173 | 27 10 wrapshow |
174 | |
175 | /LiberationSans 12 selectfont |
176 | 16 68 moveto |
177 | op_name show |
178 | |
179 | /LiberationMono 8 selectfont |
180 | op_id |
181 | 16 53 moveto |
182 | 27 10 wrapshow |
183 | |
184 | 180 62 1 3 div |
185 | (rainbow-hermies-strong-border.eps) DrawEPS |
186 | |
187 | /LiberationSans 10 selectfont |
188 | 12 16 moveto |
189 | (decentralized - peer-to-peer - off-grid - open source) show |
190 | |
191 | grestore |
192 | } def |
193 | |
194 | currentpagedevice /PageSize get dup |
195 | 0 get /PageWidth exch def |
196 | 1 get /PageHeight exch def |
197 | |
198 | /DrawPage { |
199 | DrawGuides |
200 | %DrawBorder |
201 | |
202 | MarginLeft MarginBottom CardHeight NumRows 1 sub mul add translate |
203 | |
204 | % Draw cards |
205 | NumRows { |
206 | %NumCols { |
207 | % DrawCard |
208 | % CardWidth 0 translate |
209 | %} repeat |
210 | DrawCardFront |
211 | CardWidth 0 translate |
212 | DrawCardBack |
213 | CardWidth 0 translate |
214 | NumCols CardWidth mul neg CardHeight neg translate |
215 | } repeat |
216 | 0 NumRows CardHeight mul neg translate |
217 | |
218 | } def |
219 | |
220 | { |
221 | /drewsome false def |
222 | DrawPage |
223 | drewsome { |
224 | showpage |
225 | } { |
226 | exit |
227 | } ifelse |
228 | } loop |
229 | |
230 | %%EOF |
231 |
Built with git-ssb-web