summaryrefslogtreecommitdiff
path: root/fonts/greek/lfb/MF/serifs.mf
blob: 398deae65a3b05eb661465686e0ee9c66ced226e (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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324

  %% serifs.mf
  %% Copyright 2005 Laurie Field
  %
  % This work is LFB, version 1.0.
  %
  % This work may be distributed and/or modified under the
  % conditions of the LaTeX Project Public License, either version 1.3
  % of this license or (at your option) any later version.
  % The latest version of this license is in
  %   http://www.latex-project.org/lppl.txt
  % and version 1.3 or later is part of all distributions of LaTeX
  % version 2003/12/01 or later.
  %
  % This work has the LPPL maintenance status "maintained".
  % 
  % This Current Maintainer of this work is Laurie Field.
  %
  % This work consists of the files:
  %   
  %   example.tex
  %   lfbacc.tex
  %   
  %   accents.mf
  %   alpha.mf
  %   beta.mf
  %   capitals.mf
  %   charmap.mf
  %   delta.mf
  %   epsilon.mf
  %   eta.mf
  %   gamma.mf
  %   iota.mf
  %   kappa.mf
  %   khi.mf
  %   lambda.mf
  %   lfb.mf
  %   lfb5.mf
  %   lfb6.mf
  %   lfb7.mf
  %   lfb8.mf
  %   lfb9.mf
  %   lfb10.mf
  %   lfb11.mf
  %   lfb12.mf
  %   lfbb5.mf
  %   lfbb6.mf
  %   lfbb7.mf
  %   lfbb8.mf
  %   lfbb9.mf
  %   lfbb10.mf
  %   lfbb11.mf
  %   lfbb12.mf
  %   ligature.mf
  %   mu.mf
  %   nu.mf
  %   omega.mf
  %   omikron.mf
  %   others.mf
  %   phi.mf
  %   pi.mf
  %   psi.mf
  %   rho.mf
  %   serifs.mf
  %   sigma.mf
  %   sigmafin.mf
  %   tau.mf
  %   theta.mf
  %   upsilon.mf
  %   xi.mf
  %   zeta.mf
  %   
  % and the derived files:
  %   
  %   lfb5.tfm
  %   lfb6.tfm
  %   lfb7.tfm
  %   lfb8.tfm
  %   lfb9.tfm
  %   lfb10.tfm
  %   lfb11.tfm
  %   lfb12.tfm
  %   lfbb5.tfm
  %   lfbb6.tfm
  %   lfbb7.tfm
  %   lfbb8.tfm
  %   lfbb9.tfm
  %   lfbb10.tfm
  %   lfbb11.tfm
  %   lfbb12.tfm
  %   
  %   lfb5.600pk
  %   lfb6.600pk
  %   lfb7.600pk
  %   lfb8.600pk
  %   lfb9.600pk
  %   lfb10.600pk
  %   lfb11.600pk
  %   lfb12.600pk
  %   lfbb5.600pk
  %   lfbb6.600pk
  %   lfbb7.600pk
  %   lfbb8.600pk
  %   lfbb9.600pk
  %   lfbb10.600pk
  %   lfbb11.600pk
  %   lfbb12.600pk
  %

def stem
	(suffix stop, sbot, stoplft, stoprt, stopdish, sbotlft, sbotrt, sbotdish)
	(expr thetop, thebot, toptilt, bottilt, breadth, slabwidth, jut)
=	numeric stemangle;
	stemangle=angle(thetop-thebot);
	numeric endinset;
	endinset=3/4jut;
	penpos stop(breadth, stemangle-90);
	penpos sbot(breadth, stemangle-90);
	penpos stoplft(slabwidth, stemangle+toptilt);
	penpos stoprt(slabwidth, stemangle+toptilt);
	penpos sbotlft(slabwidth, stemangle+bottilt);
	penpos sbotrt(slabwidth, stemangle+bottilt);
	z[stoplft].r=thetop+(1/2breadth+jut)*dir(stemangle+toptilt+90);
	z[stoprt].r=thetop+(1/2breadth+jut)*dir(stemangle+toptilt-90);
	z[stopdish]=thetop+dishdepth*dir(stemangle+toptilt+180);
	z[sbotlft].l=thebot+(1/2breadth+jut)*dir(stemangle+bottilt+90);
	z[sbotrt].l=thebot+(1/2breadth+jut)*dir(stemangle+bottilt-90);
	z[sbotdish]=thebot+dishdepth*dir(stemangle+bottilt);
	z[stop]=thetop+whatever*dir(stemangle+180);
	if toptilt>0:
		z[stop].l=thetop+whatever*dir(stemangle+toptilt+90)
			+endinset*dir(stemangle+toptilt+180);
	else:
		z[stop].r=thetop+whatever*dir(stemangle+toptilt-90)
			+endinset*dir(stemangle+toptilt+180);
	fi;
	z[sbot]=thebot+whatever*dir(stemangle);
	if bottilt>0:
		z[sbot].r=thebot+whatever*dir(stemangle+bottilt-90)
			+endinset*dir(stemangle+bottilt);
	else:
		z[sbot].l=thebot+whatever*dir(stemangle+bottilt+90)
			+endinset*dir(stemangle+bottilt);
	fi;
	fill z[stop].l---z[sbot].l..{dir(stemangle+bottilt+90)}z[sbotlft].r
		--z[sbotlft].l..z[sbotdish]..z[sbotrt].l--z[sbotrt].r
		{dir(stemangle+bottilt+90)}..z[sbot].r---z[stop].r
		..{dir(stemangle+toptilt-90)}z[stoprt].l--z[stoprt].r
		..z[stopdish]..z[stoplft].r--z[stoplft].l{dir(stemangle+toptilt-90)}
		..cycle;
	fill z[stoplft].r--z[stoprt].r
		--z[stoprt].l+((0,0) rotated(stemangle+toptilt-90))
		--z[stoplft].l+((0,0) rotated(stemangle+toptilt-90))--cycle;
	fill z[sbotlft].l--z[sbotrt].l
		--z[sbotrt].r+((0,0) rotated(stemangle+bottilt-90))
		--z[sbotlft].r+((0,0) rotated(stemangle+bottilt-90))--cycle;
enddef;


def singlestem % bottom only has serif
	(suffix stop, sbot, sbotlft, sbotrt, sbotdish)
	(expr thetop, thebot, bottilt, breadth, slabwidth, jut)
=	numeric stemangle;
	stemangle=angle(thetop-thebot);
	numeric endinset;
	endinset=3/4jut;
	penpos stop(breadth, stemangle-90);
	penpos sbot(breadth, stemangle-90);
	penpos sbotlft(slabwidth, stemangle+bottilt);
	penpos sbotrt(slabwidth, stemangle+bottilt);
	z[stop]=thetop;
	z[sbotlft].l=thebot+(1/2breadth+jut)*dir(stemangle+bottilt+90);
	z[sbotrt].l=thebot+(1/2breadth+jut)*dir(stemangle+bottilt-90);
	z[sbotdish]=thebot+dishdepth*dir(stemangle+bottilt);
	z[sbot]=thebot+whatever*dir(stemangle);
	if bottilt>0:
		z[sbot].r=thebot+whatever*dir(stemangle+bottilt-90)
			+endinset*dir(stemangle+bottilt);
	else:
		z[sbot].l=thebot+whatever*dir(stemangle+bottilt+90)
			+endinset*dir(stemangle+bottilt);
	fi;
	fill z[stop].l---z[sbot].l..{dir(stemangle+bottilt+90)}z[sbotlft].r
		--z[sbotlft].l..z[sbotdish]..z[sbotrt].l--z[sbotrt].r
		{dir(stemangle+bottilt+90)}..z[sbot].r---z[stop].r--cycle;
	fill z[sbotlft].l--z[sbotrt].l
		--z[sbotrt].r+((0,0) rotated(stemangle+bottilt-90))
		--z[sbotlft].r+((0,0) rotated(stemangle+bottilt-90))--cycle;
enddef;


def oneandlefthalfstem
	(suffix stop, sbot, stoplft, stoprt, stopdish, sbotlft, sbotrt, sbotdish)
	(expr thetop, thebot, toptilt, bottilt, breadth, slabwidth, jut)
=	numeric stemangle;
	stemangle=angle(thetop-thebot);
	numeric endinset;
	endinset=3/4jut;
	penpos stop(breadth, stemangle-90);
	penpos sbot(breadth, stemangle-90);
	penpos stoplft(slabwidth, stemangle+toptilt);
	penpos stoprt(slabwidth, stemangle);
	penpos sbotlft(slabwidth, stemangle+bottilt);
	penpos sbotrt(slabwidth, stemangle+bottilt);
	z[stoplft].r=thetop+(1/2breadth+jut)*dir(stemangle+toptilt+90);
	z[stoprt].r=thetop+(1/2breadth)*dir(stemangle+toptilt-90);
	z[stopdish]=thetop+dishdepth*dir(stemangle+toptilt+180);
	z[sbotlft].l=thebot+(1/2breadth+jut)*dir(stemangle+bottilt+90);
	z[sbotrt].l=thebot+(1/2breadth+jut)*dir(stemangle+bottilt-90);
	z[sbotdish]=thebot+dishdepth*dir(stemangle+bottilt);
	z[stop]=thetop+whatever*dir(stemangle+180);
	if toptilt>0:
		z[stop].l=thetop+whatever*dir(stemangle+toptilt+90)
			+endinset*dir(stemangle+toptilt+180);
	else:
		z[stop].r=thetop+whatever*dir(stemangle+toptilt-90)
			+endinset*dir(stemangle+toptilt+180);
	fi;
	z[sbot]=thebot+whatever*dir(stemangle);
	if bottilt>0:
		z[sbot].r=thebot+whatever*dir(stemangle+bottilt-90)
			+endinset*dir(stemangle+bottilt);
	else:
		z[sbot].l=thebot+whatever*dir(stemangle+bottilt+90)
			+endinset*dir(stemangle+bottilt);
	fi;
	fill z[stop].l---z[sbot].l..{dir(stemangle+bottilt+90)}z[sbotlft].r
		--z[sbotlft].l..z[sbotdish]..z[sbotrt].l--z[sbotrt].r
		{dir(stemangle+bottilt+90)}..z[sbot].r---z[stoprt].r
		--z[stoplft].r--z[stoplft].l{dir(stemangle+toptilt-90)}
		..cycle;
	fill z[sbotlft].l--z[sbotrt].l
		--z[sbotrt].r+((0,0) rotated(stemangle+bottilt-90))
		--z[sbotlft].r+((0,0) rotated(stemangle+bottilt-90))--cycle;
enddef;


def oneandrighthalfstem
	(suffix stop, sbot, stoplft, stoprt, stopdish, sbotlft, sbotrt, sbotdish)
	(expr thetop, thebot, toptilt, bottilt, breadth, slabwidth, jut)
=	numeric stemangle;
	stemangle=angle(thetop-thebot);
	numeric endinset;
	endinset=3/4jut;
	penpos stop(breadth, stemangle-90);
	penpos sbot(breadth, stemangle-90);
	penpos stoplft(slabwidth, stemangle);
	penpos stoprt(slabwidth, stemangle+toptilt);
	penpos sbotlft(slabwidth, stemangle+bottilt);
	penpos sbotrt(slabwidth, stemangle+bottilt);
	z[stoplft].r=thetop+(1/2breadth)*dir(stemangle+toptilt+90);
	z[stoprt].r=thetop+(1/2breadth+jut)*dir(stemangle+toptilt-90);
	z[stopdish]=thetop+dishdepth*dir(stemangle+toptilt+180);
	z[sbotlft].l=thebot+(1/2breadth+jut)*dir(stemangle+bottilt+90);
	z[sbotrt].l=thebot+(1/2breadth+jut)*dir(stemangle+bottilt-90);
	z[sbotdish]=thebot+dishdepth*dir(stemangle+bottilt);
	z[stop]=thetop+whatever*dir(stemangle+180);
	if toptilt>0:
		z[stop].l=thetop+whatever*dir(stemangle+toptilt+90)
			+endinset*dir(stemangle+toptilt+180);
	else:
		z[stop].r=thetop+whatever*dir(stemangle+toptilt-90)
			+endinset*dir(stemangle+toptilt+180);
	fi;
	z[sbot]=thebot+whatever*dir(stemangle);
	if bottilt>0:
		z[sbot].r=thebot+whatever*dir(stemangle+bottilt-90)
			+endinset*dir(stemangle+bottilt);
	else:
		z[sbot].l=thebot+whatever*dir(stemangle+bottilt+90)
			+endinset*dir(stemangle+bottilt);
	fi;
	fill z[stoplft].r---z[sbot].l..{dir(stemangle+bottilt+90)}z[sbotlft].r
		--z[sbotlft].l..z[sbotdish]..z[sbotrt].l--z[sbotrt].r
		{dir(stemangle+bottilt+90)}..z[sbot].r---z[stop].r
		..{dir(stemangle+toptilt-90)}z[stoprt].l--z[stoprt].r--cycle;
	fill z[sbotlft].l--z[sbotrt].l
		--z[sbotrt].r+((0,0) rotated(stemangle+bottilt-90))
		--z[sbotlft].r+((0,0) rotated(stemangle+bottilt-90))--cycle;
enddef;


def barrightserif
	(suffix shoulder, elbow, wrist, hand)
	(expr thestart, theend, breadth, serifwidth, jut, indent)
=	numeric thebarangle;
	thebarangle=angle(theend-thestart);
	numeric forearm;
	forearm=3/4jut;
	penpos shoulder(breadth, thebarangle+90);
	penpos elbow(breadth, thebarangle+90);
	penpos wrist(breadth, thebarangle+90);
	penpos hand(serifwidth, thebarangle);
	z[shoulder].r=thestart;
	z[elbow].r=z[wrist].r+forearm*dir(thebarangle-180);
	z[wrist].r=theend+indent*dir(thebarangle-180);
	z[hand].r=theend+(breadth+jut)*dir(thebarangle-90);
	numeric serifangle;
	serifangle=angle(z[wrist].r-z[hand].r);
	fill z[shoulder].l---z[elbow].l..{dir(serifangle-180)}z[hand].l
		--z[hand].r--z[wrist].r--z[shoulder].r--cycle;
enddef;


def barleftserif
	(suffix shoulder, elbow, wrist, hand)
	(expr thestart, theend, breadth, serifwidth, jut, indent)
=	numeric thebarangle;
	thebarangle=angle(theend-thestart);
	numeric forearm;
	forearm=3/4jut;
	penpos shoulder(breadth, thebarangle-90);
	penpos elbow(breadth, thebarangle-90);
	penpos wrist(breadth, thebarangle-90);
	penpos hand(serifwidth, thebarangle);
	z[shoulder].r=thestart;
	z[elbow].r=z[wrist].r+forearm*dir(thebarangle-180);
	z[wrist].r=theend+indent*dir(thebarangle-180);
	z[hand].r=theend+(breadth+jut)*dir(thebarangle+90);
	numeric serifangle;
	serifangle=angle(z[wrist].r-z[hand].r);
	fill z[shoulder].l---z[elbow].l..{dir(serifangle-180)}z[hand].l
		--z[hand].r--z[wrist].r--z[shoulder].r--cycle;
enddef;