summaryrefslogtreecommitdiff
path: root/fonts/ec/src/exbraces.mf
blob: 60c5fa0d652a19c20d30400b6e81b92ef7b94054 (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
% exbraces.mf
%
% (c) Copyright 1995, 1996, 1997 J"org Knappen
% (c) Copyright 1990, 1992 Norbert Schwarz
%
% This file is part of ecfonts version 1.0 Patchlevel 3
%
%
% Please read the files 00readme.txt, 00inst.txt, 00error.txt, and
% copyrite.txt for further information
%
% You find some documentation in ecdoc.tex (needs LaTeX2e)
%
% Content:
%
% braces and some special characters
%
version_check(1,0);  % |version_check| was introduced in dc1.3

ecchar "Circumflex (hat)";
beginchar(oct"136",11u#,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=.75[x_height,h]; x2=.5w;
 x1=w-x3=good.x 2.25u; y1=y3=.25[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=2/3[x_height,h]; x2=.5w; bot y1=bot y3=vround x_height-eps;
 lft x1l=hround(rt x2r-3.25u-.5vair);
 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;



ecchar "Tilde (squiggle)";
beginchar(oct"176",11u#,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;

ecchar "Compound word mark";
beginchar(oct"027",0,x_height#,0);
zero_width;
endchar;

ecchar "Left parenthesis";
beginchar("(",7u# if monospace: -u# fi,body_height#,paren_depth#);
italcorr body_height#*slant-.5u#;
adjust_fit(0,0); pickup fine.nib;
pos1(vair,0); pos2(.75[hair,stem],0); pos3(vair,0);
rt x1r=rt x3r=hround(w-u); lft x2l=hround(x1-4u if monospace: +4/3u fi);
top y1=h; y2=.5[y1,y3]=math_axis;
filldraw stroke z1e{3(x2e-x1e),y2-y1}...z2e
 ...{3(x3e-x2e),y3-y2}z3e;  % arc
penlabels(1,2,3); endchar;

ecchar "Right parenthesis";
beginchar(")",7u# if monospace: -u# fi,body_height#,paren_depth#);
italcorr math_axis#*slant-.5u#;
adjust_fit(0,0); pickup fine.nib;
pos1(vair,0); pos2(.75[hair,stem],0); pos3(vair,0);
lft x1l=lft x3l=hround u; rt x2r=hround(x1+4u if monospace: -4/3u fi);
top y1=h; y2=.5[y1,y3]=math_axis;
filldraw stroke z1e{3(x2e-x1e),y2-y1}...z2e
 ...{3(x3e-x2e),y3-y2}z3e;  % arc
penlabels(1,2,3); endchar;


ecchar "Less than sign";
compute_spread(5/4x_height#,3/2x_height#);
beginchar("<",14u#,v_center(spread#+rule_thickness#));
italcorr h#*slant-u#;
adjust_fit(0,0); pickup extra_rule.nib;
lft x2=hround 1.5u-eps; x1=x3=w-x2;
y1-y3=spread; y2=.5[y1,y3]=math_axis;
draw z1--z2--z3;  % diagonals
labels(1,2,3); endchar;

ecchar "Vertical line";
beginchar(oct"174",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;


ecchar "Greater than sign";
compute_spread(5/4x_height#,3/2x_height#);
beginchar(">",14u#,v_center(spread#+rule_thickness#));
italcorr math_axis#*slant-u#;
adjust_fit(0,0); pickup extra_rule.nib;
rt x2=hround(w-1.5u)+eps; x1=x3=w-x2;
y1-y3=spread; y2=.5[y1,y3]=math_axis;
draw z1--z2--z3;  % diagonals
labels(1,2,3); endchar;

ecchar "Left bracket";
numeric wd#; wd#=max(5u#,4.5u#+.5if hefty:stem# else:rule_thickness# fi);
beginchar("[",wd#,body_height#,paren_depth#);
italcorr body_height#*slant;
adjust_fit(0,0);
numeric top_thickness,side_thickness;
% if hefty:
 top_thickness=vair;
 side_thickness=max(crisp.breadth,stem-stem_corr);
% else: top_thickness=side_thickness=rule_thickness; fi;
pickup crisp.nib; pos1(side_thickness,0); pos2(side_thickness,0);
top y1=h; bot y2=-d; lft x1l=lft x2l=hround(2.5u-.5side_thickness)-1-eps;
filldraw stroke z1e--z2e;  % stem
pos3(top_thickness,90); pos4(top_thickness,90);
pos5(top_thickness,90); pos6(top_thickness,90);
x3=x5=x1l; rt x4=rt x6=ceiling(w-.4u)+eps; y3r=y4r=y1; y5l=y6l=y2;
filldraw stroke z3e--z4e;  % upper bar
filldraw stroke z5e--z6e;  % lower bar
penlabels(1,2,3,4,5,6); endchar;

ecchar "Right bracket";
numeric wd#; wd#=max(5u#,4.5u#+.5if hefty:stem# else:rule_thickness# fi);
beginchar("]",wd#,body_height#,paren_depth#);
italcorr body_height#*slant-2u#+.5if hefty:stem# else:rule_thickness# fi;
adjust_fit(0,0);
numeric top_thickness,side_thickness;
%if hefty:
  top_thickness=vair;
 side_thickness=max(crisp.breadth,stem-stem_corr);
% else: top_thickness=side_thickness=rule_thickness; fi;
pickup crisp.nib; pos1(side_thickness,0); pos2(side_thickness,0);
top y1=h; bot y2=-d; rt x1r=rt x2r=hround(w-2.5u+.5side_thickness)+1+eps;
filldraw stroke z1e--z2e;  % stem
pos3(top_thickness,90); pos4(top_thickness,90);
pos5(top_thickness,90); pos6(top_thickness,90);
x3=x5=x1r; lft x4=lft x6=floor .4u-eps; y3r=y4r=y1; y5l=y6l=y2;
filldraw stroke z3e--z4e;  % upper bar
filldraw stroke z5e--z6e;  % lower bar
penlabels(1,2,3,4,5,6); endchar;


ecchar "Reverse slash (backslash)";
beginchar(oct"134",9u#,body_height#,paren_depth#);
adjust_fit(0,0); pickup extra_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;

ecchar "Left curly brace";
beginchar(oct"173",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;

ecchar "Right curly brace";
beginchar(oct"175",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;




ecchar "Underbar";
compute_spread((5/8+.45)*x_height#,(3/4+.55)*x_height#);
beginchar(oct"137",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;

iff not monospace:
ecchar "Hyphenchar";
beginchar(oct"177",3u#,x_height#,0);
italcorr .5x_height#*slant-.5u#;
adjust_fit(0,0);
numeric thickness; thickness=if hefty:bar else:.75[hair,stem] fi;
pickup crisp.nib; pos1(thickness,90); pos2(thickness,90);
top y1r=top y2r=vround(.5h+.5thickness); rt x2=hround(2w-u)+eps;
lft x1=hround .2u-eps;
filldraw stroke z1e--z2e;  % bar
penlabels(1,2); endchar;

iff monospace:
ecchar "Hyphenchar";
beginchar(oct"177",3u#,x_height#,0);
italcorr .5x_height#*slant-.5u#;
adjust_fit(0,0);
numeric thickness; thickness=if hefty:bar else:.75[hair,stem] fi;
pickup crisp.nib; pos1(thickness,90); pos2(thickness,90);
top y1r=top y2r=vround(.5h+.5thickness); rt x2=hround(w-u)+eps;
x2=w-x1;
filldraw stroke z1e--z2e;  % bar
penlabels(1,2); endchar;

iff hefty: % Sans or typewriter
ecchar "Blank-space sign";
beginchar(oct"040",9u#,x_height#,.5desc_depth#);
italcorr bar_height#*slant-.25u#;
adjust_fit(0,0);
numeric thin_vair#; thin_vair#=.7vair#;
define_whole_blacker_pixels(thin_vair);
h:=bar_height;
forsuffixes $=1,2,3,4: penpos$(thin_vair,0); endfor
penpos0(thin_vair,90); x0=.5w; y0l=vround(-d-.5thin_vair);
x1=x2; x3=x4=w-x1; lft x1l=hround .75u;
y1=y4=h; y2=y3=y0;
fill z1l---z2l...(x2,y0l)---(x3,y0l)...z3r---z4r
 ..z4l---(x3l,y0r)--(x2r,y0r)---z1r..cycle;  % the stroke
penlabels(0,1,2,3,4); endchar;

iff not hefty: % Other than the above mentioned
ecchar "Blank-space sign"; % jk
beginchar(oct"040",9u#,x_height#,.5desc_depth#);
italcorr bar_height#*slant-.25u#;
adjust_fit(0,0);
numeric shaved_stem; shaved_stem=hround .9[vair,.85cap_stem];
if shaved_stem<crisp.breadth: shaved_stem:=crisp.breadth; fi
pickup crisp.nib;
pos1(shaved_stem,-90); pos2(hair,0);
bot y1r=-d; x1=.5w; rt x2r=hround(w-.75u); y2=good.y(y1l+.5beak)+eps;
arm(1,2,a,beak_darkness,2beak_jut);  % lower right arm and beak
pos3(hair,180); x3=w-x2; y3=y2;
arm(1,3,b,beak_darkness,-2beak_jut);  % lower left arm and beak
math_fit(0,.5ic#);
penlabels(1,2,3); endchar;

endinput;