Debian Codegraph @

texmf-dist/fonts/source/public/bartel-chess-fonts/pkking.mf

raw
1 % This is
2 % pkking.mf
3 %
4 % Copyright (C) 1989-92 by Elmar Bartel.
5 %
6 % This program is free software; you can redistribute it and/or modify
7 % it under the terms of the GNU General Public License as published by
8 % the Free Software Foundation; either version 1, or (at your option)
9 % any later version.
10 %
11 % This program is distributed in the hope that it will be useful,
12 % but WITHOUT ANY WARRANTY; without even the implied warranty of
13 % MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 % GNU General Public License for more details.
15 %
16 % You should have received a copy of the GNU General Public License
17 % along with this program; if not, write to the Free Software
18 % Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 %
20 %we have to define six essential characters:
21 % WoW NoW BoW WoB NoB BoB
22 %Pawn 0 6 12 18 24 30
23 %Knight 1 7 13 19 25 31
24 %Bishop 2 8 14 20 26 32
25 %Rook 3 9 15 21 27 33
26 %Queen 4 10 16 22 28 34
27 %King 5 11 17 23 29 35
28
29 def SetParam =
30 numeric BowOneW,ThreeFour,SixHor,FourSix;
31 BowOneW = .52qs;
32 ThreeFour = .10;
33 FourFive = .60; % z5 is Top of Heart
34 SixHor = 1.40;
35 FourSix = .29;
36
37 numeric CrossWidth, CrossHeight, CrossAbove;
38 CrossWidth = .30;
39 CrossHeight = .18;
40 CrossAbove = .18; %Middle of cross above center of heart.
41 enddef;
42
43 def DefinePointsAndBows =
44 % Points are numbered from 0 to 9 from lower to upper
45 % Points to the left have suffix a, right suffic b
46 % points without further suffix are in the center
47
48 SetParam;
49 DefineFootBows( 0, % No Space to Bottom
50 BowOneW,
51 .22qs, % FootHeight
52 .40, % BowTwoLoc
53 .15, % WidthToHeight
54 .90, % BowTwoLen
55 1.00); % BowThreeLen
56
57 z4 = z3 + BowOneW*ThreeFour*up;
58 z5 = z4 + BowOneW*FourFive*up;
59 y6l= y6r = y4 + BowOneW*FourSix;
60 x6l + x6r = qs; x6r - x6l = SixHor*BowOneW;
61
62 z7 = z5 + CrossAbove*BowOneW*up;
63 y7 = y7l = y7r;
64 x7l + x7r = qs; x7r - x7l = CrossWidth*BowOneW;
65 z8 = z7 + CrossHeight*BowOneW*up;
66
67 path Cross[];
68 Cross1= z5--z8;
69 Cross2= z7l--z7r;
70 enddef;
71
72 def DrawCross =
73 draw Cross1;
74 draw Cross2;
75 enddef;
76
77 def UnDrawCross =
78 undraw Cross1;
79 undraw Cross2;
80 enddef;
81
82 def DefineKingPaths =
83 path LeftPath,RightPath,LeftInnerPath,RightInnerPath,
84 OuterPath,TopHeartPath,HeartPath;
85 LeftPath = z1l .. z2l .. z3l .. z6l .. {down} z4 -- z3;
86 RightPath= reverse LeftPath reflectedabout (z3,z4);
87 %RightPath= z3 -- z4 {up} .. z6r .. z3r .. z2r .. z1r;
88 LeftInnerPath = ParallelPath(subpath (1.8,5)of LeftPath,
89 -1.6*thin);
90 RightInnerPath = LeftInnerPath reflectedabout (z3,z4);
91
92 OuterPath = LeftPath .. RightPath .. Bow0 .. cycle;
93 HeartStart = 3.75;
94 HeartPath = subpath (4,HeartStart) of LeftPath &
95 point HeartStart of LeftPath
96 {-direction HeartStart of LeftPath}..
97 {right}z5{right}..
98 point HeartStart of reverse RightPath
99 {direction HeartStart of reverse RightPath} &
100 subpath (HeartStart,4) of reverse RightPath;
101
102 enddef;
103
104 def MakeWhiteKing =
105 clearit;
106 pickup chess_pen;
107 draw Bow[1];
108 draw Bow[2];
109 draw Bow[3];
110 draw OuterPath;
111 draw HeartPath;
112 DrawCross;
113 %pickup inner_pen;
114 %pickup chess_pen;
115 %draw ParallelPath(subpath(1.7,5)of LeftPath,-2thin);
116 %draw ParallelPath(subpath(0,3.3)of RightPath,-2thin);
117 if proofing > 0:
118 ScreenGrid(0,qs)(0,qs);
119 fi;
120 WhiteMan:= currentpicture;
121 enddef;
122
123 def MakeBlackKing =
124 clearit;
125 pickup chess_pen;
126 filldraw HeartPath .. cycle;
127 DrawCross;
128 cullit;
129 undraw ParallelPath(subpath (.6,3.4) of HeartPath, -thin);
130 cullit;
131 filldraw OuterPath;
132 cullit;
133 undraw ShortenPath(Bow[1],1.5thin);
134 undraw ShortenPath(Bow[2],1.2thin);
135 undraw ShortenPath(Bow[3],1.2thin);
136 undraw ShortenBegin(ParallelPath(LeftPath,-thin),1.2thin);
137 undraw ShortenEnd(ParallelPath(RightPath,-thin),1.2thin);
138 BlackMan:= currentpicture;
139 enddef;
140
141 def MakeOuterShape =
142 clearit;
143 pickup frame_pen;
144 DrawCross;
145 filldraw OuterPath;
146 filldraw HeartPath .. cycle;
147 cullit;
148 OuterShape:= currentpicture;
149 enddef;
150
151 DefinePointsAndBows;
152 DefineKingPaths;
153
154 MakeWhiteKing;
155 MakeBlackKing;
156 MakeNeutral(WhiteMan, BlackMan);
157 MakeOuterShape;
158
159
160 %ScreenGrid(0,qs,x6r)(0,qs,y6r);
161
162 %===========================================================
163
164 beginchar(King+White+OnWhite, qs#, qs#, 0);
165 "White king on white field";
166 currentpicture:= WhiteMan;
167 %labels(z0,z1l,z1,z1r,z2l,z2,z2r);
168 %labels(z3l,z3,z3l,z4,z5,z6l,z6r);
169 %labels(z7l,z7,z7r,z8);
170 endchar;
171
172 beginchar(King+White+OnWhite+LeftTurned, qs#, qs#, 0);
173 "White king turned to the left on white field";
174 currentpicture:= TurnLeft(WhiteMan);
175 endchar;
176
177 beginchar(King+White+OnWhite+RightTurned, qs#, qs#, 0);
178 "White king turned to the right on white field";
179 currentpicture:= TurnRight(WhiteMan);
180 endchar;
181
182 beginchar(King+White+OnWhite+UpSideDown, qs#, qs#, 0);
183 "White king turned upsidedown on white field";
184 currentpicture:= TurnUpSideDown(WhiteMan);
185 endchar;
186
187 %===========================================================
188
189 beginchar(King+White+OnBlack, qs#, qs#, 0);
190 "White king on black field";
191 MakeBlackField;
192 cullit;
193 currentpicture:= currentpicture - OuterShape;
194 cullit;
195 currentpicture:= currentpicture + WhiteMan;
196 endchar;
197
198 beginchar(King+White+OnBlack+LeftTurned, qs#, qs#, 0);
199 "White king turned to the left on black field";
200 MakeBlackField;
201 cullit;
202 currentpicture:= currentpicture - TurnLeft(OuterShape);
203 cullit;
204 currentpicture:= currentpicture + TurnLeft(WhiteMan);
205 endchar;
206
207 beginchar(King+White+OnBlack+RightTurned, qs#, qs#, 0);
208 "White king turned to the right on black field";
209 MakeBlackField;
210 currentpicture:= currentpicture - TurnRight(OuterShape);
211 cullit;
212 currentpicture:= currentpicture + TurnRight(WhiteMan);
213 endchar;
214
215 beginchar(King+White+OnBlack+UpSideDown, qs#, qs#, 0);
216 "White king turned upsidedown on black field";
217 MakeBlackField;
218 cullit;
219 currentpicture:= currentpicture - TurnUpSideDown(OuterShape);
220 cullit;
221 currentpicture:= currentpicture + TurnUpSideDown(WhiteMan);
222 endchar;
223
224 %===========================================================
225
226 beginchar(King+Neutral+OnWhite, qs#, qs#, 0);
227 "Neutral king on white field";
228 currentpicture:= NeutralMan;
229 endchar;
230
231 beginchar(King+Neutral+OnWhite+LeftTurned, qs#, qs#, 0);
232 "Neutral king turned to the left on white field";
233 currentpicture:= TurnLeft(NeutralMan);
234 endchar;
235
236 beginchar(King+Neutral+OnWhite+RightTurned, qs#, qs#, 0);
237 "Neutral king turned to the right on white field";
238 currentpicture:= TurnRight(NeutralMan);
239 endchar;
240
241 beginchar(King+Neutral+OnWhite+UpSideDown, qs#, qs#, 0);
242 "Neutral king turned upsidedown on white field";
243 currentpicture:= TurnUpSideDown(NeutralMan);
244 endchar;
245
246 %===========================================================
247
248 beginchar(King+Neutral+OnBlack, qs#, qs#, 0);
249 "Neutral king on black field";
250 MakeBlackField;
251 cullit;
252 currentpicture:= currentpicture - OuterShape;
253 cullit;
254 currentpicture:= currentpicture + NeutralMan;
255 endchar;
256
257 beginchar(King+Neutral+OnBlack+LeftTurned, qs#, qs#, 0);
258 "Neutral king turned to the left on black field";
259 MakeBlackField;
260 cullit;
261 currentpicture:= currentpicture - TurnLeft(OuterShape);
262 cullit;
263 currentpicture:= currentpicture + TurnLeft(NeutralMan);
264 endchar;
265
266 beginchar(King+Neutral+OnBlack+RightTurned, qs#, qs#, 0);
267 "Neutral king turned to the right on black field";
268 MakeBlackField;
269 currentpicture:= currentpicture - TurnRight(OuterShape);
270 cullit;
271 currentpicture:= currentpicture + TurnRight(NeutralMan);
272 endchar;
273
274 beginchar(King+Neutral+OnBlack+UpSideDown, qs#, qs#, 0);
275 "Neutral king turned upsidedown on black field";
276 MakeBlackField;
277 cullit;
278 currentpicture:= currentpicture - TurnUpSideDown(OuterShape);
279 cullit;
280 currentpicture:= currentpicture + TurnUpSideDown(NeutralMan);
281 endchar;
282
283 %===========================================================
284
285 beginchar(King+Black+OnWhite, qs#, qs#, 0);
286 "Black king on white field";
287 currentpicture:= BlackMan;
288 endchar;
289
290 beginchar(King+Black+OnWhite+LeftTurned, qs#, qs#, 0);
291 "Black king turned to the left on white field";
292 currentpicture:= TurnLeft(BlackMan);
293 endchar;
294
295 beginchar(King+Black+OnWhite+RightTurned, qs#, qs#, 0);
296 "Black king turned to the right on white field";
297 currentpicture:= TurnRight(BlackMan);
298 endchar;
299
300 beginchar(King+Black+OnWhite+UpSideDown, qs#, qs#, 0);
301 "Black king turned upsidedown on white field";
302 currentpicture:= TurnUpSideDown(BlackMan);
303 endchar;
304
305 %===========================================================
306
307 beginchar(King+Black+OnBlack, qs#, qs#, 0);
308 "Black king on black field";
309 MakeBlackField;
310 cullit;
311 currentpicture:= currentpicture - OuterShape;
312 cullit;
313 currentpicture:= currentpicture + BlackMan;
314 endchar;
315
316 beginchar(King+Black+OnBlack+LeftTurned, qs#, qs#, 0);
317 "Black king turned to the left on black field";
318 MakeBlackField;
319 cullit;
320 currentpicture:= currentpicture - TurnLeft(OuterShape);
321 cullit;
322 currentpicture:= currentpicture + TurnLeft(BlackMan);
323 endchar;
324
325 beginchar(King+Black+OnBlack+RightTurned, qs#, qs#, 0);
326 "Black king turned to the right on black field";
327 MakeBlackField;
328 currentpicture:= currentpicture - TurnRight(OuterShape);
329 cullit;
330 currentpicture:= currentpicture + TurnRight(BlackMan);
331 endchar;
332
333 beginchar(King+Black+OnBlack+UpSideDown, qs#, qs#, 0);
334 "Black king turned upsidedown on black field";
335 MakeBlackField;
336 cullit;
337 currentpicture:= currentpicture - TurnUpSideDown(OuterShape);
338 cullit;
339 currentpicture:= currentpicture + TurnUpSideDown(BlackMan);
340 endchar;
341
342