summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/fonts/source/public/bookhands/imajl.mf
blob: f6746095bf305312fe01d5689b4f7ecdd6162598 (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
%%
%% This is file `imajl.mf',
%% generated with the docstrip utility.
%%
%% The original source files were:
%%
%% inslrmaj.dtx  (with options: `min')
%% 
%%  Copyright 1999 Peter R. Wilson
%% 
%%  This program is provided under the terms of the
%%  LaTeX Project Public License distributed from CTAN
%%  archives in directory macros/latex/base/lppl.txt.
%% 
%% Author: Peter Wilson (CUA)
%%         now at: peter.r.wilson@boeing.com
%% 

cmchar "IMAJ letter a";
beginchar("a", 2sb#+hstretch*(5/3x_height#),
               x_height#, 0);
adjust_fit(0,0);
pcshiftx := sb;
numeric n[];
path pth[];
pickup quill;
%% left bowl
n1 := w-2pcshiftx;  % actual letter width
n2 := 7/10n1;       % width of left bowl
z1=(pcshiftx,0);
obowl(1, n2, h);
pth1:=obouter; pth2:=obinner;
pth10:=obfirst; pth20:=obsecond;
%% right bowl
n3:=x1+n2-16/12thick;    % leftmost point of "stem"
n4:=2(n1-n3);            % total width of right stem bowl
z2=(n3,0);
offsetbowl(2, n4, h, 6/12, 1/2);
pth3:=obouter; pth4:=obinner;
pth30:=obfirst; pth40:=obsecond;
%% intersect left bowl with outer of right bowl
z1tout = (subpath (0,1) of pth1) intersectionpoint (subpath (4,2) of pth3);
z1tinn = (subpath (0,1) of pth2) intersectionpoint (subpath (4,2) of pth3);
z1lout = (subpath (1,2) of pth1) intersectionpoint (subpath (4,2) of pth3);
z1linn = (subpath (1,2) of pth2) intersectionpoint (subpath (4,2) of pth3);

%%ductus:=true;
if ductus:
  pickup stylus;
  % draw the control paths
  draw pth10; draw pth20;
  draw pth30; draw pth40;
else:
  %%  draw left bowl
  fill z1lout..z1minro{-pdir}..z1maxlo{ppdir}..z1minlo{pdir}..z1tout--
       z1tinn..z1minli{-pdir}..z1maxli{-ppdir}..z1minri{pdir}..z1linn--
       cycle;
  %% draw right stem/bowl
  fill z2minro{-pdir}..z2maxlo{ppdir}..{pdir}z2minlo--
       z2minli{-pdir}..z2maxli{-ppdir}..{pdir}z2minri--cycle;
fi
ductus:=false;
penlabels(1,2,3,4,5,6,7,8,100);
endchar; % end "a"

cmchar "IMAJ letter b";
beginchar("b", 2sb#+hstretch*(7/6x_height#),
               asc_height#, 0);
adjust_fit(0,0);
numeric n[];
pcshiftx := sb;
pickup quill;
n1:=w-2pcshiftx;    % actual letter width
n2:=h/ascratio;    % top of bowl
z1=(pcshiftx, -o);
obowl(1, n1, n2+o);
%% draw bowl
fill obouter; unfill obinner;
%% top of stem
x2=x1wt+1/3n1; top y2=h;
tangentpoint(2, subpath (3,4) of obsecond);
%%ductus:=true;
if ductus:
  pickup stylus;
fi
draw z2tan--z2;
draw_triserif(2,trijut);
ductus:=false;
penlabels(1,2,3,4,5,6,7,8,9,100);
endchar; % end "b"

cmchar "IMAJ letter c";
beginchar("c", 2sb#+hstretch*(5/6x_height#),
               x_height#, 0);
adjust_fit(0,0);
numeric n[];
pcshiftx := sb;
pickup quill;
n1:=w-2pcshiftx;     % actual letter width
n2:=6/5w-2pcshiftx;  % width of full bowl
z1=(pcshiftx,0);
obowl(1, n2, h);
z3=(x1+n1, h);                % top RH corner
z4=(x1obc,1/6h); z5=(3/2w,y4);   % for horizontal line
%% top intersection points
z10i = (z1obc--z3) intersectionpoint obinner;
z10o = (z1obc--z3) intersectionpoint obouter;
%% bottom intersection points
z20i = (z4--z5) intersectionpoint obinner;
z20o = (z4--z5) intersectionpoint obouter;
%%ductus:=true;
if ductus:
  pickup stylus;
fi
fill z20o..z1minro{-pdir}..z1maxlo{ppdir}..z1minlo{pdir}..z10o--
     z10i..z1minli{-pdir}..z1maxli{-ppdir}..z1minri{pdir}..z20i--
     cycle;
ductus:=false;
penlabels(1,2,3,4,5,6,16,17,18,100);
endchar; % end "c"

cmchar "IMAJ letter d";
beginchar("d", 2sb#+hstretch*(x_height#+1/2thick#),
               x_height#, 0);
adjust_fit(0,0);
numeric n[];
pcshiftx := sb;
pickup quill;
%% bowl
n1 := w-2pcshiftx;    % actual letter width
n2 := n1-1/2thick;    % width of bowl
n3 := h;              % top of bowl
z1=(w-pcshiftx-n2, 0);
obowl(1, n2, n3);
%% top bar
lft x3=pcshiftx; y3=h;
z3i=(pcshiftx, y3-1/2thin); z3o=(x3i,y3i+thin);
z2i=(x1nh,y3i);
z2o=(x2i,y3o);
%%ductus:=true;
if ductus:
  pickup stylus;
fi
fill z1minlo{-pdir}..z1maxlo{-ppdir}..z1minro{pdir}..z1maxro{ppdir}..{left}z2o--
     z3o--z3i--
     z2i{right}..z1maxri{-ppdir}..z1minri{-pdir}..z1maxli{ppdir}..{pdir}z1minli--
     cycle;
draw_utriangle(3, thick);
ductus:=false;
penlabels(0,1,2,3,4,5,6,7,8,100);
endchar; % end "d"

cmchar "IMAJ letter e";
beginchar("e", sb#+hstretch*(x_height#+3/2thick#),
               x_height#, 0);
adjust_fit(0,0);
pcshiftx := sb;
numeric n[];
pickup quill;
n1 := w-pcshiftx;    % actual letter width
n2 := n1-3/2thick;   % width of bowl
z1=(pcshiftx,0);
obowl(1, n2, h);
%% for crossbar
z2=(0,2/3h); rt x3=w; y3=y2; z3'=(x1obc,y2);
z4 = (z2--z3') intersectionpoint subpath (3,4) of obsecond;
z10tout = (z3'--z3) intersectionpoint subpath (0,3) of obouter;
z10tinn = (z3'--z3) intersectionpoint subpath (0,3) of obinner;
%% bottom cutoff
z5=(x1obc,1/6h); z6=(w,y5);
z20bout = (z5--z6) intersectionpoint subpath (0,3) of obouter;
z20binn = (z5--z6) intersectionpoint subpath (0,3) of obinner;
%%ductus:=true;
if ductus:
  pickup stylus;
fi
fill z20bout..z1minro{-pdir}..z1maxlo{ppdir}..z1minlo{pdir}..z10tout--
     z10tinn..z1minli{-pdir}..z1maxli{-ppdir}..z1minri{pdir}..z20binn--
     cycle;
draw z4--z3;     % crossbar & decoration
draw_triangle(3,thick);
ductus:=false;
penlabels(1,2,3,4,5,6,7,8,9,100);
endchar; % end "e"

cmchar "IMAJ letter f";
beginchar("f", 2sb#+hstretch*(x_height#+trijut#),
               (x_height#), desc_depth#);
adjust_fit(0,0);
pcshiftx := sb;
pickup quill;
%% stem
lft x1=lft x2=pcshiftx+trijut;
top y1=h; bot y2=-d;
%% bottom bar
z4=(rt x1,-thin); rt x6=w-pcshiftx; y6=y4+2thin; z5=1/2[z4,z6];
%% top bar
z7=(rt x1, bot y1);
%%ductus:=true;
if ductus:
  pickup stylus;
fi
draw_tstem(1,2,srad);            % stem
draw_triserif(1,trijut);
draw_clubbase(1, 2, 1/3, clubjut, clubjut);
draw z4{dir(45)}..z5{right}..z6{dir(45)};   % bottom bar
draw_flick(7, 2thin, thin, (w-pcshiftx-x7+1/2thick)); % top bar
ductus:=false;
penlabels(1,2,3,4,5,6,7,100);
endchar; % end "f"

cmchar "IMAJ letter g";
beginchar("g", 2sb#+hstretch*(5/3x_height#),
               x_height#, desc_depth#);
adjust_fit(0,0);
path pth[];
pair vec[];
pcshiftx := sb;
pickup quill;
%% top bar
lft x1=pcshiftx; y1=h; rt x2=w-pcshiftx; y2=h;
%% curves
z3=2/5[z1,z2];
x5=4/5[x1,x2]; y5=-1/2d;
x4=(x3-thick); y4=1/2[y5,y3];
x7=1/2[x1,x4]; y7=y5;
x6=2/3[x7,x5]; bot y6=-d;
pth1 := z3..z4{down}..z5;
pth2 := z5--z6{left}..z7;
%% diagonal to close bottom bowl
vec1 := direction 2 of pth2;
vec2 := (z5-z6);
z7'=(lft x7, bot y7); z7''=(rt x7, y7);
pickup thickstylus;
lft x8 = x7'; bot y8 = y7';
z9' = z8 shifted 2vec2;
z9 = (z8--z9') intersectionpoint pth1;
z7''' = z7'' shifted 2vec1;
z8' = whatever[z7'',z7'''] = whatever[z8,z9'];
%%ductus:=true;
if ductus:
  pickup stylus;
  draw z1--z2;               % top bar
  draw pth1; draw pth2;      % curves
  draw rt z8--z9;            % diagonal
else:
  pickup quill;
  draw z1--z2;               % top bar
  draw_triangle(2,thick);
  draw_utriangle(1,thick);
  draw pth1; draw pth2;      % curves
  pickup thickstylus;
  draw rt z8--z9;            % diagonal
  fill z7''--z8'--z8--cycle;
fi
ductus:=false;
penlabels(1,2,3,4,5,6,7,8,9,100);
endchar; % end "g"

cmchar "IMAJ letter h";
beginchar("h", 2sb#+hstretch*(x_height#+trijut#),
               asc_height#, 0);
adjust_fit(0,0);
pcshiftx := sb;
pickup quill;
numeric n[];
%% stem
lft x1=lft x2=pcshiftx+trijut;
top y1=h; bot y2=0;
%% bowl
rt x3 = lft x1; y3=0;
n1 := w-pcshiftx-x3;     % bowl width
n2 := h/ascratio;        % bowl height
obowl(3, n1, n2);
z1'=(rt x1, y1); z2'=(x1',y2); %% right hand side of stem
z10tout = (z1'--z2') intersectionpoint subpath (3,4) of obouter;
z10tinn = (z1'--z2') intersectionpoint subpath (3,4) of obinner;
z10toth = (x1, y10tinn);    % avoids 180 turn in path
z6 = directionpoint down of obsecond;  % top of right leg
z6i=(lft x6, bot y6); z6o=(rt x6, bot y6);
z8=(x6,0);
%%ductus:=true;
if ductus:
  pickup stylus;
fi
draw_tstem(1,2,srad);                       % stem
draw_triserif(1,trijut);
draw_clubbase(1, 2, 1/3, clubjut, clubjut);
draw_tstem(6,8,srad);                       % right leg
draw_clubbase(6, 8, 1/3, 0, 1/2clubjut);
fill z6i{up}..z3minli{-pdir}..z10tinn--z10toth--  % top of bowl
     z10tout..z3minlo{pdir}..{down}z6o--cycle;
ductus:=false;
penlabels(1,2,3,4,5,6,100);
endchar; % end "h"

cmchar "IMAJ letter i";
beginchar("i", 2sb#+hstretch*(thick#+trijut#+jut#),
               x_height#, 0);
adjust_fit(0,0);
pcshiftx := sb;
pickup quill;
lft x1=lft x2=pcshiftx+trijut;
top y1=h; bot y2=0;
%%ductus:=true;
draw_tstem(1,2,srad);
draw_triserif(1,trijut);
draw_clubbase(1, 2, 1/3, clubjut, clubjut);
ductus:=false;
penlabels(1,2,100);
endchar; % end "i"

cmchar "IMAJ letter j";
beginchar("j", sb#+hstretch*(2/3x_height#),
               x_height#, desc_depth#);
adjust_fit(0,0);
pcshiftx := sb;
numeric n[];
pickup quill;
%% stem
rt x1 = w-pcshiftx; top y1 = h;
x2=x1; y2=-1/2d;
%% bottom hook
lft x3 = 0; bot y3 = -d;
%% triangle
n1 := thick;       % side length
z6=(lft x3, bot y3);
x7=x6+n1; z7=whatever[z6,z2];
z8=1/2[z6,z7];
z9=(x8, y8+0.9n1);
%%ductus:=true;
if ductus:
  pickup stylus;
fi
draw z1--z2;               % stem
draw_triserif(1,trijut);
draw z2--z3;               % hook
fill z6--z7--z9--cycle;    % triangle
ductus:=false;
penlabels(1,2,3,100);
endchar; % end "j"

cmchar "IMAJ letter k";
beginchar("k", 2sb#+hstretch*(x_height#+trijut#),
               x_height#, desc_depth#);
adjust_fit(0,0);
pcshiftx := sb;
pickup quill;
%% stem
lft x1=lft x2=pcshiftx+trijut;
top y1=h; bot y2=-d;
%% top arm
z3=(x1,5/6h);
rt x5=w-pcshiftx; y5=2/3h;
x4=1/2[x3,x5]; top y4=h;
%% lower arm
x7=x5; bot y7=0;
%%ductus:=true;
if ductus:
  pickup stylus;
fi
draw_tstem(1,2,srad);            % stem
draw_triserif(1,trijut);
draw_clubbase(1,2,1/3, clubjut, clubjut);
draw z3..z4{right}..z5;          % upper arm
draw z3..{right}z7;              % lower arm
ductus:=false;
penlabels(1,2,3,4,5,100);
endchar; % end "k"

cmchar "IMAJ letter l";
beginchar("l", 2sb#+hstretch*(7/6x_height#),
               asc_height#, 0);
adjust_fit(0,0);
pcshiftx := sb;
pickup quill;
lft x2=pcshiftx; y2=1/5h;
x1=x2+trijut; top y1=h;
rt x4=w-pcshiftx; y4=1/5h;
x3=1/2[x2,x4]; bot y3=0;
%%ductus:=true;
if ductus:
  pickup stylus;
fi
draw z1{down}..z2..z3{right}..z4;
draw_triserif(1,trijut);
ductus:=false;
penlabels(1,2,3,4,100);
endchar; % end "l"

cmchar "IMAJ letter m";
beginchar("m", 2sb#+hstretch*(5/3x_height#+trijut#),
               x_height#, 0);
adjust_fit(0,0);
pcshiftx := sb;
numeric n[];
path pth[];
pickup quill;
%% left stem
lft x1=pcshiftx+trijut; top y1=h;
x2=x1; bot y2=0;
z1'=(rt x1, y1+h); z2'=(rt x2, y2-h);
%% right stem
rt x5=w-pcshiftx; y5=y1;
z6=(x5,0);
%% middle stem
z3=1/2[z1,z5]; z4=1/2[z2,z6];
z3'=(rt x3, y3); z4'=(rt x4, y4);
n1 := x4-x2+3/2thick;       % width of bowl
n2 := 2/3h;                 % height of bowl
%% left bowl
z7=(rt x4 - n1, h-n2);
obowl(7, n1, n2);
pth1 := obouter; pth2 := obinner; pth3 := obsecond;
z17tout = (z1'--z2') intersectionpoint subpath (3,4) of obouter;
z17tinn = (z1'--z2') intersectionpoint subpath (3,4) of obinner;
z17toth = (x2, y17tinn);
%% right bowl
z8=(rt x6 - n1, y7);
obowl(8, n1, n2);
pth5 := obouter; pth6 := obinner; pth7 := obsecond;
z18tout = pth5 intersectionpoint subpath (0,1) of pth1;
z18tinn = pth6 intersectionpoint subpath (0,1) of pth1;
z13 = directionpoint down of pth3;
z15 = directionpoint down of pth7;
%%ductus:=true;
if ductus:
  pickup stylus;
fi
draw_tstem(1,2,srad);                             % left half
draw_triserif(1,trijut);
draw_clubbase(1, 2, 1/3, clubjut, clubjut);
fill z17tout..z7minlo{pdir}..{down}(rt x13, y13)--
     (lft x13, y13){up}..z7minli{-pdir}..z17tinn--z17toth--cycle;
draw_tstem(13,4,srad);                            % right half
fill z18tout..z8minlo{pdir}..{down}(rt x15, y15)--
     (lft x15, y15){up}..z8minli{-pdir}..z18tinn--cycle;
draw_tstem(15,6,srad);
ductus:=false;
penlabels(1,2,3,4,5,6,7,8,9,14,100);
endchar; % end "m"

cmchar "IMAJ letter n";
beginchar("n", 2sb#+hstretch*(7/6x_height#+trijut#),
               x_height#, 1/2desc_depth#);
adjust_fit(0,0);
pcshiftx := sb;
pickup quill;
%% left stem
lft x1=pcshiftx+trijut; top y1=h;
x2=x1; bot y2=-d;
%% right stem
rt x3=w-pcshiftx; y3=y1;
z4=(x3,0);
%% bar
z5=(x1,1/3h); z6=(x4,1/6h);
%%ductus:=true;
if ductus:
  pickup stylus;
fi
draw_tstem(1,2,srad);                % left stem
draw_triserif(1,trijut);
draw_clubbase(1, 2, 1/3, clubjut, clubjut);
draw_tstem(3,4,srad);                % right stem
draw_clubbase(3, 4, 1/3, clubjut, clubjut);
draw z5--z6;                         % bar
ductus:=false;
penlabels(1,2,3,4,5,6,100);
endchar; % end "n"

cmchar "IMAJ letter o";
beginchar("o", 2sb#+hstretch*(7/6x_height#),
               x_height#, 0);
adjust_fit(0,0);
pcshiftx := sb;
pickup quill;
lft x1=pcshiftx; rt x3=w-pcshiftx; y1=y3=h/2;
x2=x4=w/2; top y2=h+o; bot y4=-o;
%%ductus:=true;
if ductus:
  pickup stylus;
fi
%%%draw z1..z2..z3..z4..cycle;
z5=(pcshiftx,-o);
obowl(5, w-2pcshiftx, h+2o);
fill obouter; unfill obinner;
ductus:=false;
penlabels(1,2,3,4,5,100);
endchar; % end "o"

cmchar "IMAJ letter p";
beginchar("p", 2sb#+hstretch*(8/6x_height#+trijut#),
               x_height#, desc_depth#);
adjust_fit(0,0);
pcshiftx := sb;
numeric n[];
pickup quill;
%% stem
lft x1=lft x2=pcshiftx+trijut;
top y1=1/3h; bot y2=-d;
n1 := w - pcshiftx - lft x1;   % width of bowl
n2 := h+1/4d;                  % height of bowl
z3=(lft x1, -1/4d);
obowl(3, n1, n2);
%%ductus:=true;
if ductus:
  pickup stylus;
fi
draw_tstem(1,2,srad);                         % stem
draw_triserif(1,trijut);
draw_clubbase(1, 2, 1/3, clubjut, 0);
fill lft z1{up}..z3minlo{pdir}..z3maxro{-ppdir}..{-pdir}z3minro--
     z3minri{pdir}..z3maxri{ppdir}..z3minli{-pdir}..{down}rt z1--
     cycle;
ductus:=false;
penlabels(1,2,3,4,5,6,7,8,100);
endchar; % end "p"

cmchar "IMAJ letter q";
beginchar("q", 2sb#+hstretch*(x_height#+1/2trijut#),
               x_height#, 1/2desc_depth#);
adjust_fit(0,0);
pcshiftx := sb;
numeric n[];
pickup quill;
%% right stem
rt x1=w-pcshiftx-1/2trijut; top y1=h;
x2=x1; bot y2=-d;
z3=(pcshiftx,0);
n1 := w;    % width of bowl
n2 := h;    % height of bowl
obowl(3, n1, n2);
z10o = (rt z1--rt z2) intersectionpoint subpath (0,1) of obouter;
z10i = (lft z1--lft z2) intersectionpoint subpath (0,1) of obinner;
z20o = (rt z1--rt z2) intersectionpoint subpath (1,2) of obouter;
z20i = (lft z1--lft z2) intersectionpoint subpath (1,2) of obinner;
%%ductus:=true;
if ductus:
  pickup stylus;
fi
draw_tstem(1,2,srad);                              % stem
draw_triserif(1,trijut);
draw_clubbase(1, 2, 1/3, 0, clubjut);
fill z10o..z3minlo{-pdir}..z3maxlo{-ppdir}..z3minro{right}..z20o--
     z20i..z3minri{-pdir}..z3maxli{ppdir}..z3minli{pdir}..z10i--
     cycle;
ductus:=false;
penlabels(0,1,2,3,4,5,6,7,8,100);
endchar; % end "q"

cmchar "IMAJ letter r";
beginchar("r", sb#+hstretch*(11/6x_height#+trijut#),
               x_height#, 1/2desc_depth#);
adjust_fit(0,0);
pcshiftx := sb;
numeric n[];
pickup quill;
%% stem
lft x1=lft x2=pcshiftx+trijut; top y1=h; bot y2=-d;
n1 := w-pcshiftx;      % width of bowl
n2 := 5/6h;            % height of bowl
z3=(x1-1/2n1, h-n2);
obowl(3, n1, n2);
z10o=(x1,h);  z10i=(x1, y10o-thin);
z20o=(x1,y3); z20i=(x20o, y20o+thin);
%% arm
x4=x1; bot y4=y3;
x5=x3maxro; top y5=0;
%%rt x6=w; y6=y4;
rt x6=w; y6=y2;
%%ductus:=true;
if ductus:
  pickup stylus;
fi
draw_tstem(1,2,srad);                     % stem
draw_triserif(1,trijut);
draw_clubbase(1, 2, 1/3, clubjut, 0);
fill z10o{right}..z3maxro{-ppdir}..{left}z20o--
     z20i{right}..z3maxri{ppdir}..{left}z10i--cycle;
%%draw z4{right}..z5{right}..{right}z6;    % arm
draw z4{right}..{right}z6;
ductus:=false;
penlabels(1,2,3,4,5,6,7,8,9,100);
endchar; % end "r"

cmchar "IMAJ letter s";
beginchar("s", 2sb#+hstretch*(x_height#+trijut#),
               asc_height#, 0);
adjust_fit(0,0);
numeric n[];
pcshiftx := sb;
pickup quill;
%% stem
lft x1=lft x2=pcshiftx+trijut; top y1=h/ascratio; bot y2=0;
n1 := w;        % width of bowl
n2 := 2(h-y1);  % height of bowl
z3=(lft x1, y1-1/2n2);
obowl(3, n1, n2);
z4=(2w,2h);
z10o = (z3--z4) intersectionpoint subpath (0,1) of obouter;
z10i = (z3--z4) intersectionpoint subpath (0,1) of obinner;
%%ductus:=true;
if ductus:
  pickup stylus;
fi
draw_tstem(1,2,srad);            % stem
draw_triserif(1,trijut);
draw_clubbase(1, 2, 1/3, clubjut, clubjut);
fill rt z1{up}..z3minli{pdir}..z10i--
     z10o..z3minlo{-pdir}..{down}lft z1--cycle;
ductus:=false;
penlabels(1,2,3,4,5,6,7,11,17,26,27,28,100);
endchar; % end "s"

cmchar "IMAJ letter t";
beginchar("t", 2sb#+hstretch*(4/3x_height#),
               x_height#, 0);
adjust_fit(0,0);
pcshiftx := sb;
numeric n[];
pickup quill;
%% bar
lft x1 = pcshiftx; y1=h; rt x2=w-pcshiftx; y2=y1;
n1 := w;     % width of bowl
n2 := h;     % height of bowl
z3=(pcshiftx+thick,0);
obowl(3, n1, n2);
z5=(x1+w, 0);
z20o = (z1--z5) intersectionpoint subpath (1,2) of obouter;
z20i = (z1--z5) intersectionpoint subpath (1,2) of obinner;
z10o = (x3minlo, top y1);
z10i = (x3minlo, bot y1);
%%ductus:=true;
if ductus:
  pickup stylus;
fi
draw z1--z2;           % bar
draw_utriangle(1, thick);
draw_triangle(2, thick);
fill z10o{left}..z3maxlo{-ppdir}..z3minro{pdir}..z20o--
     z20i..z3minri{-pdir}..z3maxli{ppdir}..z10i{right}--cycle;
ductus:=false;
penlabels(1,2,3,4,5,6,11,12,100);
endchar; % end "t"

cmchar "IMAJ letter u";
beginchar("u", 2sb#+hstretch*(7/6x_height#+1/2trijut#),
               x_height#, 0);
adjust_fit(0,0);
pcshiftx := sb;
numeric n[];
pickup quill;
%% right stem
rt x1 = rt x2 = w-pcshiftx-1/2trijut;
y1=h; y2=0;
z1'=(x1-1/2thick,2h); z2'=(x1',-h);
%% bowl
n1 := w;       % width of bowl
n2 := 4/3h;    % height of bowl
z3=(pcshiftx,0);
obowl(3, n1, n2);
z4=(pcshiftx,h); z5=(w,y4);
z10o = (z4--z5) intersectionpoint subpath (3,4) of obouter;
z10i = (z4--z5) intersectionpoint subpath (3,4) of obinner;
z10'=1/2[z10o,z10i];
z10=(x10i,y1);
z20o = (z1'--z2') intersectionpoint subpath (1,3) of obouter;
z20i = (z1'--z2') intersectionpoint subpath (1,3) of obinner;
%%ductus:=true;
if ductus:
  pickup stylus;
fi
draw_tstem(1,2,srad);           % stem
draw_triserif(1,trijut);
draw_clubbase(1, 2, 1/3, 0, clubjut);
fill z10o..z3maxlo{-ppdir}..z3minro{pdir}..z20o--
     z20i..z3minri{-pdir}..z3maxli{ppdir}..z10i--cycle;
draw_triserif(10,trijut);       % serif on bowl
ductus:=false;
penlabels(1,2,3,4,5,6,7,8,9,11,16,100);
endchar; % end "u"

cmchar "IMAJ letter v";
beginchar("v", 2sb#+hstretch*(x_height#+trijut#),
               x_height#, 0);
adjust_fit(0,0);
pcshiftx := sb;
pickup quill;
numeric midx; midx:= pcshiftx;
lft x1=midx+trijut; top y1=h;
x2=x1; y2=h/2;
rt x4=w-pcshiftx; y4=y2;
x3=0.5[x2,x4]; bot y3=0;
x5=x4-trijut; y5=y1;
%%ductus:=true;
if ductus:
  pickup stylus;
fi
draw_triserif(1,trijut);
%%draw_triserif(5,trijut);
draw z1--z2{down}..z3{right}..z4{up}..z5;
ductus:=false;
penlabels(1,2,3,4,5,11,100);
endchar; % end "v"

cmchar "IMAJ letter w";
beginchar("w", 2sb#+hstretch*(5/3x_height#+trijut#),
               x_height#, 0);
adjust_fit(0,0);
pcshiftx := sb;
pickup quill;
numeric midx; midx:= w/2-trijut;
lft x1=midx+trijut; top y1=h;
x2=x1; y2=h/2;
rt x4=w-pcshiftx; y4=y2;
x3=0.5[x2,x4]; bot y3=0;
x5=x4-trijut; y5=y1;
lft x6=pcshiftx+trijut;
top y6=h;
%%lft x7=pcshiftx; y7=y2;
x7=x6; y7=y2;
x8=0.5[x7,x1]; y8=y3;
x15=0.5[x8,x1]; y15=y8;
z15'=z15 shifted (w*pdir);
x2'=x2; y2'=y15;
path p[];
p1=z1--z2';
p2=z15--z15';
z9= p2 intersectionpoint p1;
pair vec[];
p3=z6..z7{down}..{right}z8;
vec3 = direction 0 of p3;
z16=z6 shifted vec3;
%%ductus:=true;
if ductus:
  pickup stylus;
fi
draw_triserif(1,trijut);                      % right half
draw z1--z2{down}..z3{right}..z4{up}..z5;
draw_triserif(6,trijut);                      % left half
draw z6--z7{down}..z8{right}..z9;
ductus:=false;
penlabels(1,2,3,4,5,6,7,8,9,11,16,100);
endchar; % end "w"

cmchar "IMAJ letter x";
beginchar("x", 2sb#+hstretch*(16/6x_height#),
               x_height#, desc_depth#);
adjust_fit(0,0);
numeric n[];
pcshiftx := sb;
pickup quill;
n1 := w-2pcshiftx;    % total width
n2 := thick;          % triangle side
%% diag top left to bottom right
lft x1=pcshiftx; bot y1=2/3h;
x2=pcshiftx+1/7n1; top y2=h;
x5=pcshiftx+11/14n1; bot y5=-1/4d;
rt x6=pcshiftx+n1; top y6=1/6h;
%% diag bottom left to top right
x10=x1; bot y10=-d;
x50=pcshiftx+9/14n1; top y50=h;
rt x60=x5; bot y60=2/3h;
x40=pcshiftx+8/14n1; y40=h;
%% triangle
z100=(lft x10, bot y10);
x101=x100+n2; z101=whatever[z100,z40];
x102=x100; y102=1/2[y100,y101]+n2;
%%ductus:=true;
if ductus:
  pickup stylus;
fi
draw z1..z2{right}..z5{right}..z6;    % top left to bottom right
draw z10{z40-z10}..z50{right}..z60;   % bottom left to top right
fill z100--z101--z102--cycle;         % triangle
ductus:=false;
penlabels(1,2,3,4,5,6,7,8,100);
endchar; % end "x"

cmchar "IMAJ letter y";
beginchar("y", 2sb#+hstretch*(x_height#),
               x_height#, desc_depth#);
adjust_fit(0,0);
pcshiftx := u;
pickup quill;
%% main stroke
rt x1=w-pcshiftx; top y1=h;
lft x3=pcshiftx; y3=1/2h;
x4=x1; y4=0;
x2=2/3[x3,x1]; bot y2=h;
lft x5=1/2[x3,x4]; bot y5=-d;
%% arm
z101=1/2[z3,z4];
z103=(x1,y3);
%%ductus:=true;
if ductus:
  pickup stylus;
fi
draw z1..z2{left}..z3{down}..z4{down}..z5;  % main stroke
draw z101..z103{right};                     % arm
ductus:=false;
penlabels(1,2,3,4,5,6,7,8,9,10,100);
endchar; % end "y"

cmchar "IMAJ letter z";
beginchar("z", 2sb#+hstretch*(9/6x_height#),
               x_height#, 0);
adjust_fit(0,0);
numeric n[];
pcshiftx := sb;
pickup quill;
%% top bar
n10 := w-2pcshiftx;   % letter width
lft x1=pcshiftx; y1=h;
rt x2=pcshiftx+2/3n10; y2=y1;
%% diagonal
x3=x1; bot y3=0;
%% bowl
n1 := 2/3n10;          % width of bowl
n2 := 5/6h;            % height of bowl
z4=(w-pcshiftx-n1, 0);
obowl(4, n1, n2);
z5'=(0,1/4n2); z6'=(x4obc,y5');
z20o = (z5'--z6') intersectionpoint obouter;
z20i = (z5'--z6') intersectionpoint obinner;
z7'=(0,2/3n2); z8'=(x6',y7');
z10o = whatever[lft z3, lft z2] = whatever[z7',z8'];
z10i = whatever[rt z3, rt z2] = whatever[z7',z8'];
%%ductus:=true;
if ductus:
  pickup stylus;
fi
draw z1--z2;              % top bar
draw_utriangle(1,thick);
draw z2--z3;              % diagonal
fill z20o..z4minro{pdir}..z4maxro{ppdir}..z4minlo{-pdir}..{z3-z2}z10o--
     z10i{z2-z3}..z4minli{pdir}..z4maxri{-ppdir}..z4minri{-pdir}..z20i--
     cycle;
ductus:=false;
penlabels(1,2,3,4,5,6,10o,10i,20o,20i,100);
endchar; % end "z"