1
% tipatone.mf: TIPA symbols for tone letters and other suprasegmentals
2
% Copyright 1996-2003 FUKUI Rei
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.
12
% This program consists of all files listed in Manifest.txt.
14
% Version 1.2 2003/01/01
17
def tone_bar(suffix $, $$)(expr start_y, end_y) =
18
adjust_fit(0,0); pickup if serifs: rule.nib; else: hair_rule.nib; fi
19
x$ = 0; x$$ = w; % lft, rt are not used for adjusting tone letters.
20
y$ = start_y; y$$ = end_y; % same thing for not using top, bot.
22
penlabels($,$$); enddef;
24
def long_width = 6u enddef;
25
def short_width = 4u enddef;
30
cmchar "Tone letter: long level tone";
31
beginchar(incr ipacode,long_width#,0,0);
32
tone_bar(1,2,0,0); endchar;
34
cmchar "Tone letter: long falling tone (1)";
35
beginchar(incr ipacode,long_width#,1/4asc_height#,0);
36
tone_bar(1,2,h,0); endchar;
38
cmchar "Tone letter: long falling tone (2)";
39
beginchar(incr ipacode,long_width#,2/4asc_height#,0);
40
tone_bar(1,2,h,0); endchar;
42
cmchar "Tone letter: long falling tone (3)";
43
beginchar(incr ipacode,long_width#,3/4asc_height#,0);
44
tone_bar(1,2,h,0); endchar;
46
cmchar "Tone letter: long falling tone (4)";
47
beginchar(incr ipacode,long_width#,asc_height#,0);
48
tone_bar(1,2,h,0); endchar;
50
cmchar "Tone letter: long rising tone (1)";
51
beginchar(incr ipacode,long_width#,1/4asc_height#,0);
52
tone_bar(1,2,0,h); endchar;
54
cmchar "Tone letter: long rising tone (2)";
55
beginchar(incr ipacode,long_width#,2/4asc_height#,0);
56
tone_bar(1,2,0,h); endchar;
58
cmchar "Tone letter: long rising tone (3)";
59
beginchar(incr ipacode,long_width#,3/4asc_height#,0);
60
tone_bar(1,2,0,h); endchar;
62
cmchar "Tone letter: long rising tone (4)";
63
beginchar(incr ipacode,long_width#,asc_height#,0);
64
tone_bar(1,2,0,h); endchar;
66
cmchar "Tone letter: short level tone";
67
beginchar(incr ipacode,short_width#,0,0);
68
tone_bar(1,2,0,0); endchar;
70
cmchar "Tone letter: short falling tone (1)";
71
beginchar(incr ipacode,short_width#,1/4asc_height#,0);
72
tone_bar(1,2,h,0); endchar;
74
cmchar "Tone letter: short falling tone (2)";
75
beginchar(incr ipacode,short_width#,2/4asc_height#,0);
76
tone_bar(1,2,h,0); endchar;
78
cmchar "Tone letter: short falling tone (3)";
79
beginchar(incr ipacode,short_width#,3/4asc_height#,0);
80
tone_bar(1,2,h,0); endchar;
82
cmchar "Tone letter: short falling tone (4)";
83
beginchar(incr ipacode,short_width#,asc_height#,0);
84
tone_bar(1,2,h,0); endchar;
86
cmchar "Tone letter: short rising tone (1)";
87
beginchar(incr ipacode,short_width#,1/4asc_height#,0);
88
tone_bar(1,2,0,h); endchar;
90
cmchar "Tone letter: short rising tone (2)";
91
beginchar(incr ipacode,short_width#,2/4asc_height#,0);
92
tone_bar(1,2,0,h); endchar;
94
cmchar "Tone letter: short rising tone (3)";
95
beginchar(incr ipacode,short_width#,3/4asc_height#,0);
96
tone_bar(1,2,0,h); endchar;
98
cmchar "Tone letter: short rising tone (4)";
99
beginchar(incr ipacode,short_width#,asc_height#,0);
100
tone_bar(1,2,0,h); endchar;
102
cmchar "Vertical line (minor group)";
103
beginchar(incr ipacode,CT(5u#,5.56u#),body_height#,paren_depth#);
104
italcorr body_height#*slant+.5rule_thickness#-2u#;
106
numeric thickness; thickness=hround.6[hair,stem];
107
pickup tiny.nib; pos1(thickness,0); pos2(thickness,0);
108
lft x1l = lft x2l = hround(.5w-.5thickness);
109
top y1=h+eps; bot y2=-d-eps;
110
filldraw stroke z1e--z2e;
111
penlabels(1,2); endchar;
113
cmchar "Double vertical line (Major group)";
114
beginchar(incr ipacode,CT(9u#,10u#),body_height#,paren_depth#);
115
italcorr body_height#*slant+.5rule_thickness#-2u#;
117
numeric thickness; thickness=hround(.6[hair,stem]-2stem_corr);
118
pickup tiny.nib; pos1(thickness,0); pos2(thickness,0);
119
pos3(thickness,0); pos4(thickness,0);
120
x1=x2; x3=x4=w-x1; lft x1l = hround((w-3.5u-thickness)/2);
121
top y1=top y3=h+eps; bot y2=bot y4=-d-eps;
122
filldraw stroke z1e--z2e; filldraw stroke z3e--z4e;
123
penlabels(1,2,3,4); endchar;
125
cmchar "Down arrow (Downstep)";
126
beginchar(incr ipacode,8u#,body_height#,0);
127
italcorr .76body_height#*slant+.5crisp#-u#;
128
adjust_fit(0,0); pickup crisp.nib;
129
pos1(rule_thickness,0); pos2(rule_thickness,0);
130
pos3(rule_thickness,90); pos4(rule_thickness,90);
131
lft x1l=hround(.5w-.5rule_thickness); y1+.5rule_thickness=h;
132
x0=x1=x2; bot y0=bar_height; x0-x3=x4-x0=if monospace:2.5u else:2.5u fi+eps;
133
y3=y4=y0+if monospace:.24 else:.27 fi asc_height+eps;
134
pos5(rule_thickness,angle(z4-z0)); z5l=z0;
135
pos6(rule_thickness,angle(z3-z0)); z6l=z0;
137
numeric t; path p; p=z4r{z9-z4}..z6r;
138
t=xpart(p intersectiontimes((x2r,-d)--(x2r,h))); y2=ypart point t of p;
139
filldraw z0..{z4-z9}z4l--subpath (0,t) of\\(z4r{z9-z4}..z6r)
140
--z2r---z1r..z1l---z2l--subpath (t,0) of\\(z3r{z9-z3}..z5r)
141
--z3l{z9-z3}..z0 & cycle; % arrowhead and stem
142
penlabels(0,1,2,3,4,5,6,9); endchar;
144
cmchar "Up arrow (Upstep)";
145
beginchar(incr ipacode,8u#,body_height#,0);
146
italcorr .76body_height#*slant+.5crisp#-u#;
147
adjust_fit(0,0); pickup crisp.nib;
148
pos1(rule_thickness,0); pos2(rule_thickness,0);
149
pos3(rule_thickness,90); pos4(rule_thickness,90);
150
lft x1l=hround(.5w-.5rule_thickness); y1-.5rule_thickness=bar_height;
151
x0=x1=x2; top y0=h; x0-x3=x4-x0=if monospace:2.5u else:2.5u fi+eps;
152
y3=y4=y0-if monospace:.24 else:.27 fi asc_height-eps;
153
pos5(rule_thickness,angle(z4-z0)); z5l=z0;
154
pos6(rule_thickness,angle(z3-z0)); z6l=z0;
156
numeric t; path p; p=z4l{z9-z4}..z6r;
157
t=xpart(p intersectiontimes((x2r,-d)--(x2r,h))); y2=ypart point t of p;
158
filldraw z0..{z4-z9}z4r--subpath (0,t) of\\(z4l{z9-z4}..z6r)
159
--z2r---z1r..z1l---z2l--subpath (t,0) of\\(z3l{z9-z3}..z5r)
160
--z3r{z9-z3}..z0 & cycle; % arrowhead and stem
161
penlabels(0,1,2,3,4,5,6,9); endchar;
163
cmchar "Northeast arrow (Global rise)";
164
beginchar(incr ipacode,14u#,asc_height#,0);
165
adjust_fit(0,0); pickup crisp.nib;
166
x1-.5rule_thickness=hround u; rt x0=hround(w-u);
167
y1-.5rule_thickness=-d; top y0=h;
168
numeric theta; theta=angle(z0-z1);
169
pos1(rule_thickness,90+theta); pos2(rule_thickness,90+theta);
170
pos3(rule_thickness,theta); pos4(rule_thickness,theta);
171
z3-z0=(-3u,.27asc_height) rotated theta;
172
z4-z0=(-3u,-.27asc_height) rotated theta;
173
pos5(rule_thickness,-90); z5l=z0; pos6(rule_thickness,-180); z6l=z0;
175
numeric t; path p; p=z4l{z9-z4}..z6r;
176
t=xpart(p intersectiontimes (z1l--(z1l+2(z0-z1)))); z2l=point t of p;
177
filldraw z0..{z4-z9}z4r--subpath (0,t) of\\(z4l{z9-z4}..z6r)
178
--z2l---z1l..z1r---z2r--subpath (t,0) of\\(z3l{z9-z3}..z5r)
179
--z3r{z9-z3}..z0 & cycle; % arrowhead and stem
180
penlabels(0,1,2,3,4,5,6,9); endchar;
182
cmchar "Southeast arrow (global fall)";
183
beginchar(incr ipacode,14u#,asc_height#,0);
184
adjust_fit(0,0); pickup crisp.nib;
185
x1-.5rule_thickness=hround u; rt x0=hround(w-u);
186
y1+.5rule_thickness=h; bot y0=-d;
187
numeric theta; theta=angle(z0-z1);
188
pos1(rule_thickness,90+theta); pos2(rule_thickness,90+theta);
189
pos3(rule_thickness,theta); pos4(rule_thickness,theta);
190
z3-z0=(-3u,.27asc_height) rotated theta;
191
z4-z0=(-3u,-.27asc_height) rotated theta;
192
pos5(rule_thickness,180); z5l=z0; pos6(rule_thickness,90); z6l=z0;
194
numeric t; path p; p=z4l{z9-z4}..z6r;
195
t=xpart(p intersectiontimes (z1l--(z1l+2(z0-z1)))); z2l=point t of p;
196
filldraw z0..{z4-z9}z4r
197
--subpath (0,t) of\\(z4l{z9-z4}..z6r)
198
--z2l---z1l..z1r---z2r
199
--subpath (t,0) of\\(z3l{z9-z3}..z5r)
200
--z3r{z9-z3}..z0 & cycle; % arrowhead and stem
201
penlabels(0,1,2,3,4,5,6,9); endchar;
203
cmchar "Mid acute accent";
204
beginchar(oct"230",9u#,min(asc_height#,2x_height#),0);
205
italcorr h#*slant-u#;
206
adjust_fit(0,0); pickup tiny.nib;
207
numeric accent.stem, accent.hair;
208
accent.stem = max(.8stem,hair);
209
accent.hair = max(.6stem,hair);
210
y1 = y2; x1 = hround(1.5u+.5accent.stem); x2 = x4;
211
pos1(accent.hair,-90); pos2(accent.hair,-90);
212
if serifs: pickup tiny.nib;
213
x3+.5accent.stem=hround(w-1.5u); x3-x4=1.8u; y2 = y4;
214
y3+.5accent.stem=h; top y4'l=vround(.4[x_height,asc_height])+o;
215
y4=y4'; pos4'(accent.hair,-90);
216
numeric theta; theta=angle(z4-z3)+90;
217
pos3(accent.stem,theta); pos4(accent.hair,theta);
218
filldraw stroke z1e--z2e; % bar
219
filldraw circ_stroke z3e--z4e; % right diagonal
220
else: pickup fine.nib;
221
pos3(stem,0); pos4(accent.hair,0); bot y2r = bot y4;
222
rt x3r=hround(w-1.5u); rt x4r=hround(rt x3r-1.8u);
223
top y3=h; top y2l=vround(.4[x_height,asc_height])+o;
224
filldraw stroke z1e--z2e; % bar
225
filldraw stroke z3e--z4e; fi % right diagonal
226
penlabels(1,2,3,4); endchar;
228
cmchar "Grave mid accent";
229
beginchar(oct"231",9u#,min(asc_height#,2x_height#),0);
230
italcorr h#*slant-u#;
231
adjust_fit(0,0); pickup tiny.nib;
232
numeric accent.stem, accent.hair;
233
accent.stem = max(.8stem,hair);
234
accent.hair = max(.6stem,hair);
235
y1 = y2; x1 = hround(w-1.5u-.5accent.stem); x2 = x4;
236
pos1(accent.hair,-90); pos2(accent.hair,-90);
237
if serifs: pickup tiny.nib;
238
x3-.5accent.stem=hround(1.5u); x4-x3=1.8u; y2 = y4;
239
y3+.5accent.stem=h; top y4'r=vround(.4[x_height,asc_height])+o;
240
y4=y4'; pos4'(accent.hair,90);
241
numeric theta; theta=angle(z4-z3)+90;
242
pos3(accent.stem,theta); pos4(accent.hair,theta);
243
filldraw stroke z1e--z2e; % bar
244
filldraw circ_stroke z3e--z4e; % right diagonal
245
else: pickup fine.nib;
246
pos3(stem,0); pos4(accent.hair,0); bot y2r = bot y4;
247
lft x3l=hround(1.5u); lft x4l=hround(lft x3l+1.8u);
248
top y3=h; top y2l = vround(.4[x_height,asc_height])+o;
249
filldraw stroke z1e--z2e; % bar
250
filldraw stroke z3e--z4e; fi % right diagonal
251
penlabels(1,2,3,4); endchar;
253
cmchar "Rising-falling accent";
254
beginchar(oct"232",9u#,min(asc_height#,2x_height#),0);
255
italcorr h#*slant-u#;
256
adjust_fit(0,0); pickup tiny.nib;
257
numeric accent.stem, accent.hair;
258
accent.stem = max(.8stem,hair);
259
accent.hair = max(.5stem,hair);
260
if serifs: pickup tiny.nib;
261
x2-x1=x6-x5=2.2u; x2=x4; x3=x5; x1=1.2u; x6=w-1.2u;
262
y1=y3=y5=h-.5accent.stem;
263
y2=y4=y6=vround(max(2/3[h,x_height],x_height+o+hair));
264
numeric theta; theta=angle(z1-z2)+90;
265
pos1(accent.stem,theta); pos2(accent.hair,theta);
266
pos3(accent.stem,180-theta); pos4(accent.hair,180-theta);
267
pos5(accent.stem,theta); pos6(accent.hair,theta);
268
full_circ_stroke(1,2);
269
full_circ_stroke(3,4);
270
full_circ_stroke(5,6);
271
else: pickup fine.nib;
272
x2-x1=x6-x5=2.2u; x2=x4; x3=x5; x1=1.2u; x6=w-1.2u;
273
top y1=top y3=top y5=h; bot y2=bot y4=bot y6=vround 2/3[h,x_height];
274
pos1(stem,0); pos2(accent.hair,0);
275
pos3(stem,0); pos4(accent.hair,0);
276
pos5(stem,0); pos6(accent.hair,0);
277
filldraw stroke z1e--z2e;
278
filldraw stroke z3e--z4e;
279
filldraw stroke z5e--z6e; fi
280
penlabels(1,2,3,4,5,6); endchar;
282
cmchar "Falling-rising accent";
283
beginchar(oct"233",9u#,min(asc_height#,2x_height#),0);
284
italcorr h#*slant-u#;
285
adjust_fit(0,0); pickup tiny.nib;
286
numeric accent.stem, accent.hair;
287
accent.stem = max(.8stem,hair);
288
accent.hair = max(.5stem,hair);
289
if serifs: pickup tiny.nib;
290
x1-x2=x5-x6=2.2u; x1=x3; x4=x6; x2=1.2u; x5=w-1.2u;
291
y1=y3=y5=h-.5accent.stem;
292
y2=y4=y6=vround(max(2/3[h,x_height],x_height+o+hair));
293
numeric theta; theta=angle(z1-z2)+90;
294
pos1(accent.stem,theta); pos2(accent.hair,theta);
295
pos3(accent.stem,180-theta); pos4(accent.hair,180-theta);
296
pos5(accent.stem,theta); pos6(accent.hair,theta);
297
full_circ_stroke(1,2);
298
full_circ_stroke(3,4);
299
full_circ_stroke(5,6);
300
else: pickup fine.nib;
301
x1-x2=x5-x6=2.2u; x1=x3; x4=x6; x2=1.2u; x5=w-1.2u;
302
top y1=top y3=top y5=h; bot y2=bot y4=bot y6=vround 2/3[h,x_height];
303
pos1(stem,0); pos2(accent.hair,0);
304
pos3(stem,0); pos4(accent.hair,0);
305
pos5(stem,0); pos6(accent.hair,0);
306
filldraw stroke z1e--z2e;
307
filldraw stroke z3e--z4e;
308
filldraw stroke z5e--z6e; fi
309
penlabels(1,2,3,4,5,6); endchar;