summaryrefslogtreecommitdiff
path: root/fonts/mbboard/source/mbbgrklo.mf
blob: 78a6ddc1de56f8a6fa4834a6aee23dc93476b2c1 (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
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
% blackboard typefaces by Anthony Phan.
% file: mbbgrklo.mf (Greek lowercase)
% last modification: 25.10.2001.

% One can choose to generate some characters or their variants
% or both when they exist. Characters with no variants will
% be generated anyway
% (except ``bbomicron'' which is the same as roman ``o'').

def horizontal_rules_list=
  -body_depth,-desc_depth,0.5x_height,x_height,cap_height,
  asc_height,body_height
enddef;

use_rule1;

iff variant_a:
beginchar(bbalpha,10u#+2appr#,x_height#,0);
  "Lowercase Greek alpha";
  italcorr x_height#*slant-.5u#;
  path tmppp_path; numeric t[];
  pickup circle.nib;
  lft x3=apprl-ho; rt x1=hround((8u#+2appr#)*hppp)-apprr;
  x2=x4=0.5[x3,x1]; rt x6=w-apprr+hround 0.4u; rt x5=w-apprr;
  top y2=h+uo; bot y4=-oo; top y5=h; bot y6=bot y7=0;
  y3=0.5[y4,y2]; y1=0.45[y5,y6]; y8=0.45[y6,y5];
  x1-x8=hthick; x11-x3=hThick;
  x7=min(x6-u,x8+(x1-x2)*((y8-y7)/(y2-y1)));
  tmp_path:=z1 up_to_left z2 left_to_down z3 down_to_right z4;
  tmpp_path:=z6..z7 left_to_up z8;
  tmppp_path=z4 right_to_up z5;
  bbbowl(z2,z3,z4,hThick) tmp_path;
  hbbowl(z2,z1,(x1,y8),x1-x8) tmp_path;
  hbbowl(z7,z8,(x8,y1),x1-x8) tmpp_path;
  t1=xpart(tmppp_path intersectiontimes tmpp_path);
  t2=xpart(tmppp_path intersectiontimes bowl_path);
  draw z1..z1 & tmp_path & subpath (0,t1) of tmppp_path;
  draw subpath (t2,2) of tmppp_path; draw tmpp_path;
  square_end5(up); square_end6(right);
  labels(1,2,3,4,5,6,7,8);
  math_fit(0,0);
endchar;

iff not variant_a:
beginchar(bbalpha,10u#+2appr#,x_height#,0);
  "Lowercase Greek alpha";
  italcorr x_height#*slant-.5u#;
  save tmp_path; path tmp_path[]; numeric t[];
  pickup circle.nib;
  % cross
  y10=y9'l=0; y1'=y9r=h; x10=x9r=w-apprr; x1'=x9'l=x10-5u;
  adjust_slanted_bar(1',10,10',1)(thick,1);
  adjust_slanted_bar(9'l,9r,9'r,9l)(thin,-1);
  z9'=0.5[z9'r,z9'l]; z9=0.5[z9r,z9l];
  % curves
  top y3=top y12=h+uo; bot y5=-oo; y4=0.5[y3,y5]; lft x4=apprl-ho;
  slope:=(y1'-y1)/(x1'-x1);
  hellipse_set(4,3,2,1); hellipse_set(4,12,11,10);
  slope:=(y9-y9')/(x9-x9'); hellipse_set(4,5,6,9);
  tmp_path1=z1---z2...z3{left};
  tmp_path2=z10---z11...z12{left}..z3;
  tmp_path3=z5{right}...z6---z9;
  t1=xpart(tmp_path3 intersectiontimes tmp_path1);
  t2=xpart(tmp_path3 intersectiontimes tmp_path2);
  z7=point t1 of tmp_path3; z8=point t2 of tmp_path3;
  tmp_path4=z2{z2-z1}...z3 left_to_down z4 down_to_right z5
  & subpath (0,t1) of tmp_path3;
  bbbowl(z3,z4,z5,hThick) tmp_path4;
  ortho_penpos2(thin,z1'-z1); ortho_penpos11(thin,z10'-z10);
  ortho_penpos8(thin,z9-z8);
  penpos1(diag_width(thin,z1'-z1),0);
  penpos10(diag_width(thin,z10'-z10),0);
  y1a-y1=thin; z1a-z1=z10a-z10=whatever*(z1'-z1);
  draw tmp_path4; draw subpath (1,3) of tmp_path2;
  penstroke z1e..z2e; penstroke z10e..z11e; penstroke z8e..z9e;
  fill z1a--z10a--z10--z1--cycle;
  penlabels(1,2,8,9,9',10,11);
  labels(1',1a,3,4,5,6,7,10',10a);
  math_fit(0,0);
endchar;

beginchar(bbbeta,8u#+2appr#,asc_height#,desc_depth#);
  "Lowercase Greek beta";
  italcorr 0.8asc_height#*slant-.5u#;
  pickup circle.nib;
  lft x1=lft x2=apprl; x3=x5=0.5[x1,x4]; rt x4=w-apprr; rt x6=w-apprr+ho;
  bot y1=-d; y2=0.5[y5,y4]; top y3=h+oo; y4=0.5[y5,y3]; top y5=x_height;
  y6=0.5[y7,y5]; x8=x1+hthick;
  if ab_down_factor>0: bot y7=-oo;
    x7=ab_down_factor[(x1+x6)/2,(x1+x3+2x6)/4];
    y8=ab_down_factor[top 0,y5];
  else: bot y7=bot y8=0; x7=0.5[x1,x6]; fi
  tmp_path:=z1..z2 up_to_right z3 right_to_down z4 down_to_left z5
  & z5 right_to_down z6 down_to_left z7
  if ab_down_factor>0: left_to_up z8 else: ..z8 fi;
  draw tmp_path;
  bbbowl(z5,z6,z7,hThick) tmp_path;
  bbbowl(z3,z4,z5,max(0,x4-x.bowl.mid)) tmp_path;
  hbbowl(z3,z2,z1,hthick) tmp_path;
  pickup square.nib draw z1..z.bowl.bot;
  square_end5(left);
  labels(1,2,3,4,5,6,7,8);
  math_fit(0,0);
endchar;

beginchar(bbgamma,8u#+2appr#,x_height#,desc_depth#);
  "Lowercase Greek gamma";
  italcorr x_height#*slant-0.5u#;
  pickup circle.nib;
  y1=y12r=h; y2'=y12'l=bot y7=-d-oo;
  x1=x12'l=apprl; x2'=x12r=w-apprr;
  adjust_slanted_bar(1,2',2,1')(thick,1);
  adjust_slanted_bar(12'l,12r,12'r,12l)(thin,-1);
  z12=0.5[z12r,z12l]; z12'=0.5[z12'r,z12'l];
  a:=diag_width(thin,z1-z1');
  penpos1(a,0); penpos2(a,0);
  y1-y1a=thin; z1-z1a=z2-z2a=whatever*(z1-z1');
  forsuffixes $=,r,l:
    z11$=whatever[z2,z2']; z11$=whatever[z12$,z12'$];
  endfor
  z10=whatever[z1,z1']; z10=whatever[z12,z12'];
  x7=0.5[apprl,w-apprr];
  lft x8=apprl+hround 1.95u; x6-x5=0.5[thin,thick];
  0.5[x5,x6]-x7=x7-x8;
  slope:=(y1'-y1)/(x1'-x1);
  ellipse_set(7,5,3,1); ellipse_set(7,6,4,2);
  slope:=(y12'r-y12r)/(x12'r-x12r); ellipse_set(7,8,9,12);
  ortho_penpos3(thin,z1-z3); ortho_penpos4(thin,z2-z4);
  draw z4{z4-z2}...z6 down_to_left z7 left_to_up z8...z9--z10;
  draw z3{z3-z1}...z5 down_to_left z7;
  penstroke z1e..z3e; penstroke z2e..z4e;
  penstroke z11e..z12e; fill z1--z2--z2a--z1a--cycle;
  penlabels(1,2,3,4,14,12,12'); labels(1',1a,2',2a,5,6,7,8,9,10);
  math_fit(0,0);
endchar;

%beginchar(bbgamma,8u#+2appr#,x_height#,desc_depth#);
%  "Lowercase Greek gamma";
%  italcorr x_height#*slant-0.5u#;
%  pickup circle.nib;
%  y1=y14r=h; y4=y15l=-0.3d;
%  x1=apprl; x14r=w-apprr;
%  rt x4=rt x6=w-apprr+ho-hround u;
%  x15l=lft x10=apprl+hround u;
%  x8=0.5[x6,x10-hthick/2]; bot y8=-d-oo; x6-x17=hthick;
%  adjust_slanted_bar(1,4,2,3)(thick,1);
%  adjust_slanted_bar(14r,15l,14l,15r)(thin,-1);
%  z13r=whatever[z14r,z15r]; z13l=whatever[z14l,z15l];
%  z13r=whatever[z2,z4]; z13l=whatever[z2,z4];
%  z12=whatever[z1,z3]; z12=whatever[0.5[z14l,z14r],0.5[z15l,z15r]];
%  y1-y1a=thin; z1a=whatever[z1,z3]; z2-z2a=z1-z1a;
%  slope:=(y3-y1)/(x3-x1); ellipse_set(8,6,5,2); ellipse_set(8,17,16,1);
%  slope:=(y15r-y14r)/(x15r-x14r); ellipse_set(8,10,11,12);
%  penpos1(diag_width(thin,z1-z3),0);
%  penpos2(diag_width(thin,z1-z3),0);
%  ortho_penpos5(thin,z2-z5); ortho_penpos16(thin,z1-z16);
%  z7=z6 downleft z8; z9=z8 leftup z10; z18=z17 downleft z8;
%  penstroke z1e..z16e; penstroke z2e..z5e; penstroke z13e..z14e;
%  fill z1--z2--z2a--z1a--cycle;
%  draw z5{z5-z2}...z6{down}...z7{z8-z6}...z8{left}...z9{z10-z8}
%  ...z10{up}...z11---z12;
%  draw z16{z16-z1}...z17{down}...z18{z8-z17}...z8{left};
%  penlabels(1,2,5,,13,14,15,16);
%  labels(1a,2a,3,4,6,7,8,9,10,11,12,17,18);
%  math_fit(0,0);
%endchar;

beginchar(bbdelta,8u#+2appr#,asc_height#,0);
  "Lowercase Greek delta";
  italcorr asc_height#*slant-2u#;
  pickup circle.nib;
  top y1=h; y2=y0=y1; bot y10=-oo; y8=y12; y13=y7;
  bot y6=x_height;
  x6-x0=6u;
  rt x1=w-apprr-hround 1.5u; lft x4=apprl+hround u; x2=0.3[x4,x1];
  x6=x10=0.5[x12,x8]; rt x8=w-apprr+ho; lft x12=apprl-ho;
  slope:=(y0-y6)/(x0-x6); ellipse_set(2,4,5,6); ellipse_set(10,8,7,6);
  x15-x12=x8-x17=hThick; x7-x6=x6-x13;
  tmp_path:=z1..z2 left_to_down z4...z5---z6---z7...z8
  down_to_left z10 left_to_up z12...z13...z6;
  z15=tmp_path intersectionpoint ((x15,y10)..(x15,y12));
  z16=tmp_path intersectionpoint ((x15,y12)..(x15,y6));
  z17=tmp_path intersectionpoint ((x17,y10)..(x17,y12));
  z18=tmp_path intersectionpoint ((x17,y8)..(x17,y6));
  draw tmp_path; draw z15..z16; draw z17..z18;
  square_end1(right);
  labels(0,0a,1,2,3,4,5,6,7,8,9,10,11,12,13,14);
  math_fit(0,0);
endchar;

iff known bbepsilon:
beginchar(bbepsilon,6u#+2appr#,x_height#,0);
  "Lowercase Greek epsilon";
  italcorr x_height#*slant-.5u#;
  pickup circle.nib;
  rt x1=rt x5=w-apprr; top y1=h; x2=0.75[lft x3,rt x1]; y2=y1;
  lft x3=apprl-ho; bot y3=vround 0.5h; bot y4=bot y5=0; x4=x2;
  tmp_path:=z1..z2 left_to_down z3 down_to_right z4..z5;
  draw tmp_path; bbbowl(z2,z3,z4,hThick) tmp_path;
  z6=bowl_path intersectionpoint (z3..(w,y3));
  rt x7=hround(w-apprr-0.5u); y7=y3;
  draw z6..z7;
  square_end1(right);
  square_end5(right);
  square_end7(right);
  labels(1,2,3,4,5,6,7,8,9);
  math_fit(0,0);
endchar;

beginchar(bbzeta,8u#+2appr#,asc_height#,desc_depth#);
  "Lowercase Greek zeta";
  italcorr x_height#*slant-2u#;
  pickup circle.nib;
  top y1=h; top y2=top y3=top y4=vround(y1-0.25(h-x_height));
  bot y6=bot y7=0; bot y9=-d;
  y5=0.3[y6,y4]; y8=0.5[y9,y7];
  lft x1=apprl+hround 2u; lft x5=apprl-ho;
  rt x3=w-apprr-hround 1.5u; rt x8=w-apprr+ho;
  x2=0.7[x1,x3];
  x4=0.85[x5,x3];
  x6-x5=x8-x7=0.44(x8-x5);
  x9=good.x(0.5[x5,x8]);
  tmp_path:=z1 down_to_right z2..z3 & z3..z4 left_to_down z5
  down_to_right z6...z7right_to_down z8 down_to_left z9;
  draw tmp_path;
  bbbowl(z4,z5,z6,hThick) tmp_path;
  bbbowl(z7,z8,z9,hThick) tmp_path;
  square_end1(up);
  square_end3(right);
  square_end9(left);
  labels(1,2,3,4,5,6,7,8,9);
  math_fit(0,0);
endchar;

beginchar(bbeta,8u#+2appr#,x_height#,desc_depth#);
  "Lowercase Greek eta";
  italcorr 0.75x_height#*slant-.5u#;
  complete_n;
  math_fit(0,0);
endchar;

iff known bbtheta:
beginchar(bbtheta,8u#+2appr#,asc_height#,0);
  "Lowercase Greek theta";
  italcorr 0.6asc_height#*slant+ho#-.5u#;
  pickup circle.nib;
  bbcircle1(apprl-ho,w-apprr+ho,h+oo,-oo); draw last_path;
  bbbowl(z1b,z1a,z1d,hThick) last_path; x2=x.bowl.top;
  bbbowl(z1b,z1c,z1d,hThick) last_path; x3=x.bowl.top;
  y2=y3=good.y(0.5[y1b,y1d]); draw z2..z3; labels(2,3);
  math_fit(0,0);
endchar;

beginchar(bbiota,6u#+2appr#,x_height#,0);
  "Lower Greek iota";
% no italic correction
  pickup circle.nib;
  rt x1=w-apprr; x2=0.5[x1,x4]; lft x3=lft x4=apprl;
  bot y2=-oo; top y4=h; y1=y3=good.y(0.3[y2,y4]);
  tmp_path:=z1 down_to_left z2 left_to_up z3..z4;
  draw tmp_path;
  hbbowl(z2,z3,z4,hthick) tmp_path;
  pickup square.nib; draw z4..z.bowl.bot;
  square_end1(up); labels(1,2,3,4,5,6);
  math_fit(0,0);
endchar;

iff known bbkappa:
beginchar(bbkappa,9u#+2appr#,x_height#,0); "Lower Greek kappa";
  italcorr x_height#*slant-.5u#;
  pickup circle.nib;
  lft x1=lft x3=apprl; x2-x1=hthick; x4=x5=x2;
  bot y1=0; y2=y1; top y3=h; y4=y3;
  x6r=w-apprr; y6r=h; y5=0.4*h;
  adjust_slanted_bar(5,6r,5a,6)(0.5thin,-1);
  z6-z6l=z6r-z6; ortho_penpos5(thin,z6-z5);
  z7=(w-apprr,0); top z8b=(0.25[x3,x4],h);
  adjust_slanted_bar(8b,7,7b,8)(thick,1);
  z9=whatever[z5,z6]; z9=whatever[z7,z7b];
  z10=whatever[z5,z6]; z10=whatever[z8,z8b];
  y7a-y7=y8a-y8=thin; z7a=whatever[z7,z7b]; z8a=whatever[z8,z8b];
  penpos7(diag_width(thin,z7b-z7),0);
  penpos8(diag_width(thin,z8b-z8),0);
  ortho_penpos9(thin, z7b-z7); ortho_penpos10(thin, z8b-z8);
  pickup square.nib; draw z1--z2--z4--z3--cycle;
  penstroke z5e..z6e; penstroke z7e..z9e; penstroke z8e..z10e;
  fill z7--z8--z8a--z7a--cycle;
  labels(1,2,3,4,5a,7a,7b,8a,8b); penlabels(5,6,7,8,9,10);
  math_fit(0,0);
endchar;

beginchar(bblambda,9u#+2appr#,asc_height#,0);
  "Lowercase Greek lambda";
% no italic correction
  x1=apprl; x5=w-apprr;
  y2=y3=max(x_height,0.6h)-0.5thin; y1=y4=y5=0; y6=y7=h;
  numeric a,x,y; a=(abs(x5-x1)-2y2*slant)/(2y2); y=thick/(2y2);
  x=thick*(-a*y+sqrt(1+(a**2)-(y**2)))/(1-(y**2));
  x3-x2=x5-x4=x7-x6=x; x2-x1=x4-x2; z6=whatever[z4,z2];
  a:=diag_width(thin,z2-z4);
  penpos1(diag_width(thin,z2-z1),0);
  penpos4(a,0); penpos5(a,0); penpos6(a,0); penpos7(a,0);
  forsuffixes $=r,l:
    z2$-z1$=whatever*(z2-z1); z2$=whatever[z2,z4];
  endfor
  y6-y6a=thin; z6-z6a=z7-z7a=z4a-z4=z5a-z5=whatever*(z6-z4);
  penstroke z1e..z2e; penstroke z4e..z6e; penstroke z5e..z7e;
  fill z4--z5--z5a--z4a--cycle; fill z6--z7--z7a--z6a--cycle;
  penlabels(1,2,3,4,5,6,7); labels(4a,5a,6a,7a);
  math_fit(0,0);
endchar;

beginchar(bbmu,8u#+2appr#,x_height#,desc_depth#); "Lowercase Greek mu";
  italcorr x_height#*slant-.5u#;
  pickup circle.nib;
  bot y1=0; y2=y1; top y3=h; y4=y3=y7=y8; bot y5=bot y6=-d;
  rt x1=w-apprr; x3=x1; lft x7=lft x5=apprl;
  x1-x2=x3-x4=x8-x7=x6-x5=hthick;
  if uy_factor>0: numeric t;
    x9=x2; y9=uy_factor[y2,y4]; bot y10=-oo; x10=0.5[x7,0.5[x2,x1]];
    x11=x7; y11=0.7[y7,y10];
    tmp_path:=z9 down_to_left z10 left_to_up z11;
    t=xpart(tmp_path intersectiontimes (z8..z6));
    z14=point t of tmp_path;
    draw subpath (0,t) of tmp_path;
    labels(10,11);
  else: z9=(x6,y1); draw z2..z9; fi
  pickup square.nib; draw z1--z2--z4--z3--cycle;
  draw z5--z6--z8--z7--cycle;
  labels(0,1,2,3,4,5,6,7,8,9);
  math_fit(0,0);
endchar;

beginchar(bbnu,8u#+2appr#,x_height#,0); "Lowercase Greek nu";
  italcorr x_height#*slant+ho#-.5u#;
  pickup circle.nib;
  top y2=h; y2=y3=y6=y7; bot y4=bot y5=0;
  lft x3=lft x4=apprl; rt x6=w-apprr+ho;
  x2-x3=hthick; x6-x7=hThick; x5=rt x4;
  tmp_path:=z5 right_to_up z6;
  z8=tmp_path intersectionpoint (z7..(x7,y5));
  z1=tmp_path intersectionpoint (z2..(x2,y5));
  draw tmp_path; draw z1..z2; draw z7..z8;
  pickup square.nib; draw z2--z3--z4; draw z6..z7;
  labels(1,2,3,4,5,6,7,8);
  math_fit(0,0);
endchar;

beginchar(bbxi,8u#+2appr#,asc_height#,desc_depth#);
  "Lowercase Greek xi";
  italcorr x_height#*slant-2.5u#;
  pickup circle.nib;
  top y1=h; top y2=top y3=top y4=vround(y1-0.25(h-x_height));
  top y6=top y7=top y8=vround 0.5h; bot y10=bot y11=0; bot y13=-d;
  y5=0.5[y6,y4]; y9=0.4[y10,y8]; y12=0.5[y13,y11];
  lft x1=apprl+hround 2u; lft x5=apprl; lft x9=apprl-ho;
  rt x3=rt x7=w-apprr-hround 2u; rt x12=w-apprr+ho;
  x2=0.7[x1,x3];
  x4=0.85[x5,x3];
  x6=0.7[x5,x7];
  x8=0.8[x9,x7];
  x10-x9=x12-x11=0.44(x12-x9);
  x13=good.x 0.5[x9,x12];
  tmp_path:=z1 down_to_right z2..z3 & z3..z4 left_to_down z5
  down_to_right z6..z7 & z7..z8 left_to_down z9 down_to_right z10
  ...z11 right_to_down z12 down_to_left z13;
  draw tmp_path;
  bbbowl(z8,z9,z10,hThick) tmp_path;
  bbbowl(z4,z5,z6,max(0,x.bowl.mid-x5)) tmp_path;
  bbbowl(z11,z12,z13,hThick) tmp_path;
  square_end1(up);
  square_end3(right);
  square_end7(right);
  square_end13(left);
  labels(1,2,3,4,5,6,7,8,9,10,11,12,13);
  math_fit(0,0);
endchar;

iff known bbomicron:
beginchar(bbomicron,8u#+2appr#,x_height#,0); "Lowercase Greek omicron";
  italcorr 0.6x_height#*slant+ho#-.5u#;
  pickup circle.nib;
  bbcircle1(apprl-ho,w-apprr+ho,x_height+uo,-oo); draw last_path;
  bbbowl(z1b,z1a,z1d,hThick) last_path;
  bbbowl(z1b,z1c,z1d,hThick) last_path;
  math_fit(0,0);
endchar;

iff known bbpi:
beginchar(bbpi,9u#+2appr#,x_height#,0); "Lowercase Greek pi";
  italcorr x_height#*slant;
  pickup circle.nib; top y1=h; apprl-lft x1=rt x2-w+apprr=hround 0.5u;
  y1=y2=y3=y6=y7=y10; bot y4=0; y4=y5=y8=y9;
  lft x3-apprl=lft x4-apprl=w-apprr-rt x10=w-apprr-rt x9=hround 0.75u;
  x10-x7=x9-x8=x6-x3=x5-x4=hthick; pickup square.nib;
  draw z1..z2; draw z3--z4--z5--z6; draw z7--z8--z9--z10;
  labels(1,2,3,4,5,6,7,8,9,10);
  math_fit(0,0);
endchar;

iff known bbrho:
beginchar(bbrho,8u#+2appr#,x_height#,desc_depth#);
  "Lowercase Greek rho";
  italcorr 0.6x_height#*slant+ho#-.5u#;
  pickup circle.nib; numeric t;
  bot y1=-d; top y3=h+uo; bot y5=-oo; y2=y4=0.5[y5,y3];
  lft x2=lft x1=apprl; rt x4=w-apprr+ho; x3=x5=0.5[x2,x4];
  tmp_path:=z1..z2 up_to_right z3 right_to_down
  z4 down_to_left z5 left_to_up z2;
  bbbowl(z3,z4,z5,hThick) tmp_path;
  hbbowl(z3,z2,z1,hthick) tmp_path;
  t=5+xpart(subpath (5,infinity) of tmp_path
    intersectiontimes bowl_path);
  draw subpath (0,t) of tmp_path;
  pickup square.nib; draw z.bowl.bot..z1;
  penlabels(1,2,3,4,5);
  math_fit(0,0);
endchar;

iff known bbsigma:
beginchar(bbsigma,8u#+2appr#,x_height#,0);
  "Lowercase Greek sigma";
  italcorr x_height#*slant+.5u#;
  pickup circle.nib;
  rt x1=hround(w-apprr+u); x2=x4=0.5[x3,x5];
  lft x3=apprl-ho; rt x5=rt x6=w-apprr;
  top y1=top y2=h; y3=y5=0.5[y4,y2];
  bot y4=-oo; y6=y1;
  tmp_path:=z1..z2 left_to_down z3 down_to_right
  z4 right_to_up z5..z6;
  draw tmp_path;
  bbbowl(z2,z3,z4,hThick) tmp_path;
  hbbowl(z4,z5,z6,hthick) tmp_path;
  square_end1(right);
  labels(1,2,3,4,5,6,7,8,9,10);
  math_fit(0,0);
endchar;

beginchar(bbtau,7u#+2appr#,x_height#,0);
  "Lowercase Greek tau";
  italcorr x_height#*slant;
  pickup circle.nib; center_bar(1,2); bot y1=bot y2=0;
  apprl-lft x5=rt x6-w+apprr=hround 0.5u; top y5=top y6=h;
  z3=(x1,y5); z4=(x2,y5); pickup square.nib; draw z5..z6;
  draw z3--z1--z2--z4; labels(1,2,3,4,5,6);
  math_fit(0,0);
endchar;

beginchar(bbupsilon,8u#+2appr#,x_height#,0);
  "Lowercase Greek upsilon";
  italcorr x_height#*slant-.5u#;
  pickup circle.nib;
  rt x1=rt x2=w-apprr; lft x4=lft x5=apprl; x3=0.5[x2,x4];
  top y1=top y5=h; bot y3=-oo; y2=y4=1/3[y3,y1];
  tmp_path:=z1..z2 down_to_left z3 left_to_up z4..z5;
  draw tmp_path;
  hbbowl(z3,z4,z5,hthick) tmp_path;
  pickup square.nib; draw z5..z.bowl.bot;
  square_end1(up); labels(1,2,3,4,5);
  math_fit(0,0);
endchar;

iff known bbphi:
beginchar(bbphi,10u#+2appr#,asc_height#,desc_depth#);
  "Lowercase Greek phi";
  italcorr 0.6x_height#*slant+ho#-.5u#;
  center_stem(2,3); bot y2=-d; top y3=h;
  bbcircle1(apprl-ho,w-apprr+ho,x_height+oo,-oo); draw last_path;
  bbbowl(z1b,z1a,z1d,hThick) last_path;
  bbbowl(z1b,z1c,z1d,hThick) last_path;
  pickup square.nib; draw z2..z3;
  labels(2,3);
  math_fit(0,0);
endchar;

beginchar(bbchi,9u#+2appr#,x_height#,desc_depth#);
  "Lowercase Greek khi";
  italcorr x_height#*slant-0.5u#;
  complete_X(0.35u);
  math_fit(0,0);
endchar;

beginchar(bbpsi,10u#+2appr#,asc_height#,desc_depth#);
  "Lowercase Greek psi";
  italcorr x_height#*slant-.5u#;
  center_stem(1,2,6);
  bot y1=-d; top y2=h;
  top y4=top y8=x_height; y5=y7=0.5[y4,y6]; bot y6=-oo;
  lft x4=lft x5=apprl; rt x7=rt x8=w-apprr;
  tmp_path:=z4..z5 down_to_right z6 right_to_up z7..z8;
  draw tmp_path;
  hbbowl(z6,z5,z4,hthick) tmp_path; z3=z.bowl.bot;
  hbbowl(z6,z7,z8,hthick) tmp_path; z9=z.bowl.bot;
  pickup square.nib; draw z1..z2; draw z3..z4; draw z8..z9;
  labels(1,2,3,4,5,6,7,8,9);
  math_fit(0,0);
endchar;

beginchar(bbomega,12u#+2appr#,x_height#,0);
  "Lowercase Greek omega";
  italcorr 0.6x_height#*slant+ho#-.5u#;
  center_stem(4,5); top y1=top y8=h; y2=y7=0.42[y3,y1];
  bot y3=bot y6=-oo; y4=0.35h; top y5=vround(2h/3);
  lft x2=apprl-ho; rt x7=w-apprr+ho;
  rt x1=hround max(0.3[lft x2,rt x7],x2+hThick+1.5thin);
  x1-x2=x7-x8; x3=0.25[x2,x7]; x7-x6=x3-x2; x9-x2=x7-x11=hThick;
  z1'-z1=(z2-z1) yscaled 1/4; z8'-z8=(z7-z8) yscaled 1/4;
  tmp_path:=z1{z1'-z1}...z2 down_to_right
  z3 right_to_up z4 & z4down_to_right z6 right_to_up z7
  ...z8{z8-z8'};
  z9=tmp_path intersectionpoint ((x9,y1)..(x9,y2));
  z10=tmp_path intersectionpoint ((x9,y2)..(x9,y3));
  z11=tmp_path intersectionpoint ((x11,y1)..(x11,y2));
  z12=tmp_path intersectionpoint ((x11,y2)..(x11,y3));
  draw tmp_path; draw z4..z5; draw z9..z10; draw z11..z12;
  square_end5(up);
  square_end1(z1-z1');
  square_end8(z8-z8');
  labels(range 1 thru 12);
  math_fit(0,0);
endchar;

% Variants

iff known bbvarbeta:
beginchar(bbvarbeta,8u#+2appr#,asc_height#,0);
  "Lowercase Greek variant beta";
  italcorr 0.8asc_height#*slant-.5u#;
  pickup circle.nib;
  numeric t[];
  lft x5=lft x9=apprl-ho; rt x7=w-apprr+ho;
  lft x1=min(apprl+hround(4u/3)-eps,lft x5+hThick);
  rt x3=w-apprr-hround(u/3)+eps; x2=x4=0.5[x1,x3];
  x6=x8=0.5[x5,x7];
  top y4=h+oo; bot y6=-oo; top y8=x_height+oo;
  y2=good.y 1/3[y8,y4]; y5=0.5[y6,y4];
  y1=y3=0.5[y2,y4]; y7=y9=0.5[y6,y8];
  tmp_path:= z1 down_to_right z2 right_to_up z3
  up_to_left z4 left_to_down z5 down_to_right
  z6 right_to_up z7 up_to_left z8 left_to_down z9;
  bbbowl(z4,z5,z6,hThick) subpath (6,infinity) of tmp_path;
  t1=xpart(subpath (0,4) of tmp_path intersectiontimes bowl_path);
  t2=12+xpart(subpath (12,16) of tmp_path intersectiontimes bowl_path);
  draw subpath (t1,t2) of tmp_path;
  bbbowl(z8,z7,z6,hThick) tmp_path;
  labels(range 1 thru 15);
  math_fit(0,0);
endchar;

iff known bbvarepsilon:
beginchar(bbvarepsilon,6u#+2appr#,x_height#,0);
  "Lowercase Greek variant epsilon";
  italcorr x_height#*slant-.5u#;
  pickup circle.nib;
  top y2=h+uo; bot y8=-oo; bot y4=vround 0.5h; y4=y5=y6;
  y1=0.76[y4,y2]; y9=0.76[y5,y8];
  y3=0.5[y4,y2]; y7=0.5[y6,y8];
  rt x1=rt x9=w-apprr; rt x5=w-apprr-hround 1.5u;
  lft x3=lft x7=apprl-ho; x4=x2; x6=x8; x10-x3=hThick;
  tmp_path:=reverse elliptic_arc(3,2,1) & z3 down_to_right z4..z5;
  tmpp_path:=reverse elliptic_arc(7,8,9) & z7 up_to_right z6..z5;
  bbbowl(z6,z7,z8,hThick) tmpp_path;
  bbbowl(z2,z3,z4,max(0,x.bowl.mid-x3)) tmp_path;
  draw tmp_path; draw tmpp_path;
  square_end1(z1-z1');
  square_end5(right);
  square_end9(z9-z9');
  labels(1,1',2,3,4,5,6,7,8,9,9');
  math_fit(0,0);
endchar;

iff known bbvartheta:
beginchar(bbvartheta,8u#+2appr#,asc_height#,0);
  "Lowercase Greek variant theta";
  italcorr 0.7asc_height#*slant+ho#-.5u#;
  pickup circle.nib; numeric t;
  top y6=h+oo; bot y4=-oo; rt x5=w-apprr+ho; lft x3=apprl-ho;
  y3=y2=y5=y9=good.y 0.5[y4,y6]; x4=x6=0.5[x3,x5];
  x2-x3=hThick; x7=good.x 0[x2,x3]; y7=0.35[y6,y9];
  rt x9=w-apprr+hround u; z8=z5;
  tmp_path:=z3 down_to_right z4 right_to_up z5
  up_to_left z6 left_to_down z7 down_to_right z8;
  hbbowl(z4,z3,z3,x2-x3) tmp_path;
  bbbowl(z6,z5,z4,hThick) tmp_path;
  t=8+xpart(subpath (8,10) of tmp_path intersectiontimes bowl_path);
  draw subpath (0,t) of tmp_path;
  y2r=y3r=top y2; y3l=y2l=bot y2; y3a=y2a=y2;
  x3r=x3a=lft x3; x2r=x2a=rt x2; x2l=x2; x3l=x3;
  draw z5..z9;
  fill z3l--z2l--z2a--z2r--z3r--z3a--cycle;
  square_end9(right);
  labels(2,3,4,5,6,7,8,9,2a,2l,2r,3a,3l,3r);
  math_fit(0,0);
endchar;

iff known bbvarkappa:
beginchar(bbvarkappa,9u#+2appr#,x_height#,0);
  "Lowercase Greek variant kappa";
  italcorr x_height#*slant-0.2u#;
  pickup circle.nib;
  x1r=w-apprr+0.3u; x4l=apprl-0.3u; y1r=h; y4l=-d;
  adjust_slanted_bar(1r,4l,2l,3r)(thick+thin,-1);
  a:=diag_width(thin,z1r-z3r);
  penpos1(a,0); penpos2(a,0); penpos3(a,0); penpos4(a,0);
  y1-y1a=thin; z1a=whatever[z1,z3];
  z1-z1a=z2-z2a=z3a-z3=z4a-z4;
  top y5=top y12=h; bot y8=bot y9=0; lft x5=apprl; rt x9=w-apprr;
  z8=whatever[z2,z4]; z12=whatever[z1,z3];
  rt x6-apprl=w-apprr-lft x10=hround 3u; slope:=(y1-y3)/(x1-x3);
  ellipse_set(5,6,7,8); ellipse_set(9,10,11,12);
  penstroke z1e..z3e; penstroke z2e..z4e;
  fill z1--z1a--z2a--z2--cycle; fill z3--z3a--z4a--z4--cycle;
  draw z5 right_to_down z6...z7---z8;
  draw z9 left_to_up z10...z11---z12;
  square_end5(left); square_end9(right);
  penlabels(1,2,3,4); labels(1a,2a,3a,4a,5,6,7,8,9,10,11,12);
  math_fit(0,0);
endchar;

iff known bbvarpi:
beginchar(bbvarpi,12u#+2appr#,x_height#,0);
  "Lowercase Greek variant pi";
  italcorr x_height#*slant-.5u#;
  pickup circle.nib;
  center_stem(1,4);
  top y1=h; y1=y7=y8; bot y3=bot y5=-oo;
  top y4=vround 0.6h; y2=y6=0.4[y3,y1];
  lft x2+ho=lft x7=apprl; rt x6-ho=rt x8=w-apprr;
  x3=0.45[x2,x4]; x5=0.45[x6,x4];
  tmp_path:=z1 left_to_down z2 down_to_right z3 right_to_up z4
  & z4 down_to_right z5 right_to_up z6 up_to_left z1;
  draw tmp_path;
  bbbowl(z1,z2,z3,hThick) tmp_path;
  bbbowl(z1,z6,z5,hThick) tmp_path;
  pickup square.nib; draw z7..z8; square_end4(up);
  labels(1,2,3,4,5,6,7,8,9,10,11,12);
  math_fit(0,0);
endchar;

iff known bbvarrho:
beginchar(bbvarrho,8u#+2appr#,x_height#,desc_depth#);
  "Lowercase Greek variant rho";
  italcorr 0.6x_height#*slant+ho#-.5u#;
  pickup circle.nib; numeric t;
  rt x1=w-apprr; lft x3=lft x4=apprl; rt x6=w-apprr+ho;
  x2=x5=x7=0.5[x4,x6];
  bot y1=bot y2=-d; y3=0; top y5=h+uo; bot y7=-oo;
  y4=y6=0.5[y7,y5];
  tmp_path:=z1..z2 left_to_up z3..z4 up_to_right z5
  right_to_down z6 down_to_left z7 left_to_up z4;
  hbbowl(z5,z4,z4,hthick) tmp_path;
  hbbowl(z2,z3,z4,hthick) subpath (0,5) of tmp_path;
  t=8+xpart(subpath (8,12) of tmp_path intersectiontimes bowl_path);
  draw subpath (0,t) of tmp_path;
  bbbowl(z5,z6,z7,hThick) tmp_path;
  square_end1(right);
  labels(1,2,3,4,5,6,7);
  math_fit(0,0);
endchar;

iff known bbvarsigma:
beginchar(bbvarsigma,7u#+2appr#,x_height#,desc_depth#);
  "Lowercase Greek variant sigma";
  italcorr x_height#*slant-.5u#;
  pickup circle.nib;
  top y1=h; y2=0.4[y3,y1]; bot y3=0; y4=0.5[y3,y5]; bot y5=-d;
  rt x1=w-apprr; lft x2=apprl-ho; rt x4=w-apprr+ho;
  x3=0.5[x2,x4]; x5=good.x(x3-0.5u);
  tmp_path:=z1left_to_down z2 down_to_right
  z3 right_to_down z4 down_to_left z5;
  draw tmp_path;
  bbbowl(z1,z2,z3,hThick) tmp_path;
  bbbowl(z3,z4,z5,hThick) tmp_path;
  square_end1(right); square_end5(left);
  labels(1,2,3,4,5,6,7,8,9);
  math_fit(0,0);
endchar;

%beginchar(bbvarsigma,7u#+2appr#,x_height#,comma_size#-dot_size#);
%  "Lowercase Greek variant sigma";
%  italcorr x_height#*slant-.5u#;
%  pickup circle.nib;
%  slope:=-x_height/30u;
%  top y1'=top y2=h+oo; bot y8=bot y9'=-d;
%  y5=good.y max(0.5thin,1/3[y8,y2]);
%  rt x1=w-apprr; lft x3=apprl-ho; rt x7=w-apprr+ho;
%  x2=x5=0.5[x3,x7]; x9=good.x(0.5[x3,x7]-0.5u);
%  x8=0.4[x7,x9]; x1'=0.5[x1,x2]; x9'=0.5[x9,x8];
%  x10=x3+hThick; x12=x7-hThick;
%  y1=good.y(y1'+slope*(x1-x1'));
%  y9=good.y(y9'+slope*(x9-x9'));
%  ellipse_set(2,3,4,5); ellipse_set(8,7,6,5);
%  tmp_path:=z1{z1'-z1}...z2 left_to_down
%  z3...z4---z6...z7 down_to_left z8...z9{z9-z9'};
%  z10=tmp_path intersectionpoint ((x10,y3)..(x10,y5));
%  z11=tmp_path intersectionpoint ((x10,y3)..(x10,y2));
%  z12=tmp_path intersectionpoint ((x12,y7)..(x12,y5));
%  z13=tmp_path intersectionpoint ((x12,y7)..(x12,y8));
%  draw tmp_path; draw z10..z11; draw z12..z13;
%  square_end1(z1-z1'); square_end9(z9-z9');
%  labels(1,1',2,3,4,5,6,7,8,9,9',10,11,12,13);
%  math_fit(0,0);
%endchar;

iff known bbvarphi:
beginchar(bbvarphi,10u#+2appr#,x_height#,desc_depth#);
  "Lowercase Greek variant phi";
  italcorr 0.6x_height#*slant+ho#-.5u#;
  center_stem(1,2,5); bot y1=-d; y2=0.7[y5,y3];
  top y3=top y7=h+oo; y4=y6=0.5[y5,y3]; bot y5=-oo;
  x3=0.3[x2,x4]; rt x4=w-apprr+ho; lft x6=apprl-ho;
  rt x7=lft x1-hround 0.25u;
  tmp_path:=z1..z2 up_to_right z3 right_to_down z4
  down_to_left z5 left_to_up z6 up_to_right z7;
  draw tmp_path;
  bbbowl(z7,z6,z5,hThick) tmp_path;
  bbbowl(z3,z4,z5,hThick) tmp_path;
  square_end1(down);
  square_end7(right);
  labels(1,2,3,4,5,6,7);
  math_fit(0,0);
endchar;

% Ionian extension
% (Carl B. Boyer, ``A History of Mathematics'';
% Yannis Haralambous and Claus Thull,
% ``Typesetting Modern Greek with 128 Character Codes''.)
% One should also cite Sylvio Levy for his talentuous work
% on Greek letters.

iff known bbdigamma:
beginchar(bbdigamma,10u#+2appr#,x_height#,desc_depth#);
  "Lowercase Ionian digamma";
  italcorr x_height#*slant+.5u#;
  pickup circle.nib;
  top y1=vround 0.9h; top y3=h+oo; bot y9=-oo;
  y5=good.y 0.3[y9,y3]; y7=good.y 0.7[y9,y3];
  y4=0.42[y5,y3]; y8=.384[y7,y9]; y10=0.3[y9,y5];
  rt x1=w-apprr+hround u; lft x4=apprl-ho;
  rt x8=w-apprr-hround u+ho; lft x10=x5;
  x3=0.5[x4,x8]; z2=0.5[z1,z3]; x5=0.25[x4,x8];
  x7=0.75[x4,x8]; z6=0.5[z5,z7];
  tmp_path:=z1{left}...z2{(z3-z1) xscaled 0.5}...z3
  left_to_down z4 down_to_right z5...z6{(z6-z5) xscaled 1/3}
  ...z7 right_to_down z8 & elliptic_arc(8,9,10);
  x16=good.x x9; y16=-d;
  penpos15(thin*(1++slant),0); penpos16(thin*(1++slant),0);
  z15=tmp_path intersectionpoint (z16..(x16,y10));
  draw tmp_path;
  bbbowl(z3,z4,z5,hThick) tmp_path;
  bbbowl(z7,z8,z9,hThick) tmp_path;
  penstroke z15e..z16e;
  square_end1(right); square_end10(z10-z10');
  labels(1,2,3,4,5,6,7,8,9,10,10'); penlabels(15,16);
  math_fit(0,0);
endchar;

iff known bbkoppa:
beginchar(bbkoppa,8u#+2appr#,x_height#,desc_depth#);
  "Lowercase Ionian koppa";
  italcorr 0.6x_height#*slant+ho#-.5u#;
  center_stem(2,3); penpos2(thin*(1++slant),0);
  penpos3(thin*(1++slant),0); y3=-d; y2=y1d;
  bbcircle1(apprl-ho,w-apprr+ho,x_height+uo,-oo); draw last_path;
  bbbowl(z1b,z1a,z1d,hThick) last_path;
  bbbowl(z1b,z1c,z1d,hThick) last_path;
  penstroke z2e..z3e;
  penlabels(2,3);
  math_fit(0,0);
endchar;

% I won't use it, but I think it would have been nice
% that `koppa' looked as a reverse `rho'.
%beginchar(bbkoppa,8u#+2appr#,x_height#,desc_depth#);
%  "Lowercase Ionian koppa";
%  italcorr 0.6x_height#*slant+ho#-.5u#;
%  pickup circle.nib; numeric t;
%  bot y2=bot y3=-d; top y5=h+uo; bot y7=-oo; y4=y6=0.5[y7,y5];
%  rt x4=rt x3=w-apprr; lft x6=apprl-ho; x5=x7=0.5[x4,x6];
%  x3-x2=hthick; x9-x6=hThick;
%  tmp_path:=z3..z4 up_to_left z5 left_to_down
%  z6 down_to_right z7 right_to_up z4;
%  t=xpart(tmp_path intersectiontimes (z2..(x2,y4)));
%  z8=point t of tmp_path;
%  z1=tmp_path intersectionpoint ((x2,y4)..(x2,y5));
%  z9=tmp_path intersectionpoint ((x9,y7)..(x9,y6));
%  z10=tmp_path intersectionpoint ((x9,y6)..(x9,y5));
%  draw subpath (0,t) of tmp_path; draw z1..z2; draw z9..z10;
%  pickup square.nib; draw z2..z3;
%  penlabels(1,2,3,4,5,6,7,8,9,10);
%  math_fit(0,0);
%endchar;

iff known bbsampi:
beginchar(bbsampi,10u#+2appr#,asc_height#,0);
  "Lowercase Ionian sampi";
  % no italic correction
  x1=apprl; x5=w-apprr;
  y2=y3=max(x_height,2h/3)-thin; y1=y4=y5=0; y6=y7=h;
  numeric a,x,y; a=(abs(x5-x1)-2y2*slant)/(2y2); y=thick/(2y2);
  x=thick*(-a*y+sqrt(1+(a**2)-(y**2)))/(1-(y**2));
  x3-x2=x5-x4=x7-x6=x; x2-x1=x4-x2; z6=whatever[z4,z2];
  a:=diag_width(thin,z2-z4);
  penpos1(diag_width(thin,z2-z1),0);
  penpos4(a,0); penpos5(a,0); penpos6(a,0); penpos7(a,0);
  y6-y6a=thin; z6-z6a=z7-z7a=z4a-z4=z5a-z5=whatever*(z6-z4);
  z8=0.5[z1,z4]; z9=0.5[z2,z4]; penpos8(diag_width(thin,z9-z8),0);
  forsuffixes $=l,r:
    z2$-z1$=whatever*(z2-z1); z2$=whatever[z2,z4];
    z9$=whatever[z4,z6]; z9$-z8$=whatever*(z9-z8);
  endfor
  penstroke z1e..z2e; penstroke z4e..z6e; penstroke z5e..z7e;
  penstroke z8e..z9e;
  fill z4--z5--z5a--z4a--cycle; fill z6--z7--z7a--z6a--cycle;
  penlabels(1,2,3,4,5,6,7,8,9); labels(4a,5a,6a,7a);
  math_fit(0,0);
endchar;

iff known bbvardigamma:
beginchar(bbvardigamma,7.5u#+2appr#,x_height#,desc_depth#);
  "Lowercase Ionian variant digamma";
  italcorr x_height#*slant-.5u#;
  pickup circle.nib; rt x1=w-apprr; lft x2=lft x3=apprl;
  x4=x5=x3+hthick; lft x6=x4; rt x7=w-apprr-hround u;
  top y1=top y2=top y5=h; bot y3=bot y4=-d;
  bot y6=bot y7=vround 0.5(h-d); pickup square.nib;
  draw z1--z2--z3--z4--z5; draw z6..z7;
  labels(1,2,3,4,5,6,7);
  math_fit(0,0);
endchar;

iff known bbvarkoppa:
beginchar(bbvarkoppa,8u#+2appr#,asc_height#,desc_depth#);
  "Lowercase Ionian variant koppa";
  italcorr 0.4[asc_height#,-desc_depth#]*slant-.5u#;
  pickup circle.nib;
  y4r=vround 0.4[-d,h]; y5l+d=h-y4r;
  bot y1=bot y4=y4r; top y2=top y3=h;
  top y5=top y6=y5l; bot y7=bot y8=-d;
  lft x1=lft x2=apprl; rt x6=rt x7=w-apprr;
  x4-x1=x3-x2=x6-x5=x7-x8=hthick; x4r=rt x4; x5l=lft x5;
  adjust_slanted_bar(4r,5l,4l,5r)(thin,1);
  penstroke z4e..z5e; pickup square.nib;
  draw z1--z2--z3--z4--cycle; draw z5--z6--z7--z8--cycle;
  labels(1,2,3,6,7,8); penlabels(4,5);
  math_fit(0,0);
endchar;

iff known bbslash_lambda:
beginchar(bbslash_lambda,9u#+2appr#,asc_height#,0);
  "Slashed lowercase Greek lambda";
  italcorr x_height#*slant-.5u#;
  x1=x8=apprl; x5=x11=w-apprr;
  y2+0.5thin=y3+0.5thin=y8r=y11r=max(x_height,0.6h);
  y1=y4=y5=0; y6=y7=h;
  numeric a,x,y; a=(abs(x5-x1)-2y2*slant)/(2y2); y=thick/(2y2);
  x=thick*(-a*y+sqrt(1+(a**2)-(y**2)))/(1-(y**2));
  x3-x2=x5-x4=x7-x6=x; x2-x1=x4-x2; z6=whatever[z4,z2];
  a:=diag_width(thin,z2-z4);
  penpos1(diag_width(thin,z2-z1),0);
  penpos4(a,0); penpos5(a,0); penpos6(a,0); penpos7(a,0);
  forsuffixes $=r,l:
    z2$-z1$=whatever*(z2-z1); z2$=whatever[z2,z4];
  endfor
  y6-y6a=thin; z6-z6a=z7-z7a=z4a-z4=z5a-z5=whatever*(z6-z4);
  penpos8(thin,90); penpos11(thin,90);
  forsuffixes $=,r,l:
    y8$=y9$=y10$; z9$=whatever[z4,z6]; z10$=whatever[z5,z7];
  endfor
  penstroke z1e..z2e; penstroke z4e..z6e; penstroke z5e..z7e;
  penstroke z8e..z9e; penstroke z10e..z11e;
  fill z4--z5--z5a--z4a--cycle; fill z6--z7--z7a--z6a--cycle;
  penlabels(1,2,3,4,5,6,7,8,9,10,11); labels(4a,5a,6a,7a);
  math_fit(0,0);
endchar;