summaryrefslogtreecommitdiff
path: root/fonts/bartel-chess-fonts/other-sources/pkfootbows.mf
blob: b23cad095ab1331158381eedbdff1e0118db30a8 (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
% This is
%		pkfootbows.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.
%
def DefineFootBows(
	% This macro depends on the values of qs and BottomSpace
	% and uses the makro ParallelPath.
	expr  BottomDist, %This is the space to BottomSpace
	     BowOneWidth, %This is the width of the main bow
	      FootHeight, %Distance from bottom of Bow0 to top of Bow3
	       BowTwoLoc, %Relative location of Bow2 between Bow3 and
	       		  % Bow1. 0 means position at position at Bow1,
			  % 1.0 means position at Bow3.
	   WidthToHeight, %Ratio of BowOneWidth/2 to Bowheight
	       BowTwoLen, %Length of Bow2 relative to Bow1
	     BowThreeLen  %Lenght of Bow3 relative to Bow1
	     ) =

	% All parameters are in pixels when not otherwise statet.
	% Points are numbered from 0 to 3 from lower to upper
	% Points to the left have suffix l, right suffix r
	% points without further suffix are in the center of the bows

	path    Bow[];
	numeric BowHeight;
	numeric l[],x[]l,x[]r,x[],y[]l,y[]r,y[];

	BowHeight = BowOneWidth*WidthToHeight/2;

	% We start with the first bow
	x1r + x1l = qs; x1r - x1l = BowOneWidth;
	y1 = BottomSpace + 2*BowHeight + BottomDist;
	x1 = .5qs;
	y1l = y1r = y1 - BowHeight;
	Bow1 = z1l .. {right} z1 .. z1r;

	z0 = z1 shifted (down*2*BowHeight);
	Bow0 = z1r .. {left} z0 .. z1l;

	Bow3= ParallelPath(Bow1,FootHeight-2*BowHeight);
	l3 = length(Bow3);
	cu:= (1-BowThreeLen)/2;
	Bow3:= subpath (cu*l3,(1-cu)*l3) of Bow3;
	z3l = point  0 of Bow3;
	z3  = point .5*length(Bow3) of Bow3;
	z3r = point infinity of Bow3;

	if proofing >0:
		show point 0 of reverse Bow3;
		show z3r;
	fi;

	Bow2= ParallelPath(Bow1,(FootHeight-2*BowHeight)*BowTwoLoc);
	l2 = length(Bow2);
	cu:= (1-BowTwoLen)/2;
	Bow2:= subpath (cu*l2,(1-cu)*l2) of Bow2;
	z2l = point  0 of Bow2;
	z2  = point .5length(Bow3) of Bow2;
	z2r = point  infinity of Bow2;
	labels(1l,1,1r,2l,2r,3l,3r);
enddef;

%DefineFootBows( .55qs,	% BowOneWidth
%		.25qs,	% FootHeight	
%		.40,	% BowTwoLoc
%		.13,	% WidthToHeight
%		.90,	% BowTwoLen
%		.95);	% BowThreeLen