summaryrefslogtreecommitdiff
path: root/fonts/malvern/source/magrlc.mf
blob: 1cbf8b19c025b4eb62ec58b2c8415f18661266d8 (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
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
% magrlc.mf 1.2.0 1994/10/11 -- lowercase greek letters
% Copyright 1994 P. Damian Cugley

%%% @METAFONT-file {
%%%   filename       = "magrlc.mf",
%%%   version        = "1.2.0",
%%%   date           = "1994/10/11",
%%%   package        = "Malvern 1.2",
%%%   author         = "P. Damian Cugley",
%%%   email          = "damian.cugley@comlab.ox.ac.uk",
%%%   address        = "Oxford University Computing Laboratory,
%%%                     Parks Road, Oxford  OX1 3QD, UK",
%%%   codetable      = "USASCII",
%%%   keywords       = "Malvern, METAFONT, font, typefont, TeX",
%%%   supported      = "Maybe",
%%%   abstract       = "Lower case Greek character programs for the Malvern
%%%                     font family.",
%%%   dependencies   = "other program files",
%%% }

%  See the Malvern Handbook (maman.tex) for more info about Malvern.
%  This software is available freely but without warranty.
%  See the file COPYING for details.

%{{{ magrlc.mf
%{{{  macros to start characters

def grlc_char(suffix $$) =
    iff known code.gr.lc$$:  "Greek lower case " & str $$;
    ma_char(code.gr.lc$$)
enddef;

def grlc_variant(suffix $$) =
    iff known code.gr.lc$$1:  "variant Greek lower case " & str $$;
    ma_char(code.gr.lc$$1)
enddef;

%  standalone marks:
def gr_mk(suffix $$) =
    iff known code.gr$$: str $$ & " mark for Greek letters";
    ma_char(code.gr$$)(8u#, body_ht#, 0pt#)(0,0);
enddef;

%}}}  start characters
%{{{  ad hoc parameters

numeric gr_mk_bot; gr_mk_bot = vround (x_ht + v);
numeric gr_low_mk_bot; gr_low_mk_bot = vround (x_ht + 1/2v);
numeric gr_mk_top; gr_mk_top = vround (body_ht);

%}}}  ad hoc parameters
%{{{  add marks

def gr_maybe_many_marks(suffix $)(expr anchorx) =
    gr_maybe_many_marks_(code.gr.lc.$, anchorx)
enddef;

def gr_maybe_many_marks_(suffix $$)(expr anchorx) =
    remember;
    similarly($$.len);
	"Greek lc " & str $$ & " len mark";
    	charht := body_ht#;
	gr_breathing.len(anchorx - 1.5u, gr_mk_top, 
    	    anchorx + u, gr_mk_bot) true;
    wug;
    similarly($$.asp);
	"Greek lc " & str $$ & " asp mark";
    	charht := body_ht#;
	gr_breathing.asp(anchorx - 1u, gr_mk_top, 
    	    anchorx + 1.5u, gr_mk_bot) false;
    wug;
    similarly($$.di);
	"Greek lc " & str $$ & " di mark";
    	charht := body_ht#;
	gr_draw_twodots.di(2u + dot_wd, gr_mk_bot);
    wug;
    similarly($$.acute);
	"Greek lc " & str $$ & " acute mark";
    	charht := body_ht#;
	1/2[x1acute, x2acute] = anchorx; gr_draw_ag.acute true; 
    wug;
    similarly($$.di.acute);
	"Greek lc " & str $$ & " di.acute mark";
    	charht := body_ht#;
	x2di.acute.a = anchorx; gr_draw_ag.di.acute.a true; 
    	gr_draw_twodots.di.acute.d(5u, gr_mk_bot);
    wug;
    similarly($$.len.acute);
	"Greek lc " & str $$ & " len.acute mark";
    	charht := body_ht#;
	gr_breathing.len.acute.b(anchorx - 2.75u, gr_mk_top, 
    	    anchorx - 1/4u, gr_mk_bot) true;
	lft x2len.acute.a = anchorx + 1/4u; gr_draw_ag.len.acute.a true;
    wug;
    similarly($$.asp.acute);
	"Greek lc " & str $$ & " asp.acute mark";
    	charht := body_ht#;
	gr_breathing.asp.acute.b(anchorx - 2.5u, gr_mk_top, 
    	    anchorx, gr_mk_bot) false;
	lft x2asp.acute.a = anchorx; gr_draw_ag.asp.acute.a true;
    wug;
    similarly($$.grave);
	"Greek lc " & str $$ & " grave mark";
    	charht := body_ht#;
	1/2[x1grave, x2grave] = anchorx; gr_draw_ag.grave false; 
    wug;
    similarly($$.di.grave);
	"Greek lc " & str $$ & " di.grave mark";
    	charht := body_ht#;
	x2di.grave.a = anchorx; gr_draw_ag.di.grave.a false; 
    	gr_draw_twodots.di.grave.d(5u, gr_mk_bot);
    wug;
    similarly($$.len.grave);
	"Greek lc " & str $$ & " len.grave mark";
    	charht := body_ht#;
	gr_breathing.len.grave.b(anchorx - 3.5u, gr_mk_top, 
    	    anchorx - u, gr_mk_bot) true;
	lft x2len.grave.a = anchorx; gr_draw_ag.len.grave.a false;
    wug;
    similarly($$.asp.grave);
	"Greek lc " & str $$ & " asp.grave mark";
    	charht := body_ht#;
	gr_breathing.asp.grave.b(anchorx - 4u, gr_mk_top, 
    	    anchorx - 1.5u, gr_mk_bot) false;
	lft x2asp.grave.a = anchorx; gr_draw_ag.asp.grave.a false;
    wug;
    similarly($$.circumflex);
	"Greek lc " & str $$ & " circumflex mark";
    	charht := body_ht#;
	gr_circ.circumflex(anchorx - 2u, gr_mk_bot, anchorx + 2u, gr_mk_top - v);
    wug;
    similarly($$.di.circumflex);
	"Greek lc " & str $$ & " di.circumflex mark";
    	charht := body_ht#;
	gr_circ.di.circumflex.a(anchorx - 2u, gr_mk_bot + 1v, anchorx + 2u, gr_mk_top);
	gr_draw_twodots.di.circumflex.d(u + dot_wd, gr_low_mk_bot);
    wug;
    similarly($$.len.circumflex);
	"Greek lc " & str $$ & " len.circumflex mark";
    	charht := body_ht#;
	gr_circ.len.circumflex.a(anchorx - 2u, gr_mk_bot + 1.25v, 
    	    anchorx + 2u, gr_mk_top);
	gr_breathing.len.circumflex.b(anchorx - 1u, gr_mk_top - 1.25v, 
    	    anchorx + 1u, gr_low_mk_bot) true;
    wug;
    similarly($$.asp.circumflex);
	"Greek lc " & str $$ & " asp.circumflex mark";
    	charht := body_ht#;
	gr_circ.asp.circumflex.a(anchorx - 2u, gr_mk_bot + 1.25v, 
    	    anchorx + 2u, gr_mk_top);
	gr_breathing.asp.circumflex.b(anchorx - 1u, gr_mk_top - 1.25v, 
    	    anchorx + 1u, gr_low_mk_bot) false;
    wug;
    similarly($$.tilde);
	"Greek lc " & str $$ & " tilde mark";
    	charht := body_ht#;
	gr_tilde.tilde(anchorx - 2.5u, gr_mk_bot, anchorx + 2.5u, gr_mk_top - v);
    wug;
    similarly($$.di.tilde);
	"Greek lc " & str $$ & " di.tilde mark";
    	charht := body_ht#;
	gr_tilde.di.tilde.a(anchorx - 2.5u, gr_mk_bot + 1.25v, 
    	    anchorx + 2.5u, gr_mk_top);
	gr_draw_twodots.di.tilde.d(u + dot_wd, gr_low_mk_bot);
    wug;
    similarly($$.len.tilde);
	"Greek lc " & str $$ & " len.tilde mark";
    	charht := body_ht#;
	gr_tilde.len.tilde.a(anchorx - 2.5u, gr_mk_bot + 1.5v, 
    	    anchorx + 2.5u, gr_mk_top);
	gr_breathing.len.tilde.b(anchorx - 2u, gr_mk_top - 1.25v, 
    	    	anchorx + 0u, gr_low_mk_bot) true;
    wug;
    similarly($$.asp.tilde);
	"Greek lc " & str $$ & " asp.tilde mark";
    	charht := body_ht#;
	gr_tilde.asp.tilde.a(anchorx - 2.5u, gr_mk_bot + 1.5v, 
    	    anchorx + 2.5u, gr_mk_top);
	gr_breathing.asp.tilde.b(anchorx - 1.5u, gr_mk_top - 1.25v, 
    	    anchorx + 0.5u, gr_low_mk_bot) false;
    wug;
    similarly($$.accent);
	"Greek lc " & str $$ & " accent mark";
    	charht := body_ht#;
	x1accent = x2accent = good.x anchorx;
	top y1accent = gr_mk_top; bot y2accent = gr_mk_bot;
	draw z1accent -- z2accent;
	labels(1accent, 2accent);
    wug;
    similarly($$.di.accent);
	"Greek lc " & str $$ & " with diaeresis accent mark";
    	charht := body_ht#;
	draw z1accent -- z2accent;
    	gr_draw_twodots.di.accent.d(5u, gr_mk_bot);

    wug
enddef;

%}}} magrlc.mf

if testing: endinput fi
%{{{  standalone marks

co_only := true;
iff known code.gr.acute:
ma_char(" ", 8u#, body_ht#, 0pt#)(0,0);
gr_maybe_many_marks_(code.gr, 1/2w);
endchar;
co_only := false;

iff known code.gr.iota_sub:
ma_char(code.gr.iota_sub, 8u#, 0pt#, desc_dp#)(0,0);
    gr_iota_sub(0.4w);
endchar;

%}}}  standalone marks
%{{{  mu

grlc_char(mu)(n_wd#, x_ht#, desc_dp#)(1,1);
    draw_n_arch(r,l); 
    draw (x1, y2) -- (x1, y4); H_stem.l; set_ic_tr;
endchar;

%}}}  mu
%{{{  phi

grlc_char(phi)(8u#, asc_ht#, desc_dp#)(o_sp, o_sp);
    force_symmetry;
    x0m = x1m = x3m = x4m = 1/2[l,r]; top y0m = h + o; bot y4m = -d - o;
    x1l = x3l = lft x0m; x1r = x3r = rt x0m;	  % where loops join
    top y1l = top y1m = top y1r = x_ht; 
    bot y3l = bot y3m = bot y3r = 0;
    lft x2l = l; rt x2r = r;
    y2l = y2r = 1/2[y1l, y3l];
    forsuffixes $ = l, r:
    	for i = 1, 3:
    	    x[i]$2 = (1/sqrt2)[x[i]m, x2$];
    	    y[i]$2 = (1/sqrt2)[y2$, y[i]$];
    	endfor
    endfor
    draw z0m -- z4m;
    draw z1l .. z1l2{z2l - z1m} .. z2l .. z3l2{z3m - z2l} .. z3l 
    	--- z3r .. z3r2{z2r - z3m} .. z2r .. z1r2{z1m - z2r} .. z1r --- cycle;
    labels(0m, 1m, 3m, 4m, 1l, 2l, 3l, 1r, 2r, 3r, 1l2, 3l2, 1r2, 3r2);
endchar;

grlc_variant(phi)(8.5u#, x_ht#, desc_dp#)(o_sp, o_sp);
    lft x2 = l; bot y3 = 0 - o; rt x4 = r; top y5 = h + o; bot y7 = -d - o;
    x6 = x7 = 0.5[x2, x4];   x3 = 1/2[x2, x4];
    y1 = y5;  x1 = 0.4[x2, x6]; x5 = 0.4[x6, x4];
    y2 = y6 = y4 = 0.5[y3, y5];
    draw z1 .. z2{down} .. z3{right} .. z4{up} .. z5{left} ... z6 --- z7;
    labels(range 1 thru 7);
endchar;

%}}}  phi
%{{{  psi

grlc_char(psi)(8u#, asc_ht#, desc_dp#)(o_sp, o_sp);
    force_symmetry;
    x1 = x2 = 1/2[l,r]; top y1 = h + o; bot y2 = -d - o;
    x3l = lft x1; x3r = rt x1;	  
    top y1l = top y1r = x_ht; bot y3l = bot y3r = 0;
    lft x1l = lft x2l = l - eps; rt x1r = rt x2r = r + eps;
    y2l = y2r = 1/2[y1l, y3l];
    draw z1 -- z2;
    draw z1l --- z2l ... z3l --- z3r ... z2r --- z1r;
    labels(1, 2, 1l, 2l, 3l, 1r, 2r, 3r);
endchar;
%}}}  psi
%{{{  lambda

grlc_char(lambda)(7u#, asc_ht#, 0pt#)(1/2,1/2);
    bot lft z2l = (l, 0 - o);  bot rt z2r = (r, 0 - o);
    z1l = z1r = (1/2[l,r], x_ht);		  % join straddles x-height
    top lft z0r = (l + u, h + o);
    draw z1l -- z2l;  draw z0r ... z1r --- z2r;
    labels(1l, 2l, 0r, 1r, 2r);
endchar;
%}}}  lambda
%{{{  theta

grlc_char(theta)(7.5u#, asc_ht#, 0pt#)(2/3,2/3);
    top z1 = (1/2w, h + o);  bot z3 = (1/2w, -d - o);
    lft z4 = (l, 1/2[-d, h]); rt z2 = (r, 1/2[-d, h]);
    draw z4 -- z2{down} .. z3 .. z4 .. z1 .. z2{down};
    labels(1, 2, 3, 4);
endchar;
%}}}  theta
%{{{  zeta

grlc_char(zeta)(7u#, asc_ht#, desc_dp#)(1/2,1/2);
    %  curly top:
    top y1t = top y3t = h + o;
    lft x1t = hround (0.2[l,r]); rt x3t = hround (0.95[l,r]);
    x2t = 1/2[x1t, x3t]; y2t = y1t - 1/2v;
    path p; p = z1t .. z2t .. z3t; draw p;
    z1 = point 1.75 of p;			  % stem joins top loop
    lft x2 = l; y2 = 0.2h;			  % left tangent of stem
    bot y3 = bot y4 = 0;			  % tangent at baseline
    x3 = 1/3[l,r]; x4 = 2/3[l,r];
    rt x5 = r; y5 = 1/2[y4, y6];		  % tangent at right
    bot y6 = -d - o; x6 = x4;
    draw z1 .. tension 1.4 .. z2{down} .. z3 --- z4 ... z5{down} .. z6;
    labels(1t, 2t, 3t, 1, 2, 3, 4, 5, 6);
endchar;
%}}}  zeta
%{{{  beta

grlc_char(beta)(7.5u#, asc_ht#, desc_dp#)(1, 2/3);
    lft x1 = lft x2 = l; bot y1 = -d - o;
    top y3 = h + o; rt x6 = r; bot y7 = 0 - o;

    y2 = y4 = 1/2[y5, y3];  x3 = 1/2[x2, x4];  y6 = 1/2[y7, y5];

    y5 = 0.6[y7, y3];
    x4 = x6 - 1.25u; y8 = y7 + 1/2v;
    lft x8 = rt x1;  x5 = x3 = x7;

    draw z1 --- z2 .. z3 .. z4{down} .. z5 
    	& z5 .. z6{down} .. z7{left} .. z8;
    labels(1, 2, 3, 4, 5, 6, 7, 8);
endchar;
%}}}  beta
%{{{  gamma

grlc_char(gamma)(8u#, x_ht#, desc_dp#)(1/3, 1/3);
    if  good.x(1/2w) <> 1/2w: change_width; fi
    top lft z1 = (l, h + o); top rt z3 = (r, h + o);
    bot z2 = (1/2[l, r], -d - o);
    z.j = (x2, 0.6[y2, y1]);
    draw z1 ... z.j{(z.j - z1) yscaled 2}; 
    draw z.j{(z3 - z.j) yscaled 2} ... z3;  
    draw z.j -- z2;
    set_ic_tr;
endchar;
%}}}  gamma
%{{{  delta

grlc_char(delta)(8u#, asc_ht#, 0pt#)(o_sp, o_sp);
    lft x2 = l; rt x4 = r; bot y3 = -d - o; top y6 = h + o;
    y1 = x_ht;
    y2 = y4 = 1/2[y3, y1];
    x1 = x3 = 1/2[x2, x4];
    x5 = good.x (0.15[x2, x4]);  y5 = y6 - v;  x6 = x5 + u;
    x7 = good.x (0.85[x2, x4]); y7 = good.y (0.5[y1, y6]);
    draw z1{left} .. z2{down} .. z3 .. z4{up} .. z1
    	.. z5 .. {right}z6 ... z7{(z7 - z6) yscaled 1.5};
endchar;
%}}}  delta
%{{{  epsilon

%  This is the 2-stroke epsilon:
grlc_variant(epsilon)(6u#, x_ht#, 0pt#)(o_sp, 2/3);
    top rt z1 = (r, h + o); bot rt z3 = (r, -d - o);
    lft z2 = (l, good.y (0.5[y3, y1]));
    x4 = 0.85[x2, x1]; y4 = y2;
    draw z1{left} .. z2 .. {right}z3; draw z2 -- z4;
    set_ic_tr; labels(1, 2, 3, 4);
endchar;

%  One-stroke epsilon:
grlc_char(epsilon)(6u#, x_ht#, 0pt#)(o_sp, 2/3);
    top y2 = h + o; bot y6 = -d - o;
    lft x3 = lft x5 = l; rt x1 = rt x7 = r;
    y5 = 1/2[y4, y6]; y3 = 1/2[y2, y4];

    y4 = y4a = good.y (0.55[y6, y2]);  x4 = 0.75[x3, x2];  x4a = 0.6[x3, x1];
    x2 = x6 = 0.6[x5, x7];
    y1 = 0.15[y2, y4]; y7 = 0.15[y6, y4];

    draw z1 .. z2{left} .. z3{down} .. z4 --- z4a;
    draw z7 .. z6{left} .. z5{up} .. z4 --- z4a;
    labels(1, 2, 3, 4, 5, 6, 7); set_ic_tr;
gr_maybe_many_marks(epsilon, 0.55[l,r]);
endchar;


%}}}  epsilon
%{{{  iota

grlc_char(iota)(pn.wd#, x_ht#, 0pt#)(1,1);
    top z1 = (1/2w, h + o);
    bot z2 = (1/2w, -d - o);
    draw z1 -- z2; set_ic_tr; labels(1,2);
gr_maybe_many_marks(iota, x1);
endchar;

%}}}  iota
%{{{  xi

grlc_char(xi)(7u#, asc_ht#, desc_dp#)(1, 1/2);
    top y1 = h + o; lft x4 = l; rt x7 = r;
    bot y5 = bot y6 = 0;
    bot y8 = -d - o;
    y7 = 0.45[y6, y8]; y4 = 1/2[y3, y5]; y2 = 0.45[y3, y1];
    x2 = good.x (x4 + 0.5u); 
    x3 = x5 = 0.5[x4, x7];  x6 = 0.6[x4, x7];  x8 = 0.7[x4, x7];
    y3 = 0.55[y5, y1];  x1 = good.x (x7 - u);  y3a = y3; x3a = 0.4[x3, x1];
    draw z1{left} .. z2{down} .. z3 --- z3a &
    	z3a --- z3 .. z4{down} .. z5 --- z6 .. z7{down} .. z8;
    labels(1, 2, 3, 3a, 4, 5, 6, 7, 8); set_ic_tr;
endchar;
%}}}  xi
%{{{  kappa

%  This is the one-stroke kappa:
grlc_char(kappa)(8u#, x_ht#, 0pt#)(1/2,1/2);
    top lft z1 = (l, h + o); top rt z4 = (r, h + o);
    bot lft z3 = (l, -o); bot rt z6 = (r, -o);
    y2 = h - y5 = 1/2h;  x2 = w - x5 = x1 + u;
    draw z1 .. z2 .. z3; draw  z4 .. z5 .. z6;
    draw z3 + o * up -- z4 + o * down;
    labels(1, 2, 3, 4, 5, 6); set_ic_tr;
endchar;
%}}}  kappa
%{{{  nu

grlc_char(nu)(7u#, x_ht#, 0pt#)(1/2,1/2);
    top lft z1 = (l, h + o); top rt z3 = (r, h + o);
    bot y2 = -d - o; x2 = 0.45[x1, x3];
    draw z1{(z2 - z1) xscaled 2} .. z2 & z2 .. z3{up};
    set_ic_tr; labels(1,2,3);
endchar;
%}}}  nu
%{{{  pi

%  Three-stroke version:
grlc_char(pi)(8u#, x_ht#, 0pt#)(1,1);
    top lft z1 = (l, h + o); top rt z2 = (r, h + o);
    lft x1l = hround (l + 1.5u); x2l = 0.25[x1l, x1];
    rt x1r = hround (r - 1.5u);  rt x3r = r;  x2r = 0.15[x1r, x3r];
    y1l = y1r = y1;
    bot y2l = bot y3r = -o;  y2r = y3r + pn.ht;
    draw z1 -- z2; draw z1r{down} ... z2r .. z3r{right}; 
    draw z1l{down} .. z2l;
    labels(1, 2, 1l, 2l, 1r, 2r, 3r); set_ic_tr;
endchar;

%}}}  pi
%{{{  koppa

% This is an obselete letter:
grlc_char(koppa)(7u#, x_ht#, desc_dp#)(o_sp, o_sp);
    draw_circle(l, h, r, vround v);
    bot z4 = (x3, -d - o);
    draw z3 -- z4;
    labels(4); set_ic(0.75h#);
endchar;
%}}}  koppa
%{{{  rho

grlc_char(rho)(8u#, x_ht#, desc_dp#)(1/2, o_sp);
    lft x1 = lft x2 = lft x6 = l;
    top y3 = h + o; rt x4 = r; bot y5 = -o; bot y1 = -d - o;
    y2 = y4 = 1/2[y3, y5]; x3 = x5 = 1/2[x2, x4];
    y6 = y5 + 1.5v;
    draw z1 --- z2 .. z3 .. z4 .. z5{left} .. z6;
    labels(1, 2, 3, 4, 5, 6); set_ic_o;
gr_maybe_many_marks(rho, x3);
endchar;

%}}}  rho
%{{{  sigma

grlc_char(final_sigma)(7u#, x_ht#, desc_dp#)(1/2,1/2);
    rt x1 = rt x5 = r; top y2 = h + o; lft x3 = l; 
    bot y4 = 0; bot y6 = -d - o;
    x2 = x4 = 0.55[x3, x1]; y3 = 1/2[y2, y4]; y5 = 1/2[y4, y6];
    y1 = good.y (y2 - 0.5v); x6 = good.x (0.7[x3, x1]);
    draw z1 .. z2{left} .. z3{down} .. z4 .. z5{down} .. z6{left};
    labels(1, 2, 3, 4, 5, 6); set_ic_tr;
endchar;

%  Medial looped sigma
grlc_char(sigma)(8.5u#, x_ht#, 0pt#)(o_sp, 1/2);
    top y5 = top y6 = h; bot y3 = -d - o;
    lft x4 = l; rt x6 = r;
    y2 = y4 = 1/2[y3, y5]; x3 = x5 = 1/2[x2, x4];  
    rt x2 = hround (l + 8u); 
    x1 = 0.5[x5, x6];  y1 = bot y5;
    draw z1 .. z2{down} .. z3{left} .. z4{up} .. z5 --- z6;
    labels(1,2,3,4,5,6); set_ic_tr;
endchar;

%  lunate sigma:
grlc_variant(sigma)(4.5u# + pn.wd#, x_ht#, 0pt#)(1/2,1/3);
    draw_C(l, h, r, -d) 0; set_ic_tr; 
endchar;

%}}}  sigma
%{{{  tau

grlc_char(tau)(7u# + pn.wd#, x_ht#, 0pt#)(1/2,1/2);
    top lft z1 = (l, h); top rt z2 = (r, h); y3 = y1;
    bot y5 = 0 - o; 
    x3 = 1/2[x1, x2];				  % stem joins with bar
    x4 = good.x (0.45[x1, x2]);			  % start of curl
    y4 = 0.24[y5, y3];				  %   at bot of stem
    x5 = 0.5[x4, x6];				  % bot tangent of curl
    x6 = 0.8[x1, x2];				  % end of curl
    y6 = y5 + 0.25v;
    draw z1 -- z2; draw z3 ... z4{down} .. z5{right} .. z6;
    labels(1, 2, 3, 4, 5, 6); set_ic_tr;    
endchar;
%}}}  tau
%{{{  upsilon

grlc_char(upsilon)(6u# + 2pn.wd#, x_ht#, 0pt#)(2/3, 2/3);
    lft x1 = lft x2 = l; bot y3 = -d - o; rt x4 = r;
    top y1 = top y5 = h + o;
    y2 = 0.45[y3, y1]; y4 = 0.6[y3, y5]; x3 = 0.5[x2, x4];
    x5 = x4 - 0.5u;
    draw z1 --- z2 .. z3{right} .. z4{up} .. z5;
    labels(1, 2, 3, 4, 5); set_ic(0.9h#);
gr_maybe_many_marks(upsilon, x3);
endchar;

%}}}  upsilon
%{{{  digamma

grlc_char(digamma)(5u# + pn.wd#, x_ht#, desc_dp#)(1,1/3);
    top y1 = top y2 = h; bot y3 = -d - o;
    lft x2 = lft x1b = lft x3 = l; rt x1 = r;
    y1b = y2b = good.y (0.575[y3, y2]);  x2b = good.x (0.75[x2, x1]);
    draw z1 -- z2 -- z3; draw z1b -- z2b;
    labels(1, 2, 3, 1b, 2b); set_ic_tr;
endchar;

%}}}  digamma
%{{{  chi

grlc_char(chi)(7.5u#, x_ht#, desc_dp#)(1/2,1/2);
    top y1 = top y3 = h + o; bot y2 = bot y4 = -d - o;
    lft x4 = l; rt x2 = r;
    x1 = good.x (x4 + 0.25u); x3 = good.x (x2 - 0.25u);
    z5 = (z1 -- z2) intersectionpoint (z3 -- z4);
    draw z1{(z2 - z1) xscaled 2} .. z5 .. z2{(z2 - z1) xscaled 2};
    draw z3 -- z4;
    labels(1, 2, 3, 4, 5); set_ic(0.9h#);
endchar;
%}}}  chi
%{{{  alpha

def draw_alpha = 
    top rt z1 = (r, h + o); bot rt z5 = (r, 0 - o);
    lft z3 = (l, 1/2[0, h]); y4 = y1; y2 = y5;
    y.j = 1/2[y1, y5];  
    x2 = x4 = 0.35[l, r];  x.j = 0.75[x2, x5];
    draw z1 .. z.j .. z2{left} .. z3{up} 
    	.. z4{right} .. z.j .. z5;
    labels(1, 2, 3, 4, 5, j);  set_ic_tr
enddef;

grlc_char(alpha)(9u#, x_ht#, 0pt#)(o_sp, 1/2);
    draw_alpha;
gr_maybe_many_marks(alpha, 0.2[x4, x1]);
endchar;

grlc_char(alpha.iota_sub)(9u#, x_ht#, desc_dp#)(o_sp, 1/2);
    draw_alpha;
    gr_iota_sub.i(0.35[x3, x1]);    
gr_maybe_many_marks(alpha.iota_sub, 0.2[x4, x1]);
endchar;

%}}}  alpha
%{{{  eta

def draw_eta =
    draw_n_arch(l,r); 
    draw (x1, y2) -- (x1, y4); 
    x.tail = x4; bot y.tail = -d - o;
    draw z.tail .. z4{up};
    set_ic_tr;
enddef;

grlc_char(eta)(n_wd#, x_ht#, desc_dp#)(1,1);
    draw_eta;
gr_maybe_many_marks(eta, x2);
endchar;

grlc_char(eta.iota_sub)(n_wd#, x_ht#, desc_dp#)(1,1);
    draw_eta;
    gr_iota_sub.i(0.35[x1, x3]);    
gr_maybe_many_marks(eta.iota_sub, x2);
endchar;

%}}}  eta
%{{{  omega
% This omega is symmetrical:

def draw_omega =
    if 1/2w <> good.x (1/2w): change_width; fi
    top y1 = top y7 = h + o; lft x2 = l; bot y3 = bot y5 = 0 - o; rt x6 = r;
    x4 = x4a = 1/2[x2, x6];  x3 = 1/2[x2, x4]; x5 = 1/2[x4, x6];

    y2 = y6 = 0.5[y3, y1]; y4 = 0.3[y3, y1];  y4a = good.y (0.6[y3, y1]);
    x1 = w - x7 = 0.2[x2, x4];
    draw z1 .. z2{down} .. z3{right} .. z4 -- z4a;
    draw z7 .. z6{down} .. z5{left} .. z4;
enddef;

grlc_char(omega)(3pn.wd# + 8.5u#, x_ht#, 0pt#)(2/3, 2/3);
    draw_omega;
gr_maybe_many_marks(omega, 1/2w);
endchar;

grlc_char(omega.iota_sub)(3pn.wd# + 8.5u#, x_ht#, desc_dp#)(2/3, 2/3);
    draw_omega;
    gr_iota_sub.i(x4);    
gr_maybe_many_marks(omega.iota_sub, 1/2w);
endchar;

%}}}  omega
%{{{  omicron

iff known code.gr.lc.omicron: "l.c. omicron";
ma_char(code.gr.lc.omicron, 8u#, x_ht#, 0v#)(o_sp, o_sp);
    draw_circle(l - ho, h + oo, r + ho, -d - oo); 
    set_ic_o;
gr_maybe_many_marks(omicron, 1/2w);
endchar;

%}}}  omicron

if false:
%{{{  marks for Greek letters
%{{{  no accent

gr_mk(len);
    gr_breathing(1/2w - 1.5u, h, 1/2w + u, gr_mk_bot) true;
endchar;

gr_mk(asp);
    gr_breathing(1/2w - 1u, h, 1/2w + 1.5u, gr_mk_bot) false;
endchar;

gr_mk(di);
    gr_draw_twodots.d(2u + dot_wd, gr_mk_bot);
endchar;
%}}}  no accent
%{{{  acute
    
gr_mk(acute);
    1/2[x1, x2] = 1/2w; gr_draw_ag true; 
endchar;

gr_mk(di.acute)
    x2 = 1/2w; gr_draw_ag true; gr_draw_twodots.d(5u, gr_mk_bot);
endchar;

gr_mk(len.acute);
    gr_breathing.b(1/2w - 2.75u, h, 1/2w - 1/4u, gr_mk_bot) true;
    lft x2 = 1/2w + 1/4u; gr_draw_ag true;
endchar;

gr_mk(asp.acute);
    gr_breathing.b(1/2w - 2.5u, h, 1/2w, gr_mk_bot) false;
    lft x2 = 1/2w; gr_draw_ag true;
endchar;
%}}}  acute
%{{{  grave

gr_mk(grave)
    1/2[x1, x2] = 1/2w; gr_draw_ag false; 
endchar;

gr_mk(di.grave)
    x2 = 1/2w; gr_draw_ag false; gr_draw_twodots.d(5u, gr_mk_bot);
endchar;

gr_mk(len.grave);
    gr_breathing.b(1/2w - 3.5u, h, 1/2w - u, gr_mk_bot) true;
    lft x2 = 1/2w; gr_draw_ag false;
endchar;

gr_mk(asp.grave);
    gr_breathing.b(1/2w - 4u, h, 1/2w - 1.5u, gr_mk_bot) false;
    lft x2 = 1/2w; gr_draw_ag false;
endchar;
%}}}  grave
%{{{  circumflex

gr_mk(circumflex);
    gr_circ(1/2w - 2u, gr_mk_bot, 1/2w + 2u, h - v);
endchar;

gr_mk(di.circumflex);
    gr_circ.a(1/2w - 2u, gr_mk_bot + 1v, 1/2w + 2u, h);
    gr_draw_twodots.d(u + dot_wd, gr_low_mk_bot);
endchar;

gr_mk(len.circumflex);
    gr_circ.a(1/2w - 2u, gr_mk_bot + 1.25v, 1/2w + 2u, h);
    gr_breathing.b(1/2w - 1u, h - 1.25v, 1/2w + 1u, gr_low_mk_bot) false;
endchar;

gr_mk(asp.circumflex);
    gr_circ.a(1/2w - 2u, gr_mk_bot + 1.25v, 1/2w + 2u, h);
    gr_breathing.b(1/2w - 1u, h - 1.25v, 1/2w + 1u, gr_low_mk_bot) true;
endchar;
%}}}  circumflex
%{{{  tilde

gr_mk(tilde);
    gr_tilde(1/2w - 2.5u, gr_mk_bot, 1/2w + 2.5u, h - v);
endchar;

gr_mk(di.tilde);
    gr_tilde.a(1/2w - 2.5u, gr_mk_bot + 1.25v, 1/2w + 2.5u, h);
    gr_draw_twodots.d(u + dot_wd, gr_low_mk_bot);
endchar;

gr_mk(len.tilde);
    gr_tilde.a(1/2w - 2.5u, gr_mk_bot + 1.5v, 1/2w + 2.5u, h);
    gr_breathing.b(1/2w - 2u, h - 1.25v, 1/2w + 0u, gr_low_mk_bot) false;
endchar;

gr_mk(asp.tilde);
    gr_tilde.a(1/2w - 2.5u, gr_mk_bot + 1.5v, 1/2w + 2.5u, h);
    gr_breathing.b(1/2w - 1.5u, h - 1.25v, 1/2w + 0.5u, gr_low_mk_bot) true;
endchar;
%}}}  tilde
%{{{  iota subscript

iff known code.gr.iota_sub:
ma_char(code.gr.iota_sub, 8u#, 0pt#, desc_dp#)(0,0);
    gr_iota_sub(0.4w);
endchar;
%}}}  iota subscript
%{{{  the new universal accent

gr_mk(accent);
    x1 = x2 = 1/2w;
    top y1 = h; bot y2 = gr_mk_bot;
    draw z1 -- z2;
    labels(1, 2);
endchar;
%}}}  the new universal accent
%}}} magrlc.mf
fi

if known code.gr.lc.alpha:
%{{{  ligtable

def startligtable(suffix $$$) =
    ligtable code.$$$:
    if string ligs.$$$:
    	scantokens ligs.$$$
    else:
	code.null kern 0pt#
    fi
enddef;

string ligs.gr.acute; 
ligs.gr.acute = "code.gr.acute =: code.apostrophe"
    & ", code.cwm =:| code.apostrophe";

startligtable(gr.lc.sigma)
    forsuffixes $$ = cwm, comma, full_stop, gr.colon, gr.question, exclam:
    	, code$$ =:| code.gr.lc.final_sigma
    endfor
    ;
show boundarychar;

forsuffixes $ = di, len, asp:
    startligtable(gr.$)
	forsuffixes # = alpha, alpha.iota_sub, epsilon, eta, eta.iota_sub, 
    	    	iota, omicron, upsilon, omega, omega.iota_sub, rho:
	    if known code.gr.lc.#.$:
		, code.gr.lc.# =: code.gr.lc.#.$
	    fi
	endfor
	forsuffixes @ = acute, grave, circumflex, tilde, accent:
	    if known code.gr.$.@: 
		, code.gr.@ =: code.gr.$.@
	    fi
	endfor
    ;
    forsuffixes @ = acute, grave, circumflex, tilde, accent:
    	if known code.gr.$.@: 
   	    startligtable(gr.$.@)
    	    	forsuffixes # = alpha, alpha.iota_sub, epsilon, 
    	    	    	    eta, eta.iota_sub, iota, omicron, upsilon, 
    	    	    	    omega, omega.iota_sub, rho:
		    if known code.gr.lc.#.$.@:
			, code.gr.lc.# =: code.gr.lc.#.$.@
		    fi
    	    	endfor
    	    ;
    	fi
    endfor
endfor

forsuffixes @ = acute, grave, circumflex, tilde, accent:
    if known code.gr.@: 
	startligtable(gr.@)
	    forsuffixes # = alpha, alpha.iota_sub, epsilon, eta, eta.iota_sub, 
			iota, omicron, upsilon, omega, omega.iota_sub, rho:
		if known code.gr.lc.#.@:
		    , code.gr.lc.# =: code.gr.lc.#.@
		fi
	    endfor
	forsuffixes $ = di, asp, len:
	    if known code.gr.$.@: 
		, code.gr.$ =: code.gr.$.@
	    fi
	endfor
	;
    fi
endfor

forsuffixes # = alpha, eta, omega:
    forsuffixes $ = , len, asp:
    	forsuffixes @ = , accent, acute, grave, circumflex:
    	    if known code.gr.lc.#.iota_sub.$.@:
    	    	startligtable(gr.lc.#.$.@)
    	    	    , code.gr.iota_sub =: code.gr.lc.#.iota_sub.$.@
    	    	;
    	    fi
    	endfor
    endfor
endfor

if known code.en_dash:
    ligtable code.hyphen: code.hyphen =: code.en_dash;
    if known code.em_dash:
    	ligtable code.en_dash: code.hyphen =: code.em_dash;
    fi
fi
  
if known code.guillemet.left:
    ligtable code.paren.left: code.paren.left =: code.guillemet.left;
    ligtable code.paren.right: code.paren.right =: code.guillemet.right;
fi  


%}}}  ligtable
fi

%}}} magrlc.mf

%Local variables:
%fold-folded-p: t
%End: