summaryrefslogtreecommitdiff
path: root/fonts/wnri/addpunc.mf
blob: f94945d7567e0e9712b27f189db690f7d25abc26 (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
%
% Washington Romanized Indic accent driver
%
% Macros for various punctuation marks
%

cmchar "Circumflex (hat) accent";
newchar(hat,9u#,min(asc_height#,2x_height#),0);
if serifs: italcorr .5[x_height#,h#]*slant+.5hair#-1.75u#;
 adjust_fit(0,0);
 pickup crisp.nib; pos2(.5[vair,curve],90); top y2r=h; x2=.5w;
 x1=w-x3=good.x 2.25u; y1=y3=.5[x_height,y2];
 pos1(hair,angle(z2-z1)+90); pos3(hair,angle(z3-z2)+90);
 filldraw stroke z1e--z2e--z3e;  % diagonals
else: italcorr 2/3[x_height#,h#]*slant-.5stem#+.5vair#-.75u#;
 adjust_fit(0,0);
 pickup fine.nib; pos1(vair,0); pos3(vair,0); x1=w-x3;
 pos2(stem,0); top y2=h; x2=.5w; bot y1=bot y3=vround 2/3[h,x_height]-eps;
 lft x1l=hround(rt x2r-3.25u-.5vair); % same slope as in the acute accent
 z0=whatever[z1r,z2r]=whatever[z2l,z3l];
 y4l=y4r=y2; x4l=good.x .2[x2l,x2]; x4r=w-x4l;
 filldraw z4l--z1l--z1r--z0--z3l--z3r--z4r--cycle; fi  % diagonals
penlabels(0,1,2,3,4); endchar;

cmchar "Underbar";
compute_spread((5/8+.45)*x_height#,(3/4+.55)*x_height#);
newchar(underscore,14u#,0,spread#-math_axis#+.5rule_thickness#);
adjust_fit(0,0); pickup rule.nib;
lft x1=hround 1.5u-eps; x2=w-x1; bot y1=bot y2=-d;
draw z1--z2;  % bar
labels(1,2); endchar;

cmchar "Left curly brace";
newchar(left_brace,9u#,body_height#,paren_depth#);
italcorr body_height#*slant+.5vair#-u#;
adjust_fit(0,0); pickup fine.nib;
forsuffixes $=1,1',4,4',7,7': pos$(vair,0); endfor
forsuffixes $=2,3,5,6: pos$(stem,0); endfor
x2=x3=x5=x6; x1=x1'=x7=x7'=w-x4=w-x4';
lft x4l=hround(1.5u-.5vair); lft x2l=hround(.5w-.5stem);
top y1=h; bot y7=-d; .5[y4,y4']=.5[y1,y7]=.5[y2,y6]=.5[y3,y5];
y1-y2=y3-y4=(y1-y4)/4; y1-y1'=y4-y4'=y7'-y7=vair-fine;
filldraw z1l{left}...z2l---z3l...{left}z4l
 --z4'l{right}...z5l---z6l...{right}z7l
 --z7r--z7'r{left}...z6r---z5r...{left}.5[z4r,z4'r]{right}
 ...z3r---z2r...{right}z1'r--z1r--cycle;  % stroke
penlabels(1,2,3,4,5,6,7); endchar;

cmchar "Right curly brace";
newchar(right_brace,9u#,body_height#,paren_depth#);
italcorr math_axis#*slant+.5vair#-u#;
adjust_fit(0,0); pickup fine.nib;
forsuffixes $=1,1',4,4',7,7': pos$(vair,0); endfor
forsuffixes $=2,3,5,6: pos$(stem,0); endfor
x2=x3=x5=x6; x1=x1'=x7=x7'=w-x4=w-x4';
rt x4r=hround(w-1.5u+.5vair); rt x2r=hround(.5w+.5stem);
top y1=h; bot y7=-d; .5[y4,y4']=.5[y1,y7]=.5[y2,y6]=.5[y3,y5];
y1-y2=y3-y4=(y1-y4)/4; y1-y1'=y4-y4'=y7'-y7=vair-fine;
filldraw z1r{right}...z2r---z3r...{right}z4r
 --z4'r{left}...z5r---z6r...{left}z7r
 --z7l--z7'l{right}...z6l---z5l...{right}.5[z4l,z4'l]{left}
 ...z3l---z2l...{left}z1'l--z1l--cycle;  % stroke
penlabels(1,2,3,4,5,6,7); endchar;

cmchar "Tilde (squiggle) accent";
newchar(Tilde,9u#,min(asc_height#,10/7x_height#+.5dot_size#),0);
italcorr h#*slant-u#;
adjust_fit(0,0);
if serifs: numeric theta; theta=angle(1/6(6u-vair),1/4(h-x_height));
 pickup crisp.nib; numeric mid_width; mid_width=.4[vair,stem];
 pos1(vair,theta+90); pos2(vair,theta+90);
 pos3(vair,theta+90); pos4(vair,theta+90);
 z2-z1=z4-z3=(mid_width-crisp)*dir theta;
 lft x1r=w-rt x4l=hround 1.5u; top y4r=h;
 bot y1l=vround(bot y1l+min(2/3[x_height,h],y3l-.25vair)-top y1r);
 pair delta; ypart delta=3(y3l-y1l); delta=whatever*dir theta;
 filldraw z1l..controls(z1l+delta)and(z3l-delta)..z3l..z4l
  --z4r..controls(z4r-delta)and(z2r+delta)..z2r..z1r--cycle;  % stroke
else: pickup fine.nib; pos1(vair,180); pos2(vair,90);
 pos3(.5[vair,slab],90); pos4(vair,90); pos5(vair,180);
 lft x1r=w-rt x5l=hround 1.5u; x2-x1=x3-x2=x4-x3=x5-x4;
 bot y1=bot y4l=vround(.75[x_height,h]-vair);
 top y2r=top y5=h; y3=.5[y2,y4];
 filldraw stroke z1e{up}...z2e{right}..z3e..{right}z4e...{up}z5e; fi % stroke
penlabels(1,2,3,4,5); endchar;

cmchar "Reverse slash (backslash)";
newchar(backslash,9u#,body_height#,paren_depth#);
adjust_fit(0,0); pickup rule.nib;
lft x1=hround u-eps; top y1=h+eps;
rt x2=hround(w-u)+eps; bot y2=-d-eps;
draw z1--z2;  % diagonal
labels(1,2); endchar;

cmchar "Vertical line";
newchar(vertical,5u#,body_height#,paren_depth#);
italcorr body_height#*slant+.5rule_thickness#-2u#;
adjust_fit(0,0); pickup rule.nib;
x1=x2=good.x .5w; top y1=h+eps; bot y2=-d-eps;
draw z1--z2;  % stem
labels(1,2); endchar;

cmchar "Closing quotes";
newchar(rquote,7u#+max(2u#,dot_size#),asc_height#,0);
italcorr asc_height#*slant+dot_size#-4.1u#;
adjust_fit(0,0);
x1-.5dot_size=hround .6u; y2+.5dot_size=h;
x2-x1=hround(1.5u+max(2u,dot_size)); y2=y1;
comma(1,a,dot_size,.25u,comma_depth); % left dot and tail
comma(2,b,dot_size,.25u,comma_depth); % right dot and tail
penlabels(1,2); endchar;

% end of file addpunc.mf