summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/fonts/source/public/tipa/tipatone.mf
blob: d5dcaf8f2d400301561774ad5e34fc744717dc1f (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
% tipatone.mf: TIPA symbols for tone letters and other suprasegmentals
% Copyright 1996-2003 FUKUI Rei
%
% This program may be distributed and/or modified under the
% conditions of the LaTeX Project Public License, either version 1.2
% of this license or (at your option) any later version.
% The latest version of this license is in
%   http://www.latex-project.org/lppl.txt
% and version 1.2 or later is part of all distributions of LaTeX 
% version 1999/12/01 or later.
%
% This program consists of all files listed in Manifest.txt.
%
% Version 1.2 2003/01/01
%

def tone_bar(suffix $, $$)(expr start_y, end_y) =
 adjust_fit(0,0); pickup if serifs: rule.nib; else: hair_rule.nib; fi
 x$ = 0; x$$ = w; % lft, rt are not used for adjusting tone letters.
 y$ = start_y; y$$ = end_y; % same thing for not using top, bot.
 draw z$--z$$;
 penlabels($,$$); enddef;

def long_width = 6u enddef;
def short_width = 4u enddef;

numeric ipacode;
ipacode := 127;

cmchar "Tone letter: long level tone";
beginchar(incr ipacode,long_width#,0,0);
tone_bar(1,2,0,0); endchar;

cmchar "Tone letter: long falling tone (1)";
beginchar(incr ipacode,long_width#,1/4asc_height#,0);
tone_bar(1,2,h,0); endchar;

cmchar "Tone letter: long falling tone (2)";
beginchar(incr ipacode,long_width#,2/4asc_height#,0);
tone_bar(1,2,h,0); endchar;

cmchar "Tone letter: long falling tone (3)";
beginchar(incr ipacode,long_width#,3/4asc_height#,0);
tone_bar(1,2,h,0); endchar;

cmchar "Tone letter: long falling tone (4)";
beginchar(incr ipacode,long_width#,asc_height#,0);
tone_bar(1,2,h,0); endchar;

cmchar "Tone letter: long rising tone (1)";
beginchar(incr ipacode,long_width#,1/4asc_height#,0);
tone_bar(1,2,0,h); endchar;

cmchar "Tone letter: long rising tone (2)";
beginchar(incr ipacode,long_width#,2/4asc_height#,0);
tone_bar(1,2,0,h); endchar;

cmchar "Tone letter: long rising tone (3)";
beginchar(incr ipacode,long_width#,3/4asc_height#,0);
tone_bar(1,2,0,h); endchar;

cmchar "Tone letter: long rising tone (4)";
beginchar(incr ipacode,long_width#,asc_height#,0);
tone_bar(1,2,0,h); endchar;

cmchar "Tone letter: short level tone";
beginchar(incr ipacode,short_width#,0,0);
tone_bar(1,2,0,0); endchar;

cmchar "Tone letter: short falling tone (1)";
beginchar(incr ipacode,short_width#,1/4asc_height#,0);
tone_bar(1,2,h,0); endchar;

cmchar "Tone letter: short falling tone (2)";
beginchar(incr ipacode,short_width#,2/4asc_height#,0);
tone_bar(1,2,h,0); endchar;

cmchar "Tone letter: short falling tone (3)";
beginchar(incr ipacode,short_width#,3/4asc_height#,0);
tone_bar(1,2,h,0); endchar;

cmchar "Tone letter: short falling tone (4)";
beginchar(incr ipacode,short_width#,asc_height#,0);
tone_bar(1,2,h,0); endchar;

cmchar "Tone letter: short rising tone (1)";
beginchar(incr ipacode,short_width#,1/4asc_height#,0);
tone_bar(1,2,0,h); endchar;

cmchar "Tone letter: short rising tone (2)";
beginchar(incr ipacode,short_width#,2/4asc_height#,0);
tone_bar(1,2,0,h); endchar;

cmchar "Tone letter: short rising tone (3)";
beginchar(incr ipacode,short_width#,3/4asc_height#,0);
tone_bar(1,2,0,h); endchar;

cmchar "Tone letter: short rising tone (4)";
beginchar(incr ipacode,short_width#,asc_height#,0);
tone_bar(1,2,0,h); endchar;

cmchar "Vertical line (minor group)";
beginchar(incr ipacode,CT(5u#,5.56u#),body_height#,paren_depth#);
italcorr body_height#*slant+.5rule_thickness#-2u#;
adjust_fit(0,0);
numeric thickness; thickness=hround.6[hair,stem];
pickup tiny.nib; pos1(thickness,0); pos2(thickness,0);
lft x1l = lft x2l = hround(.5w-.5thickness);
top y1=h+eps; bot y2=-d-eps;
filldraw stroke z1e--z2e;
penlabels(1,2); endchar;

cmchar "Double vertical line (Major group)";
beginchar(incr ipacode,CT(9u#,10u#),body_height#,paren_depth#);
italcorr body_height#*slant+.5rule_thickness#-2u#;
adjust_fit(0,0);
numeric thickness; thickness=hround(.6[hair,stem]-2stem_corr);
pickup tiny.nib; pos1(thickness,0); pos2(thickness,0);
pos3(thickness,0); pos4(thickness,0);
x1=x2; x3=x4=w-x1; lft x1l = hround((w-3.5u-thickness)/2);
top y1=top y3=h+eps; bot y2=bot y4=-d-eps;
filldraw stroke z1e--z2e; filldraw stroke z3e--z4e;
penlabels(1,2,3,4); endchar;

cmchar "Down arrow (Downstep)";
beginchar(incr ipacode,8u#,body_height#,0);
italcorr .76body_height#*slant+.5crisp#-u#;
adjust_fit(0,0); pickup crisp.nib;
pos1(rule_thickness,0); pos2(rule_thickness,0);
pos3(rule_thickness,90); pos4(rule_thickness,90);
lft x1l=hround(.5w-.5rule_thickness); y1+.5rule_thickness=h;
x0=x1=x2; bot y0=bar_height; x0-x3=x4-x0=if monospace:2.5u else:2.5u fi+eps;
y3=y4=y0+if monospace:.24 else:.27 fi asc_height+eps;
pos5(rule_thickness,angle(z4-z0)); z5l=z0;
pos6(rule_thickness,angle(z3-z0)); z6l=z0;
z9=.2[.5[z3,z4],z0];
numeric t; path p; p=z4r{z9-z4}..z6r;
t=xpart(p intersectiontimes((x2r,-d)--(x2r,h))); y2=ypart point t of p;
filldraw z0..{z4-z9}z4l--subpath (0,t) of\\(z4r{z9-z4}..z6r)
 --z2r---z1r..z1l---z2l--subpath (t,0) of\\(z3r{z9-z3}..z5r)
 --z3l{z9-z3}..z0 & cycle;  % arrowhead and stem
penlabels(0,1,2,3,4,5,6,9); endchar;

cmchar "Up arrow (Upstep)";
beginchar(incr ipacode,8u#,body_height#,0);
italcorr .76body_height#*slant+.5crisp#-u#;
adjust_fit(0,0); pickup crisp.nib;
pos1(rule_thickness,0); pos2(rule_thickness,0);
pos3(rule_thickness,90); pos4(rule_thickness,90);
lft x1l=hround(.5w-.5rule_thickness); y1-.5rule_thickness=bar_height;
x0=x1=x2; top y0=h; x0-x3=x4-x0=if monospace:2.5u else:2.5u fi+eps;
y3=y4=y0-if monospace:.24 else:.27 fi asc_height-eps;
pos5(rule_thickness,angle(z4-z0)); z5l=z0;
pos6(rule_thickness,angle(z3-z0)); z6l=z0;
z9=.2[.5[z3,z4],z0];
numeric t; path p; p=z4l{z9-z4}..z6r;
t=xpart(p intersectiontimes((x2r,-d)--(x2r,h))); y2=ypart point t of p;
filldraw z0..{z4-z9}z4r--subpath (0,t) of\\(z4l{z9-z4}..z6r)
 --z2r---z1r..z1l---z2l--subpath (t,0) of\\(z3l{z9-z3}..z5r)
 --z3r{z9-z3}..z0 & cycle;  % arrowhead and stem
penlabels(0,1,2,3,4,5,6,9); endchar;

cmchar "Northeast arrow (Global rise)";
beginchar(incr ipacode,14u#,asc_height#,0);
adjust_fit(0,0); pickup crisp.nib;
x1-.5rule_thickness=hround u; rt x0=hround(w-u);
y1-.5rule_thickness=-d; top y0=h;
numeric theta; theta=angle(z0-z1);
pos1(rule_thickness,90+theta); pos2(rule_thickness,90+theta);
pos3(rule_thickness,theta); pos4(rule_thickness,theta);
z3-z0=(-3u,.27asc_height) rotated theta;
z4-z0=(-3u,-.27asc_height) rotated theta;
pos5(rule_thickness,-90); z5l=z0; pos6(rule_thickness,-180); z6l=z0;
z9=.2[.5[z3,z4],z0];
numeric t; path p; p=z4l{z9-z4}..z6r;
t=xpart(p intersectiontimes (z1l--(z1l+2(z0-z1)))); z2l=point t of p;
filldraw z0..{z4-z9}z4r--subpath (0,t) of\\(z4l{z9-z4}..z6r)
 --z2l---z1l..z1r---z2r--subpath (t,0) of\\(z3l{z9-z3}..z5r)
 --z3r{z9-z3}..z0 & cycle;  % arrowhead and stem
penlabels(0,1,2,3,4,5,6,9); endchar;

cmchar "Southeast arrow (global fall)";
beginchar(incr ipacode,14u#,asc_height#,0);
adjust_fit(0,0); pickup crisp.nib;
x1-.5rule_thickness=hround u; rt x0=hround(w-u);
y1+.5rule_thickness=h; bot y0=-d;
numeric theta; theta=angle(z0-z1);
pos1(rule_thickness,90+theta); pos2(rule_thickness,90+theta);
pos3(rule_thickness,theta); pos4(rule_thickness,theta);
z3-z0=(-3u,.27asc_height) rotated theta;
z4-z0=(-3u,-.27asc_height) rotated theta;
pos5(rule_thickness,180); z5l=z0; pos6(rule_thickness,90); z6l=z0;
z9=.2[.5[z3,z4],z0];
numeric t; path p; p=z4l{z9-z4}..z6r;
t=xpart(p intersectiontimes (z1l--(z1l+2(z0-z1)))); z2l=point t of p;
filldraw z0..{z4-z9}z4r
 --subpath (0,t) of\\(z4l{z9-z4}..z6r)
 --z2l---z1l..z1r---z2r
 --subpath (t,0) of\\(z3l{z9-z3}..z5r)
 --z3r{z9-z3}..z0 & cycle;  % arrowhead and stem
penlabels(0,1,2,3,4,5,6,9); endchar;

cmchar "Mid acute accent";
beginchar(oct"230",9u#,min(asc_height#,2x_height#),0);
italcorr h#*slant-u#;
adjust_fit(0,0); pickup tiny.nib;
numeric accent.stem, accent.hair;
accent.stem = max(.8stem,hair);
accent.hair = max(.6stem,hair);
y1 = y2; x1 = hround(1.5u+.5accent.stem); x2 = x4;
pos1(accent.hair,-90); pos2(accent.hair,-90);
if serifs: pickup tiny.nib;
 x3+.5accent.stem=hround(w-1.5u); x3-x4=1.8u; y2 = y4;
 y3+.5accent.stem=h; top y4'l=vround(.4[x_height,asc_height])+o;
 y4=y4'; pos4'(accent.hair,-90);
 numeric theta; theta=angle(z4-z3)+90;
 pos3(accent.stem,theta); pos4(accent.hair,theta);
 filldraw stroke z1e--z2e;  % bar
 filldraw circ_stroke z3e--z4e;  % right diagonal
else: pickup fine.nib;
 pos3(stem,0); pos4(accent.hair,0); bot y2r = bot y4;
 rt x3r=hround(w-1.5u); rt x4r=hround(rt x3r-1.8u);
 top y3=h; top y2l=vround(.4[x_height,asc_height])+o;
 filldraw stroke z1e--z2e; % bar
 filldraw stroke z3e--z4e; fi   % right diagonal
penlabels(1,2,3,4); endchar;

cmchar "Grave mid accent";
beginchar(oct"231",9u#,min(asc_height#,2x_height#),0);
italcorr h#*slant-u#;
adjust_fit(0,0); pickup tiny.nib;
numeric accent.stem, accent.hair;
accent.stem = max(.8stem,hair);
accent.hair = max(.6stem,hair);
y1 = y2; x1 = hround(w-1.5u-.5accent.stem); x2 = x4;
pos1(accent.hair,-90); pos2(accent.hair,-90);
if serifs: pickup tiny.nib;
 x3-.5accent.stem=hround(1.5u); x4-x3=1.8u; y2 = y4;
 y3+.5accent.stem=h; top y4'r=vround(.4[x_height,asc_height])+o;
 y4=y4'; pos4'(accent.hair,90);
 numeric theta; theta=angle(z4-z3)+90;
 pos3(accent.stem,theta); pos4(accent.hair,theta);
 filldraw stroke z1e--z2e;  % bar
 filldraw circ_stroke z3e--z4e;  % right diagonal
else: pickup fine.nib;
 pos3(stem,0); pos4(accent.hair,0); bot y2r = bot y4;
 lft x3l=hround(1.5u); lft x4l=hround(lft x3l+1.8u);
 top y3=h; top y2l = vround(.4[x_height,asc_height])+o;
 filldraw stroke z1e--z2e; % bar
 filldraw stroke z3e--z4e; fi   % right diagonal
penlabels(1,2,3,4); endchar;

cmchar "Rising-falling accent";
beginchar(oct"232",9u#,min(asc_height#,2x_height#),0);
italcorr h#*slant-u#;
adjust_fit(0,0); pickup tiny.nib;
numeric accent.stem, accent.hair;
accent.stem = max(.8stem,hair);
accent.hair = max(.5stem,hair);
if serifs: pickup tiny.nib;
 x2-x1=x6-x5=2.2u; x2=x4; x3=x5; x1=1.2u; x6=w-1.2u;
 y1=y3=y5=h-.5accent.stem;
 y2=y4=y6=vround(max(2/3[h,x_height],x_height+o+hair));
 numeric theta; theta=angle(z1-z2)+90;
 pos1(accent.stem,theta); pos2(accent.hair,theta);
 pos3(accent.stem,180-theta); pos4(accent.hair,180-theta);
 pos5(accent.stem,theta); pos6(accent.hair,theta);
 full_circ_stroke(1,2);
 full_circ_stroke(3,4);
 full_circ_stroke(5,6);
else: pickup fine.nib;
 x2-x1=x6-x5=2.2u; x2=x4; x3=x5; x1=1.2u; x6=w-1.2u;
 top y1=top y3=top y5=h; bot y2=bot y4=bot y6=vround 2/3[h,x_height];
 pos1(stem,0); pos2(accent.hair,0);
 pos3(stem,0); pos4(accent.hair,0);
 pos5(stem,0); pos6(accent.hair,0);
 filldraw stroke z1e--z2e;
 filldraw stroke z3e--z4e;
 filldraw stroke z5e--z6e; fi
penlabels(1,2,3,4,5,6); endchar;

cmchar "Falling-rising accent";
beginchar(oct"233",9u#,min(asc_height#,2x_height#),0);
italcorr h#*slant-u#;
adjust_fit(0,0); pickup tiny.nib;
numeric accent.stem, accent.hair;
accent.stem = max(.8stem,hair);
accent.hair = max(.5stem,hair);
if serifs: pickup tiny.nib;
 x1-x2=x5-x6=2.2u; x1=x3; x4=x6; x2=1.2u; x5=w-1.2u;
 y1=y3=y5=h-.5accent.stem;
 y2=y4=y6=vround(max(2/3[h,x_height],x_height+o+hair));
 numeric theta; theta=angle(z1-z2)+90;
 pos1(accent.stem,theta); pos2(accent.hair,theta);
 pos3(accent.stem,180-theta); pos4(accent.hair,180-theta);
 pos5(accent.stem,theta); pos6(accent.hair,theta);
 full_circ_stroke(1,2);
 full_circ_stroke(3,4);
 full_circ_stroke(5,6);
else: pickup fine.nib;
 x1-x2=x5-x6=2.2u; x1=x3; x4=x6; x2=1.2u; x5=w-1.2u;
 top y1=top y3=top y5=h; bot y2=bot y4=bot y6=vround 2/3[h,x_height];
 pos1(stem,0); pos2(accent.hair,0);
 pos3(stem,0); pos4(accent.hair,0);
 pos5(stem,0); pos6(accent.hair,0);
 filldraw stroke z1e--z2e;
 filldraw stroke z3e--z4e;
 filldraw stroke z5e--z6e; fi
penlabels(1,2,3,4,5,6); endchar;

% end of tipatone.mf