summaryrefslogtreecommitdiff
path: root/fonts/tengwar/numerals.mf
blob: fbd4992b2ee588041044bc6b8e7307d96e7fe121 (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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
% Copyright 1988 Michael Urban
% Everyone is granted permission to copy, modify and redistribute
% this file, provided that a currently-dated copy of this
% copyright notice is included in the copy.
% License is granted to produce fonts based on the information
% in this file, provided that such fonts are redistributed
% without charge to any third party.

% SCCS ID @(#)numerals.mf	1.1   10/1/86

def firstbow(expr start,finish,looped) =
	begingroup;
	save x,y,t;
	x0 = start; top y0=xht;
	x1 = x0; bot y1=0;
	x2=finish; bot y2=0;
	if looped:
		t=1.0;
	else:
		t=1.0;
	fi;
	draw z0{down}..z1..tension t..z2;
	bowpoint:=z1;
	penlabels (0,1,2);
	endgroup;
enddef;

def secondstem(expr start, finishpoint) =
	begingroup;
	save x,y, stem;
	path stem;
	z0=(start, h);
	z1 = z0 + serifthick*left;
	z2 = z0 + serifthick*right;
	z3= (start, 0);
	x4 = 1/2[x3, (xpart finishpoint)]; y4 = -d;
	draw z1--z0;%--z2;
	stem = ( z0..z3{down}..z4..tension 1.2..finishpoint);
	draw stem;
	top y5 = xht; 
	barpoint := stem intersectionpoint
		((-infinity,y5)--(infinity, y5));
	penlabels (0,1,2,3,4);
	
	endgroup;
enddef;


def thirdstem(expr start)=
	begingroup;
	save x,y,stem;
	path stem;
	z0=(start, h);
	z1 = z0 + serifthick*left;
	z2 = z0 + serifthick*right;
	z3= (start, 0);
	x4 = .5[0,start]; y4 = -d;
	x5=0; y5 = 1/2 (-d);
	draw z1--z0;%--z2;
	stem = ( z0..z3{down}..z4..z5);
	draw stem;
	bowpoint := stem intersectionpoint
		((-infinity,bowstart)--(infinity, bowstart));
	barpoint := stem intersectionpoint
		((-infinity,0)--(infinity, 0));
	penlabels (0,1,2,3,4,5);
	endgroup;
enddef;


beginchar ("0", shortwidth, xht#, 1/2dep#); "The numeral 0";
	begingroup;
	save x,y;
	pickup elvishpen;
	lft x1=leadgap; y1=.5h;
	x2 = 1/2[x1,w]; top y2=h;
	rt x3=w; y3=0;
	x4=leadgap; y4=-d;
	draw z1..z2{right}..z3{down}..z4;
	endgroup;
endchar;

beginchar ("1", shortwidth, xht#, 0); "The numeral 1";
	begingroup;
	save x, y;
	pickup elvishpen;

	firstbow(leadgap, w-thick, true);
	top y10=h;
	barpoint:=(w,y10);
	overbar;
	endgroup;
endchar;

beginchar ("2", .75em#, xht#, 0); "The numeral 2";
	begingroup;
	save x, y;
	pickup elvishpen;

	firstbow (1/2[leadgap,w], w-thick, true);
	firstbow (leadgap, xpart bowpoint, false);
	top y10=h;
	barpoint:=(w,y10);
	overbar;
	endgroup;
endchar;

beginchar ("3", 1em#, xht#, 0); "The numeral 3";
	begingroup;
	save x, y;
	pickup elvishpen;

	firstbow (2/3[leadgap,w], w-thick, true);
	firstbow (1/3[leadgap,w], xpart bowpoint, false);
	firstbow (leadgap, xpart bowpoint, false);
	top y10=h;
	barpoint:=(w,y10);
	overbar;
	endgroup;
endchar;

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

beginchar ("4", shortwidth, 3/4[xht#,cap#], 3/4xht#); "The numeral 4";
	begingroup;
	save x, y;
	pickup elvishpen;

	rt x0 = w; y0 = -d/3;
	secondstem (leadgap, z0);
	endgroup;
endchar;

beginchar ("5", .75em#, 3/4[xht#, cap#], 3/4xht#); "The numeral 5";
	begingroup;
	save x, y;
	pickup elvishpen;

	firstbow (1/2[leadgap,w], w-thick, true);
	secondstem (leadgap, bowpoint);
	top y10=xht;
	draw barpoint--(w,y10);
	endgroup;
endchar;

beginchar ("6", 1em#, 3/4[xht#, cap#], 3/4xht#); "The numeral 6";
	begingroup;
	save x, y;
	pickup elvishpen;

	firstbow (2/3[leadgap,w], w-thick, true);
	firstbow (1/3[leadgap,w], xpart bowpoint, false);
	secondstem (leadgap, bowpoint);
	top y10=xht;
	draw barpoint--(w,y10);
	endgroup;
endchar;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

thirdwidth := 2.5*leadgap;

beginchar ("7", 3*leadgap#, 3/4[xht#, cap#], 3/4xht#); "The numeral 7";
	begingroup;
	save x, y;
	pickup elvishpen;

	thirdstem (thirdwidth);
	endgroup;
endchar;


beginchar ("8", .75em#, 3/4[xht#, cap#], 3/4xht#); "The numeral 8";
	begingroup;
	save x, y;
	pickup elvishpen;

	thirdstem (thirdwidth);
	luva (bowpoint, w, false);
	underbar;
	endgroup;
endchar;


beginchar ("9", 1em#, 3/4[xht#, cap#], 3/4xht#); "The numeral 9";
	begingroup;
	save x, y;
	pickup elvishpen;

	thirdstem (thirdwidth);
	luva (bowpoint, 1/2[thirdwidth,w], false);
	luva (bowpoint, w, false);
	underbar;
	endgroup;
endchar;