Debian Codegraph @

texmf-dist/fonts/source/public/bartel-chess-fonts/elch-geo.mf

raw
1 % This is
2 % geo.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 %
21 %we have to define six essential characters:
22 % WoW NoW BoW WoB NoB BoB
23 %Pawn 0 6 12 18 24 30
24 %Knight 1 7 13 19 25 31
25 %Bishop 2 8 14 20 26 32
26 %Rook 3 9 15 21 27 33
27 %Queen 4 10 16 22 28 34
28 %King 5 11 17 23 29 35
29
30 % All these cases are repeated three more times:
31 % Left turned, Right turned and upside down
32 %------------------------------------------
33 % From this result the first free positions
34 % usable for simple geometric signs.
35
36 def MakeCirclePath =
37 path CirclePath;
38 CirclePath = fullcircle scaled .70qs shifted Center;
39 enddef;
40
41 def MakeWhiteCircle =
42 pickup chess_pen;
43 clearit;
44 draw CirclePath;
45 cullit;
46 WhiteMan:= currentpicture;
47 enddef;
48
49 def MakeBlackCircle =
50 pickup chess_pen;
51 clearit;
52 filldraw CirclePath;
53 cullit;
54 BlackMan:= currentpicture;
55 enddef;
56
57 def MakeOuterShape =
58 pickup frame_pen;
59 clearit;
60 filldraw CirclePath;
61 cullit;
62 OuterShape:= currentpicture;
63 enddef;
64
65
66 MakeCirclePath;
67 MakeWhiteCircle;
68 MakeBlackCircle;
69 MakeNeutral(WhiteMan, BlackMan);
70 MakeOuterShape;
71
72 beginchar(Circle+White+OnWhite, qs#, qs#, 0);
73 "White circle on white field";
74 currentpicture:= WhiteMan;
75 endchar;
76
77 beginchar(Circle+Black+OnWhite, qs#, qs#, 0);
78 "Black circle on white field";
79 currentpicture:= BlackMan;
80 endchar;
81
82 beginchar(Circle+Neutral+OnWhite, qs#, qs#, 0);
83 "Neutral circle on white field";
84 currentpicture:= NeutralMan;
85 endchar;
86
87 beginchar(Circle+White+OnBlack, qs#, qs#, 0);
88 "White circle on black field";
89 MakeBlackField;
90 currentpicture:= currentpicture - OuterShape;
91 cullit;
92 currentpicture:= currentpicture + WhiteMan;
93 endchar;
94
95 beginchar(Circle+Neutral+OnBlack, qs#, qs#, 0);
96 "Neutral circle on black field";
97 MakeBlackField;
98 currentpicture:= currentpicture - OuterShape;
99 cullit;
100 currentpicture:= currentpicture + NeutralMan;
101 endchar;
102
103 beginchar(Circle+Black+OnBlack, qs#, qs#, 0);
104 "Black circle on black field";
105 MakeBlackField;
106 currentpicture:= currentpicture - OuterShape;
107 cullit;
108 currentpicture:= currentpicture + BlackMan;
109 endchar;