~ubuntu-branches/ubuntu/edgy/tipa/edgy

« back to all changes in this revision

Viewing changes to mf/tipasc.mf

  • Committer: Bazaar Package Importer
  • Author(s): Rafael Laboissiere
  • Date: 2003-12-11 10:50:58 UTC
  • Revision ID: james.westby@ubuntu.com-20031211105058-vq8ttydhah3hdzq1
Tags: upstream-1.2
ImportĀ upstreamĀ versionĀ 1.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
% tipasc.mf: TIPA small capital phonetic symbols
 
2
% Copyright 1996-2003 FUKUI Rei
 
3
%
 
4
% This program may be distributed and/or modified under the
 
5
% conditions of the LaTeX Project Public License, either version 1.2
 
6
% of this license or (at your option) any later version.
 
7
% The latest version of this license is in
 
8
%   http://www.latex-project.org/lppl.txt
 
9
% and version 1.2 or later is part of all distributions of LaTeX 
 
10
% version 1999/12/01 or later.
 
11
%
 
12
% This program consists of all files listed in Manifest.txt.
 
13
%
 
14
% Version 1.2 2003/01/01
 
15
%
 
16
% This font is based on:
 
17
%   Computer Modern font series by D. E. Knuth and
 
18
%   TSIPA by KOBAYASHI Hajime, FUKUI Rei and SHIRAKAWA Shun.
 
19
%
 
20
 
 
21
% romanu.mf -> tipasc.mf conversion:
 
22
 
23
% x_height    -> .626x_height
 
24
% bar_height  -> .632bar_height
 
25
% cap_height  -> x_height
 
26
% comma_depth -> 44/70comma_depth
 
27
% cap_hair    -> sc_hair
 
28
% cap_stem    -> sc_stem
 
29
% cap_curve   -> sc_curve
 
30
% cap_ess     -> sc_ess
 
31
% cap_jut     -> sc_jut
 
32
% cap_bar     -> sc_bar
 
33
% cap_band    -> sc_band
 
34
 
 
35
def sc_hair  = hair enddef;
 
36
def sc_stem  = stem enddef;
 
37
def sc_curve = curve enddef;
 
38
def sc_jut   = cap_jut enddef;
 
39
def sc_bar   = cap_bar enddef;
 
40
def sc_band  = cap_band enddef;
 
41
 
 
42
cmchar "Small capital Y";
 
43
beginchar("Y",13u#,x_height#,0);
 
44
italcorr x_height#*slant+.45u#;
 
45
adjust_fit(cap_serif_fit#,cap_serif_fit#);
 
46
numeric left_stem,right_stem,outer_jut,dy,alpha;
 
47
left_stem=sc_stem-stem_corr;
 
48
right_stem=min(sc_hair if hefty:-2stem_corr fi,left_stem);
 
49
outer_jut=.75sc_jut; x1l=w-x4r=l+letter_fit+outer_jut+.05u;
 
50
x2l=x5l=hround(.5w-.5left_stem); x3r=x5r; y1=y4=h; y2=y3=y5=.4h;
 
51
dy=y1-y2; alpha=((x2l-x1l)++dy)/dy;
 
52
penpos1(alpha*left_stem,0); penpos2(alpha*left_stem,0);
 
53
penpos3(alpha*right_stem,0); penpos4(alpha*right_stem,0);
 
54
penpos5(left_stem,0); penpos6(left_stem,0); x5=x6; y6=0;
 
55
z0=whatever[z1r,z2r]=whatever[z3l,z4l];
 
56
if y0>y2+cap_notch_cut: y0:=y2+cap_notch_cut;
 
57
  fill z0+.5right{up}...{z4-z3}diag_end(3l,4l,1,1,4r,3r)--z5r
 
58
    --diag_end(5r,6r,1,1,6l,5l)--z5l--diag_end(2l,1l,1,1,1r,2r){z2-z1}
 
59
    ...{down}z0+.5left--cycle; % diagonals and stem
 
60
else: fill z0--diag_end(0,4l,1,1,4r,3r)--z5r
 
61
    --diag_end(5r,6r,1,1,6l,5l)--z5l
 
62
    --diag_end(2l,1l,1,1,1r,0)--cycle; fi  % diagonals and stem
 
63
if serifs: numeric inner_jut; pickup tiny.nib;
 
64
 prime_points_inside(1,2); prime_points_inside(4,3); prime_points_inside(6,5);
 
65
 if rt x1'r+sc_jut+.5u+1<=lft x4'l-sc_jut: inner_jut=sc_jut;
 
66
 else: rt x1'r+inner_jut+.5u+1=lft x4'l-inner_jut; fi
 
67
 dish_serif(1',2,a,1/3,outer_jut,b,1/2,inner_jut);  % upper left serif
 
68
 dish_serif(4',3,c,.6,inner_jut,d,1/2,outer_jut)(dark);  % upper right serif
 
69
 dish_serif(6',5,e,1/3,sc_jut,f,1/3,sc_jut); fi  % lower serif
 
70
math_fit(.5u#-x_height#*slant,ic#-4u#);
 
71
penlabels(0,1,2,3,4,5,6); endchar;
 
72
 
 
73
cmchar "Small capital I";
 
74
beginchar("I",max(6u#,4u#+sc_stem#),x_height#,0);
 
75
italcorr x_height#*slant-.25u#;
 
76
adjust_fit(cap_serif_fit#,cap_serif_fit#);
 
77
pickup tiny.nib; pos1(sc_stem,0); pos2(sc_stem,0);
 
78
lft x1l=lft x2l=hround(.5w-.5sc_stem); top y1=h; bot y2=0;
 
79
filldraw stroke z1e--z2e; % stem
 
80
if serifs: dish_serif(1,2,a,1/3,1.05sc_jut,b,1/3,1.05sc_jut);  % upper serif
 
81
 dish_serif(2,1,c,1/3,1.05sc_jut,d,1/3,1.05sc_jut);  fi % lower serif
 
82
math_fit(0,.5ic#); penlabels(1,2); endchar;
 
83
 
 
84
cmchar "Inverted small capital R";
 
85
beginchar("K",if serifs: 12u#+.5max(2u#,sc_curve#)
 
86
 else:12.5u#-.5width_adj# fi,x_height#,0);
 
87
italcorr .75x_height#*slant+ if serifs: .25 else: 1 fi\\ u#;
 
88
adjust_fit(cap_serif_fit#,0);
 
89
pickup tiny.nib; pos1(sc_stem',0); pos2(sc_stem',0);
 
90
lft x1l=lft x2l=hround max(2u,3u-.5sc_stem'); bot y1=0; top y2=h;
 
91
filldraw stroke z2e--z1e; % stem
 
92
penpos3(sc_band,-90); penpos4(sc_band,-90);
 
93
penpos5(sc_curve if hefty:-3stem_corr fi,0);
 
94
penpos6(vair,90); penpos7(vair,90);
 
95
z3r=bot z1; y4=y3; y5=.5[y4l,y6l]; y6=y7;
 
96
x7=x2; y7l=vround(.5h-.5vair); x4=x6;
 
97
if serifs: x4=.5w-.5u; x5r=hround(w-2.25u);
 
98
else: x4=.5w+.5u; x5r=hround(w-u); fi
 
99
x4l:=x6l:=x4-.125sc_curve;
 
100
fill stroke z7e..pulled_arc.e(6,5) & pulled_arc.e(5,4)..z3e;  % lobe
 
101
if serifs: pos6'(vair,90); pos0(sc_stem,180);
 
102
 pos8(sc_curve,180); pos9(vair,90); pos10(hair,0);
 
103
 z6'=z6; lft x0r=lft x8r=hround(x5-2/3u-.5sc_curve);
 
104
 y8=1/3[y2,y7]; y0=3/5[y2,y7]; x9=.5[x8l,x10r];
 
105
 top y9r=h+o; rt x10r=hround(w-.05u); y10=1/4[y2,y7];
 
106
 filldraw stroke z6'e{right}..z0e---z8e....z9e{right}..z10e{down};  % tail
 
107
 nodish_serif(1,2,a,1/3,sc_jut,b,1/3,.5sc_jut);  % upper serif
 
108
 dish_serif(2,1,c,1/3,sc_jut,d,1/3,sc_jut);  % lower serif
 
109
else: penpos8(sc_stem-2stem_corr,0); penpos9(sc_stem,0);
 
110
 x8=x6+.5u; y8=y6; x9r=hround(w-.5u); y9=h;
 
111
 fill z8l--diag_end(8l,9l,.5,1,9r,8r)--z8r--cycle; fi  % tail
 
112
math_fit(0,.75ic#); penlabels(0,1,2,3,4,5,6,7,8,9,10); endchar;
 
113
 
 
114
cmchar "Small capital A";
 
115
beginchar(oct"300",13u#,x_height#,0);
 
116
adjust_fit(cap_serif_fit#,cap_serif_fit#);
 
117
numeric left_stem,right_stem,outer_jut,alpha;
 
118
right_stem=sc_stem-stem_corr;
 
119
left_stem=min(sc_hair if hefty: -3stem_corr fi,right_stem);
 
120
outer_jut=.8sc_jut; x1l=w-x4r=l+letter_fit+outer_jut+.5u; y1=y4=0;
 
121
x2-x1=x4-x3; x3r=x2r+apex_corr; y2=y3=h+apex_o+apex_oo;
 
122
alpha=diag_ratio(2,left_stem,y2-y1,x4r-x1l-apex_corr);
 
123
penpos1(alpha*left_stem,0); penpos2(alpha*left_stem,0);
 
124
penpos3(alpha*right_stem,0); penpos4(alpha*right_stem,0);
 
125
z0=whatever[z1r,z2r]=whatever[z3l,z4l];
 
126
if y0<h-cap_notch_cut: y0:=h-cap_notch_cut;
 
127
 fill z0+.5right{down}...{z4-z3}diag_end(3l,4l,1,1,4r,3r)
 
128
  --diag_end(4r,3r,1,1,2l,1l)--diag_end(2l,1l,1,1,1r,2r){z2-z1}
 
129
  ...{up}z0+.5left--cycle; % left and right diagonals
 
130
else: fill z0--diag_end(0,4l,1,1,4r,3r)--diag_end(4r,3r,1,1,2l,1l)
 
131
  --diag_end(2l,1l,1,1,1r,0)--cycle; fi % left and right diagonals
 
132
penpos5(whatever,angle(z2-z1)); z5=whatever[z1,z2];
 
133
penpos6(whatever,angle(z3-z4)); z6=whatever[z3,z4]; y6=y5;
 
134
if hefty: y5r else: y5 fi =5/12y0;
 
135
y5r-y5l=y6r-y6l=sc_band; penstroke z5e--z6e; % bar line
 
136
if serifs: numeric inner_jut; pickup tiny.nib;
 
137
 prime_points_inside(1,2); prime_points_inside(4,3);
 
138
 if rt x1'r+sc_jut+.5u+1<=lft x4'l-sc_jut: inner_jut=sc_jut;
 
139
 else: rt x1'r+inner_jut+.5u+1=lft x4'l-inner_jut; fi
 
140
 dish_serif(1',2,a,1/2,outer_jut,b,.6,inner_jut)(dark);  % left serif
 
141
 dish_serif(4',3,c,1/2,inner_jut,d,1/3,outer_jut); fi  % right serif
 
142
penlabels(0,1,2,3,4,5,6); endchar;
 
143
 
 
144
cmchar "Small capital B";
 
145
beginchar(oct"340",12.5u#,x_height#,0);
 
146
italcorr .75x_height#*slant-.5u#;
 
147
adjust_fit(cap_serif_fit#,0);
 
148
numeric left_stem,right_curve,middle_weight;
 
149
left_stem=sc_stem-hround 2stem_corr; middle_weight=.6vair+.5;
 
150
pickup tiny.nib; pos1(left_stem,0); pos2(left_stem,0);
 
151
lft x1l=lft x2l=hround max(2u,3u-.5left_stem); top y1=h; bot y2=0;
 
152
filldraw stroke z1e--z2e; % stem
 
153
penpos3(sc_band,90); penpos4(sc_band,90);
 
154
penpos6(middle_weight,-90); penpos7(middle_weight,-90);
 
155
penpos8(middle_weight,90); penpos9(middle_weight,90);
 
156
penpos5(right_curve-stem_corr,0); penpos10(right_curve,0);
 
157
penpos11(sc_band,-90); penpos12(sc_band,-90);
 
158
z3r=top z1; y4=y3; y5=.5[y4,y6]; y6=y7; y7l-y8l=vair;
 
159
z12r=bot z2; y11=y12; y10=.5[y11,y9]; y8=y9; .5[y7l,y8l]=.52h;
 
160
x4=x6; x9=x11=x4+.5u; x7=x8=x1; x9l:=x4+.25u;
 
161
x5r=hround(w-1.5u); x10r=hround(w-u);
 
162
if serifs: right_curve=sc_curve-stem_corr; x4=.5[x1,w-1.5u];
 
163
else: right_curve=sc_curve-3stem_corr; x4=.5[x1,w-2.5u];
 
164
 x4l:=x4l-.5u; x9l:=x9l-.5u; fi
 
165
x6l:=x6l-.5u; x11l:=x11l-.5u;
 
166
fill stroke z3e..super_arc.e(4,5) & super_arc.e(5,6)..z7e;  % upper lobe
 
167
fill stroke z8e..super_arc.e(9,10) & super_arc.e(10,11)..z12e;  % lower lobe
 
168
if serifs: nodish_serif(1,2,a,1/3,sc_jut,b,1/3,.5sc_jut);  % upper serif
 
169
 nodish_serif(2,1,c,1/3,sc_jut,d,1/3,.5sc_jut); fi  % lower serif
 
170
math_fit(0,.5ic#); penlabels(1,2,3,4,5,6,7,8,9,10,11,12); endchar;
 
171
 
 
172
cmchar "Small capital O-E ligature";
 
173
beginchar(oct"327",18u#,x_height#,0);
 
174
italcorr x_height#*slant-beak_jut#-.5u#;
 
175
adjust_fit(cap_serif_fit#,0);
 
176
numeric light_stem;
 
177
light_stem=max(tiny.breadth,hround .8[mfudged.hair,mfudged.sc_stem]);
 
178
pickup tiny.nib; pos1(light_stem,0); pos2(light_stem,0);
 
179
lft x1l=lft x2l=hround .5w; top y1=h; bot y2=0;
 
180
filldraw stroke z1e--z2e; % stem
 
181
pickup crisp.nib; pos3(slab,90); pos4(mfudged.hair,0);
 
182
top y3r=h; x3=x1; rt x4r=hround(w-u); y4=good.y(y3l-.8beak)-eps;
 
183
arm(3,4,e,beak_darkness,beak_jut);  % upper arm and beak
 
184
pos5(sc_bar,-90); pos6(mfudged.hair,0);
 
185
top y5l=vround(.52[y2,y1]+.5sc_bar); x5=x1;
 
186
pos0(sc_bar,90); pos7(mfudged.hair,0);
 
187
z0=z5; x6=x7; y6-y5l=y0l-y7;
 
188
if serifs and not(monospace and hefty): rt x6r=hround(w-3.4u+.5mfudged.hair);
 
189
 y6=good.y(y5l+.5beak)+eps; rt x9r=hround(w-.5u);
 
190
else: rt x6r=hround(w-1.5u); y6=y5l+eps; rt x9r=hround(w-.75u); fi
 
191
arm(5,6,f,beak_darkness,0); arm(0,7,g,beak_darkness,0);  % middle arm and serif
 
192
pos8(slab if not serifs:+2stem_corr fi,-90);
 
193
pos9(mfudged.hair,0); bot y8r=0; x8=x2; y9=good.y(y8l+.9beak)+eps;
 
194
arm(8,9,h,beak_darkness,1.5beak_jut);  % lower arm and beak
 
195
penpos11(vair,90); penpos13(vair,-90);
 
196
if monospace: penpos12(fudged.sc_stem,180);
 
197
 interim superness:=sqrt superness;  % make |"O"|, not |"0"|
 
198
else: penpos12(hround(sc_curve-stem_corr),180); fi
 
199
x11=x13=.5w-2u; y11r=h+o; y13r=-o; y12=.5h-vair_corr; x12r=hround u;
 
200
x14=x15=.5w; y14=2/3h; y15=1/3h; y12l:=.52h;
 
201
penstroke super_arc.e(11,12) & super_arc.e(12,13);  % left half of bowl
 
202
fill z13r{right}..{right}(x2,0)--(x1,h){left}..{left}z11r
 
203
 --z11l{right}...{z14-z11l}(.82[x11l,x14],.82[y14,y11l])
 
204
 ...z14---z15...{z13l-z15}(.82[x13l,x15],.82[y15,y13l])
 
205
 ...{left}z13l--cycle;  % right half of bowl
 
206
if serifs: serif(1,2,a,1/3,.5sc_jut);  % upper serif
 
207
 serif(2,1,b,1/3,.5sc_jut); fi  % lower serif
 
208
penlabels(0,1,2,3,4,5,6,7,8,9,11,12,13,14,15); endchar;
 
209
 
 
210
cmchar "Small capital G";
 
211
if serifs: beginchar(oct"345",14u#,x_height#,0);
 
212
 italcorr x_height#*slant-1.5u#-.5cap_serif_fit#;
 
213
 adjust_fit(0,.5cap_serif_fit#);
 
214
 pickup tiny.nib; pos0(sc_stem,0); pos7(sc_stem,0);
 
215
 rt x0r=hround(w-2u); y0=good.y(.1[.632bar_height,.626x_height]+1); x7=x0;
 
216
 pickup fine.nib;
 
217
 if hefty: bot y7=0; pos5(sc_stem,0); x5=x0; top y5=tiny.top y0;
 
218
 else: pos5(sc_hair,0); pos8(sc_stem,0);
 
219
  y7=.316bar_height; z5l=z8l; z8=z7; x9=x8r; bot y9=0;
 
220
  filldraw z8l{down}..{4(x9-x8),y9-y8}z9--z8r--cycle; fi % spur
 
221
 pos1(sc_hair,0); pos2(sc_band,90);
 
222
 pos3(sc_curve,180); pos4(sc_band,270);
 
223
 rt x1r=hround(w-2u); lft x3r=hround u; x2=x4=.55[x3,x1];
 
224
 top y2r=h+o; bot y4r=-o; y3=.5[y2,y4];
 
225
 bot y1=min(vround max(.6h,.626x_height-.5vair),bot y2l-eps);
 
226
 (x2l',y2l)=whatever[z2r,z1l]; x2l:=min(x2l',x2l+.5u);
 
227
 (x4l',y4l)=whatever[z4r,z5l]; x4l:=min(x4l',x4l+.5u);
 
228
 filldraw stroke z1e{x2-x1,10(y2-y1)}
 
229
  ...pulled_arc.e(2,3) & pulled_arc.e(3,4)...z5e{up}; % arc
 
230
 pos6(.3[fine.breadth,sc_hair],0); x6r=x1r; top y6=h+o;
 
231
 x1r-x1'=2sc_curve-fine; y1'=y1;
 
232
 path upper_arc; upper_arc=z1{x2-x1,10(y2-y1)}..z2{left};
 
233
 numeric t; t=xpart(upper_arc intersectiontimes (z6l--z1'));
 
234
 filldraw z1r--z6r--z6l--subpath(t,0) of upper_arc--cycle; % barb
 
235
 pickup tiny.nib; filldraw stroke z0e--z7e;  % stem
 
236
 dish_serif(0,7,a,1/3,max(sc_jut,2.25u),b,1/3,1.25u);  % serif
 
237
 math_fit(-.3x_height#*slant-.5u#,ic#);
 
238
else: beginchar(oct"345",12u#,x_height#,0);
 
239
 italcorr x_height#*slant-.5u#;
 
240
 adjust_fit(0,0);
 
241
 pickup fine.nib; pos1(1.2flare,80); pos2(slab,90);
 
242
 pos3(sc_curve,180); pos4(slab,270); pos5(flare,270);
 
243
 rt x1r=hround(w-1.35u); x2=x4=.5w+u;
 
244
 lft x3r=hround max(u,2u-.5sc_curve); rt x5l=hround(w-1.2u);
 
245
 top y1r=vround .93h+o; top y2r=h+o; y3=.5h;
 
246
 bot y4r=-o; bot y5r=vround .07h-o;
 
247
 filldraw stroke rterm.e(2,1,right,.9,4)&super_arc.e(2,3)
 
248
  & super_arc.e(3,4) & term.e(4,5,right,1,4); % arc and terminals
 
249
 pos0(stem,0); pos7(stem,0);
 
250
 z7r=z5r; x0=x7; top y0=1+vround .35[.632bar_height,.626x_height];
 
251
 filldraw stroke z0e--z7e;  % stem
 
252
 pos8(sc_bar,90); pos9(sc_bar,90);
 
253
 z0r=z9r; y8=y9; lft x8=hround x4;
 
254
 filldraw stroke z8e--z9e;  % bar
 
255
 math_fit(-.3x_height#*slant-.5u#,.5ic#); fi
 
256
penlabels(0,1,1',2,3,4,5,6,7,8,9); endchar;
 
257
 
 
258
cmchar "Small capital N";
 
259
beginchar(oct"360",13u#+width_adj#,x_height#,0);
 
260
italcorr x_height#*slant-cap_serif_fit#+sc_jut#-2.5u#+min(.5sc_stem#,u#);
 
261
adjust_fit(cap_serif_fit#,cap_serif_fit#);
 
262
numeric thin_stem; thin_stem=hround(fudged.hair+stem_corr);
 
263
pickup tiny.nib; pos1(thin_stem,0); pos2(thin_stem,0);
 
264
pos3(thin_stem,0); pos4(thin_stem,0);
 
265
pickup tiny.nib; top y1=top y3=h; bot y2=bot y4=0;
 
266
x1=x2; x3=x4; x1l=w-x3r;
 
267
rt x3r=hround min(w-2u,w-3u+.5fudged.sc_stem);
 
268
filldraw stroke z1e--z2e; % left stem
 
269
filldraw stroke z3e--z4e; % right stem
 
270
if hefty: penpos5(fudged.sc_stem,0); penpos6(fudged.sc_stem,0);
 
271
 x5l=x1; x6r=x4; y5=h; y6=0;
 
272
 numeric upper_notch,lower_notch;
 
273
 upper_notch=h-cap_notch_cut; lower_notch=cap_notch_cut;
 
274
 x1'=rt x1r; z1'=whatever[z5l,z6l]; x4'=lft x4l; z4'=whatever[z5r,z6r];
 
275
 fill z5l..
 
276
  if y1'<upper_notch: {right}(x1'+1,upper_notch){down}... fi
 
277
  {z6-z5}diag_in(5l,6l,1,6r)--z6r..
 
278
  if y4'>lower_notch: {left}(x4'-1,lower_notch){up}... fi
 
279
  {z5-z6}diag_in(6r,5r,1,5l)--cycle;  % diagonal
 
280
else: penpos5(whatever,0); penpos6(whatever,90);
 
281
 z5l=z1l; z6l=z4l;
 
282
 z7=z6l+(max(eps,sc_stem-3stem_corr-tiny),0) rotated (angle(z5l-z6l)-90);
 
283
 z5r=z7+whatever*(z5l-z6l); z6r=z7+whatever*(z5l-z6l);
 
284
 filldraw stroke z5e..z6e; fi  % diagonal
 
285
if serifs: if hefty: serif(1,2,a,1/3,-sc_jut); % upper left serif
 
286
 else: serif(5,6,a,1/3,-sc_jut); fi  % upper left serif
 
287
 dish_serif(2,1,b,1/2,sc_jut,c,1/2,sc_jut)(dark); % lower left serif
 
288
 dish_serif(3,4,e,1/2,sc_jut,f,1/2,sc_jut)(dark); fi  % upper right serif
 
289
math_fit(0,max(.5ic#-.5u#,0)); penlabels(1,1',2,3,4,4',5,6,7); endchar;
 
290
 
 
291
cmchar "Small capital R";
 
292
beginchar(oct"366",if serifs: 12u#+.5max(2u#,sc_curve#)
 
293
 else:12.5u#-.5width_adj# fi,x_height#,0);
 
294
italcorr .75x_height#*slant- if serifs: 1.75 else: .5 fi\\ u#;
 
295
adjust_fit(cap_serif_fit#,0);
 
296
pickup tiny.nib; pos1(sc_stem',0); pos2(sc_stem',0);
 
297
lft x1l=lft x2l=hround max(2u,3u-.5sc_stem'); top y1=h; bot y2=0;
 
298
filldraw stroke z1e--z2e; % stem
 
299
penpos3(sc_band,90); penpos4(sc_band,90);
 
300
penpos5(sc_curve if hefty:-3stem_corr fi,0);
 
301
penpos6(vair,-90); penpos7(vair,-90);
 
302
z3r=top z1; y4=y3; y5=.5[y4l,y6l]; y6=y7;
 
303
x7=x2; y7l=vround(.5h+.5vair); x4=x6;
 
304
if serifs: x4=.5w-.5u; x5r=hround(w-2.25u);
 
305
else: x4=.5w+.5u; x5r=hround(w-u); fi
 
306
x4l:=x6l:=x4-.125sc_curve;
 
307
fill stroke z3e..pulled_arc.e(4,5) & pulled_arc.e(5,6)..z7e;  % lobe
 
308
if serifs: pos6'(vair,-90); pos0(sc_stem,180);
 
309
 pos8(sc_curve,180); pos9(vair,-90); pos10(hair,0);
 
310
 z6'=z6; lft x0r=lft x8r=hround(x5-2/3u-.5sc_curve);
 
311
 y8=1/3[y2,y7]; y0=3/5[y2,y7]; x9=.5[x8l,x10r];
 
312
 bot y9r=-o; rt x10r=hround(w-.05u); y10=1/4[y2,y7];
 
313
 filldraw stroke z6'e{right}..z0e---z8e....z9e{right}..z10e{up};  % tail
 
314
 nodish_serif(1,2,a,1/3,sc_jut,b,1/3,.5sc_jut);  % upper serif
 
315
 dish_serif(2,1,c,1/3,sc_jut,d,1/3,sc_jut);  % lower serif
 
316
else: penpos8(sc_stem-2stem_corr,0); penpos9(sc_stem,0);
 
317
 x8=x6+.5u; y8=y6; x9r=hround(w-.5u); y9=0;
 
318
 fill z8l--diag_end(8l,9l,.5,1,9r,8r)--z8r--cycle; fi  % tail
 
319
math_fit(0,.75ic#); penlabels(0,1,2,3,4,5,6,7,8,9,10); endchar;
 
320
 
 
321
cmchar "Hooktop small capital G";
 
322
if serifs: beginchar(oct"311",14u#,x_height#,0);
 
323
 italcorr .9asc_height#*slant-.5cap_serif_fit#+2u#;
 
324
 adjust_fit(0,.5cap_serif_fit#+.5u#);
 
325
 pickup tiny.nib; pos0(sc_stem,0); pos7(sc_stem,0);
 
326
 rt x0r=hround(w-2u); y0=good.y(.1[.632bar_height,.626x_height]+1); x7=x0;
 
327
 pickup fine.nib;
 
328
 if hefty: bot y7=0; pos5(sc_stem,0); x5=x0; top y5=tiny.top y0;
 
329
 else: pos5(sc_hair,0); pos8(sc_stem,0);
 
330
  y7=.316bar_height; z5l=z8l; z8=z7; x9=x8r; bot y9=0;
 
331
  filldraw z8l{down}..{4(x9-x8),y9-y8}z9--z8r--cycle; fi % spur
 
332
 pos1(sc_hair,0); pos2(sc_band,90);
 
333
 pos3(sc_curve,180); pos4(sc_band,270);
 
334
 rt x1r=hround(w-2u); lft x3r=hround u; x2=x4=.55[x3,x1];
 
335
 top y2r=h+o; bot y4r=-o; y3=.5[y2,y4];
 
336
 bot y1=min(vround max(.6h,.626x_height-.5vair),bot y2l-eps);
 
337
 (x2l',y2l)=whatever[z2r,z1l]; x2l:=min(x2l',x2l+.5u);
 
338
 (x4l',y4l)=whatever[z4r,z5l]; x4l:=min(x4l',x4l+.5u);
 
339
 filldraw stroke z1e{x2-x1,10(y2-y1)}
 
340
  ...pulled_arc.e(2,3) & pulled_arc.e(3,4)...z5e{up}; % arc
 
341
 pos6(.3[fine.breadth,sc_hair],0); x6r=x1r; top y6=h+o;
 
342
 x1r-x1'=2sc_curve-fine; y1'=y1;
 
343
 path upper_arc; upper_arc=z1{x2-x1,10(y2-y1)}..z2{left};
 
344
 numeric t; t=xpart(upper_arc intersectiontimes (z6l--z1'));
 
345
 filldraw z1r--z6r--z6l--subpath(t,0) of upper_arc--cycle; % barb
 
346
 pickup tiny.nib; filldraw stroke z0e--z7e;  % stem
 
347
 dish_serif(0,7,a,1/3,max(sc_jut,2.25u),b,1/3,1.25u);  % serif
 
348
 math_fit(-.3x_height#*slant-.5u#,ic#);
 
349
 pos10(hair,0); y10=y1; rt x10r=rt x1r;
 
350
 hooktop(10,11,12,13,hair,hround(w+2.5u),.9asc_height+.5vair,.9,.55,.6);
 
351
else: beginchar(oct"311",12u#,x_height#,0);
 
352
 italcorr x_height#*slant-.5u#+2u#;
 
353
 adjust_fit(0,.5u#);
 
354
 pickup fine.nib; pos1(1.2flare,30); pos2(slab,90);
 
355
 pos3(sc_curve,180); pos4(slab,270); pos5(flare,270);
 
356
 rt x1r=hround(w-1.2u); x2=x4=.5w+u;
 
357
 lft x3r=hround max(u,2u-.5sc_curve); rt x5l=hround(w-1.2u);
 
358
 top y1r=vround .83h+o; top y2r=h+o; y3=.5h;
 
359
 bot y4r=-o; bot y5r=vround .07h-o;
 
360
 filldraw stroke rterm.e(2,1,right,.9,4)&super_arc.e(2,3)
 
361
  & super_arc.e(3,4) & term.e(4,5,right,1,4); % arc and terminals
 
362
 pos0(stem,0); pos7(stem,0);
 
363
 z7r=z5r; x0=x7; top y0=1+vround .35[.632bar_height,.626x_height];
 
364
 filldraw stroke z0e--z7e;  % stem
 
365
 pos8(sc_bar,90); pos9(sc_bar,90);
 
366
 z0r=z9r; y8=y9; lft x8=hround x4;
 
367
 filldraw stroke z8e--z9e;  % bar
 
368
 math_fit(-.3x_height#*slant-.5u#,.5ic#);
 
369
 pos10(vair,0); y10=y1r; rt x10r=rt x1r;
 
370
 hooktop(10,11,12,13,vair,hround(w+2.5u),.9asc_height+.5vair,.9,.5,.5); fi
 
371
penlabels(0,1,1',2,3,4,5,6,7,8,9,10,11,12,13); endchar;
 
372
 
 
373
cmchar "Small capital H";
 
374
beginchar(oct"313",13u#+width_adj#,x_height#,0);
 
375
italcorr x_height#*slant-cap_serif_fit#+sc_jut#-2.5u#+min(.5sc_stem#,u#);
 
376
adjust_fit(cap_serif_fit#,cap_serif_fit#);
 
377
pickup tiny.nib; pos1(sc_stem,0); pos2(sc_stem,0);
 
378
pos3(sc_stem,0); pos4(sc_stem,0);
 
379
lft x1l=lft x2l=hround max(2u,3u-.5sc_stem); x3=x4=w-x1;
 
380
top y1=top y3=h; bot y2=bot y4=0;
 
381
filldraw stroke z1e--z2e; % left stem
 
382
filldraw stroke z3e--z4e; % right stem
 
383
penpos5(sc_bar,90); penpos6(sc_bar,90);
 
384
x5=x1; x6=x3; y5=y6=.52h;
 
385
fill stroke z5e--z6e;  % bar
 
386
if serifs: numeric inner_jut;
 
387
 if rt x1r+sc_jut+.5u+1<=lft x3l-sc_jut: inner_jut=sc_jut;
 
388
 else: rt x1r+inner_jut+.5u+1=lft x3l-inner_jut; fi
 
389
 dish_serif(1,2,a,1/3,sc_jut,b,1/3,inner_jut);  % upper left serif
 
390
 dish_serif(2,1,c,1/3,sc_jut,d,1/3,inner_jut); % lower left serif
 
391
 dish_serif(3,4,e,1/3,inner_jut,f,1/3,sc_jut);  % upper left serif
 
392
 dish_serif(4,3,g,1/3,inner_jut,h,1/3,sc_jut); fi  % lower left serif
 
393
math_fit(0,.5ic#); penlabels(1,2,3,4,5,6); endchar;
 
394
 
 
395
cmchar "Small capital L";
 
396
beginchar(oct"317",11u#-width_adj#,x_height#,0);
 
397
adjust_fit(cap_serif_fit#,0);
 
398
pickup tiny.nib; pos1(sc_stem,0); pos2(sc_stem,0);
 
399
lft x1l=lft x2l=hround max(2u,3u-.5sc_stem); top y1=h; bot y2=0;
 
400
filldraw stroke z1e--z2e; % stem
 
401
pickup crisp.nib; pos3(slab,-90); pos4(hair,0);
 
402
bot y3r=0; x3=x2; y4=y3l+beak+eps; rt x4r=hround(w-.75u);
 
403
arm(3,4,e,1.2beak_darkness,beak_jut);  % lower arm and beak
 
404
if serifs: dish_serif(1,2,a,1/3,sc_jut,b,1/3,1.25sc_jut);  % upper serif
 
405
 nodish_serif(2,1,c,1/3,sc_jut,d,1/3,.5sc_jut); fi  % lower serif
 
406
math_fit(0,u#); penlabels(1,2,3,4); endchar;
 
407
 
 
408
cmchar "Small capital U";
 
409
beginchar(oct"332",13u#+.5width_adj#,x_height#,0);
 
410
italcorr x_height#*slant-cap_serif_fit#+sc_jut#-2.5u#+min(.5sc_stem#,u#);
 
411
if monospace: adjust_fit(cap_serif_fit#-.5u#,cap_serif_fit#-.5u#)
 
412
else: adjust_fit(cap_serif_fit#,cap_serif_fit#) fi;
 
413
pickup tiny.nib; pos1(sc_stem,0); pos2(sc_stem,0);
 
414
pos2'(sc_stem,180); z2'=z2;
 
415
pos3(sc_band,-90);
 
416
pos4(sc_hair,0); pos5(sc_hair,0);
 
417
x1=x2; x3=.5[x1,x5]; x4=x5; x1l=w-x5r;
 
418
top y1=top y5=h; y2=y4=1/3h; bot y3r=-o;
 
419
lft x1l=hround max(2u,3u-.5sc_stem);
 
420
filldraw stroke z1e--z2e; % left stem
 
421
filldraw stroke pulled_arc.e(2',3)
 
422
 & pulled_arc.e(3,4)&z4e--z5e; % arc and right stem
 
423
if serifs: dish_serif(1,2,a,1/3,sc_jut,b,1/3,sc_jut); % left serif
 
424
 dish_serif(5,4,c,1/2,sc_jut,d,1/2,sc_jut)(dark); fi  % right serif
 
425
math_fit(-cap_serif_fit#-.3x_height#*slant-min(x_height#*slant,u#),
 
426
 max(.5ic#-.5u#,0)); penlabels(1,2,3,4,5); endchar;
 
427
 
 
428
cmchar "Small capital E";
 
429
beginchar(oct"244",12u#-width_adj#,x_height#,0);
 
430
italcorr x_height#*slant-beak_jut#-.5u#;
 
431
adjust_fit(cap_serif_fit#,0);
 
432
pickup tiny.nib; pos1(sc_stem,0); pos2(sc_stem,0);
 
433
lft x1l=lft x2l=hround max(2u,3u-.5sc_stem); top y1=h; bot y2=0;
 
434
filldraw stroke z1e--z2e; % stem
 
435
pickup crisp.nib; pos3(slab,90); pos4(hair,0);
 
436
top y3r=h; x3=x1; rt x4r=hround(w-u); y4=good.y(y3l-.8beak)-eps;
 
437
arm(3,4,e,beak_darkness,beak_jut);  % upper arm and beak
 
438
pos5(sc_bar,-90); pos6(hair,0);
 
439
top y5l=vround(.52[y2,y1]+.5sc_bar); x5=x1;
 
440
pos0(sc_bar,90); pos7(hair,0);
 
441
z0=z5; x6=x7; y6-y5l=y0l-y7;
 
442
if serifs: rt x6r=hround(w-4.4u+.5hair); y6=good.y(y5l+.5beak)+eps;
 
443
 rt x9r=hround(w-.5u);
 
444
else: rt x6r=hround(w-1.5u); y6=y5l+eps; rt x9r=hround(w-.75u); fi
 
445
arm(5,6,f,beak_darkness,0); arm(0,7,g,beak_darkness,0);  % middle arm and serif
 
446
pos8(slab if not serifs:+2stem_corr fi,-90); pos9(hair,0);
 
447
bot y8r=0; x8=x2; y9=good.y(y8l+.9beak)+eps;
 
448
arm(8,9,h,beak_darkness,1.5beak_jut);  % lower arm and beak
 
449
if serifs: nodish_serif(1,2,a,1/3,sc_jut,b,1/3,.5sc_jut);  % upper serif
 
450
 nodish_serif(2,1,c,1/3,sc_jut,d,1/3,.5sc_jut); fi  % lower serif
 
451
math_fit(0,.5ic#); penlabels(0,1,2,3,4,5,6,7,8,9); endchar;
 
452
 
 
453
cmchar "Small capital J";
 
454
beginchar(oct"250",9u#,x_height#,0);
 
455
italcorr x_height#*slant-cap_serif_fit#
 
456
 +.75sc_jut#-2.5u#+min(.5sc_stem#,u#);
 
457
adjust_fit(0,cap_serif_fit#);
 
458
pickup tiny.nib; pos1(sc_stem',0); pos2(sc_stem',0);
 
459
top y1=h; rt x1r=hround(w-2u); x2=x1; y2=.21h;
 
460
if serifs: pos3(vair,-90); pos4(sc_hair,-180);
 
461
 pos5(flare+(sc_stem-stem),-180);
 
462
 bot y3r=-o; x3=.5[x4,x2]; y5=1/6h; rt x5l=hround 2.75u; z5r=z4r;
 
463
 filldraw stroke z1e--z2e&super_arc.e(2,3);  % stem and arc
 
464
 dish_serif(1,2,a,1/3,1.3sc_jut,b,1/3,.75sc_jut);  % serif
 
465
 pickup tiny.nib; bulb(3,4,5);  % bulb
 
466
else: filldraw stroke z1e--z2e;  % stem
 
467
 pickup fine.nib; pos3(sc_stem',0); z3=z2;
 
468
 pos4(flare,angle(6.5u,-h)); pos5(1.1flare,-100);
 
469
 bot y4r=-o; x4r=.5[x5r,x3r]; lft x5r=hround.75u; bot y5r=vround.06h-o;
 
470
 filldraw stroke z3e{down}....term.e(4,5,left,1,4); fi % arc and terminal
 
471
math_fit(0,.5ic#-.5u#); penlabels(1,2,3,4,5); endchar;
 
472
 
 
473
cmchar "Small capital omega";
 
474
beginchar(oct"261",13u#,x_height#,0);
 
475
italcorr .75x_height#*slant-.5u#;
 
476
adjust_fit(0,0);
 
477
pickup tiny.nib; pos1(vair,90); pos2(sc_curve,180);
 
478
pos3(vair,180); pos4(sc_curve,0); pos5(vair,0);
 
479
x1=.5w; top y1r=h+o; lft x2r=hround u; y2=y4=2/3h; x4=w-x2;
 
480
rt x3l=hround(1/3(w+.5u)+.5hair); bot y3=bot y5=0; x5=w-x3;
 
481
filldraw stroke z3e{up}...{up}z2e
 
482
 & pulled_super_arc.e(2,1)(.5superpull)
 
483
 & pulled_super_arc.e(1,4)(.5superpull)
 
484
 & z4e{down}...{down}z5e;  % bowl
 
485
numeric arm_thickness; path p; p=z3{up}...{up}z2;
 
486
arm_thickness=Vround(if hefty:slab+2stem_corr else:.75[slab,cap_vstem] fi);
 
487
pickup crisp.nib; pos6(arm_thickness,-90); pos7(fudged.hair,-180);
 
488
bot y6r=0; x6=x3; lft x7r=hround .8u; y7=good.y(y6l+.5beak)+eps;
 
489
(x,y)=p intersectionpoint((0,y6l)--(w,y6l)); x6l:=x;
 
490
arm(6,7,a,.5beak_darkness,-1.2beak_jut);  % left arm and beak
 
491
pos8(arm_thickness,-90); pos9(fudged.hair,0);
 
492
y8=y6; y9=y7; x8+x6=x9+x7=w; x8l:=w-x6l;
 
493
arm(8,9,b,.5beak_darkness,1.2beak_jut);  % right arm and beak
 
494
math_fit(0,.5ic#); penlabels(1,2,3,4,5,6,7,8,9); endchar;
 
495
 
 
496
% end of tipasc.mf