summaryrefslogtreecommitdiff
path: root/fonts/bartel-chess-fonts/pkgeo.mf
blob: f9b7229c68bd890bcfb152a05db46796cf6450ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
% This is
%		pkgeo.mf
%
% Copyright (C) 1989-92  by Elmar Bartel.
%
% This program is free software; you can redistribute it and/or modify
% it under the terms of the GNU General Public License as published by
% the Free Software Foundation; either version 1, or (at your option)
% any later version.
%
% This program is distributed in the hope that it will be useful,
% but WITHOUT ANY WARRANTY; without even the implied warranty of
% MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
% GNU General Public License for more details.
%
% You should have received a copy of the GNU General Public License
% along with this program; if not, write to the Free Software
% Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
%
%
%we have to define six essential characters:
%         WoW   NoW   BoW   WoB   NoB   BoB
%Pawn       0     6    12    18    24    30
%Knight     1     7    13    19    25    31
%Bishop     2     8    14    20    26    32
%Rook       3     9    15    21    27    33
%Queen      4    10    16    22    28    34
%King       5    11    17    23    29    35

% All these cases are repeated three more times:
% Left turned, Right turned and upside down
%------------------------------------------
% From this result the first free positions
% usable for simple geometric signs.

def MakeCirclePath =
	path CirclePath;
	CirclePath = fullcircle scaled .75qs shifted Center;
enddef;

def MakeWhiteCircle =
	pickup chess_pen;
	clearit;
	draw CirclePath;
	cullit;
	WhiteMan:= currentpicture;
enddef;

def MakeBlackCircle =
	pickup chess_pen;
	clearit;
	filldraw CirclePath;
	cullit;
	BlackMan:= currentpicture;
enddef;

def MakeOuterShape = 
	pickup frame_pen;
	clearit;
	filldraw CirclePath;
	cullit;
	OuterShape:= currentpicture;
enddef;


MakeCirclePath;
MakeWhiteCircle;
MakeBlackCircle;
MakeNeutral(WhiteMan, BlackMan);
MakeOuterShape ;

beginchar(Circle+White+OnWhite, qs#, qs#, 0);
	"White circle on white field";
	currentpicture:= WhiteMan;
endchar;

beginchar(Circle+Black+OnWhite, qs#, qs#, 0);
	"Black circle on white field";
	currentpicture:= BlackMan;
endchar;

beginchar(Circle+Neutral+OnWhite, qs#, qs#, 0);
	"Neutral circle on white field";
	currentpicture:= NeutralMan;
endchar;

beginchar(Circle+White+OnBlack, qs#, qs#, 0);
	"White circle on black field";
	MakeBlackField;
	currentpicture:= currentpicture - OuterShape;
	cullit;
	currentpicture:= currentpicture + WhiteMan;
endchar;

beginchar(Circle+Neutral+OnBlack, qs#, qs#, 0);
	"Neutral circle on black field";
	MakeBlackField;
	currentpicture:= currentpicture - OuterShape;
	cullit;
	currentpicture:= currentpicture + NeutralMan;
endchar;

beginchar(Circle+Black+OnBlack, qs#, qs#, 0);
	"Black circle on black field";
	MakeBlackField;
	currentpicture:= currentpicture - OuterShape;
	cullit;
	currentpicture:= currentpicture + BlackMan;
endchar;