summaryrefslogtreecommitdiff
path: root/fonts/ec/src/txaccent.mf
blob: 8c8615582c1fb6e5ec8cd750674ae4bdcb348512 (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
% txaccent.mf
%
% (c) Copyright 1995, 1996, 1997 J"org Knappen
%
% This file is part of ecfonts version 1.0
%
% 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)
%
% ec Version 1.0
%
% Content:
%
% Accents for capital letters

version_check(1,0);  % |version_check| was introduced in dc1.3

% A dirty trick, better left unseen. |cap_height| and |cap_height#|
% are restored at the end of this file.

numeric saved_cap_height; saved_cap_height=cap_height;
cap_height:=hi.x_height;
numeric saved_cap_height#; saved_cap_height#=cap_height#;
cap_height#:=hi.x_height#;

vardef is_cap = true enddef;

ecchar"Grave accent";
beginchar_twice(oct"0",9u#,x_height#,0); % |put_gravis| changes the height
adjust_fit(0,0);
put_gravis;
repeat_once;
endchar;


ecchar"Acute accent"; % using acute from plfonts
beginchar_twice(oct"1",9u#,x_height#,0); % |put_accent| changes the height
italcorr h#*slant-if serifs: 1.5 fi u#;
adjust_fit(0,0);
put_accent;
repeat_once;
endchar;

ecchar"Circumflex (hat) accent";
beginchar(oct"002",9u#,cap_accent_height#,0);
if serifs: italcorr .5[x_height#,h#]*slant+.5hair#-1.75u#;
else: italcorr 2/3[x_height#,h#]*slant-.5stem#+.5vair#-.75u#;
fi
adjust_fit(0,0);
uppercase_hat(.5w,0,1,2,3,4,5);
penlabels(1,2,3,4,5); endchar;

ecchar"Tilde (squiggle) accent";
beginchar(oct"003",9u#,cap_accent_height#,0);
italcorr h#*slant-u#;
adjust_fit(0,0);
uppercase_tilde(0,0,1,2,3,4,5);
penlabels(1,2,3,4,5); endchar;

ecchar"Umlaut (double dot) accent";
beginchar(oct"004",9u#,cap_accent_height#,0);
adjust_fit(0,0);
uppercase_umlaut(0,0,1,2,3,4);
penlabels(1,2,3,4);
endchar;

ecchar"Double acute accent (Long Hungarian umlaut accent)";
beginchar_twice(oct"005",9u#,min(asc_height#,2x_height#),0);
italcorr h#*slant-u#;
adjust_fit(0,0);
if monospace: hpos_corr=-2u; put_accent; hpos_corr=2u; put_accent;
else: hpos_corr=-1.5u; put_accent; hpos_corr=1.5u; put_accent; fi
repeat_once;
endchar;

ecchar"Scandinavian circle accent";
beginchar(oct"006",13u#+.5width_adj#,cap_accent_height#,0);
adjust_fit(cap_serif_fit#,cap_serif_fit#);
y[-1]= cap_height+if hefty: .5 fi accent_gap;
uppercase_circle(.5w,y[-1],1,2,3,4);
penlabels(1,2,3,4); endchar;

ecchar"Hachek (check) accent";
beginchar(oct"007",9u#,cap_accent_height#,0);
adjust_fit(0,0);
uc_hachek_accent(.5w);
endchar;

ecchar"Breve accent";
beginchar(oct"10",9u#,cap_accent_height#,0);
italcorr h#*slant+.5vair#-1.5u#;
adjust_fit(0,0);
uppercase_breve(.5w,0,1,2,3);
penlabels(1,2,3); endchar;

ecchar"Macron (bar) accent";
numeric macron_breadth#; macron_breadth#=.2[vair#,stem#];
beginchar(oct"011",9u#,cap_accent_height#,0);
italcorr h#*slant-.75u#;
adjust_fit(0,0);
numeric macron_breadth; macron_breadth:=Vround .2[vair,stem];
pickup if serifs: crisp.nib else: fine.nib fi;
pos1(macron_breadth,90); pos2(macron_breadth,90);
top y1r=top y2r=h+o; lft x1=w-rt x2=hround 1.25u;
filldraw stroke z1e--z2e;  % bar
penlabels(1,2); endchar;

ecchar"Dot accent";
beginchar_twice(oct"012",5u#,x_height#,0);
adjust_fit(0,0);
put_dot(tiny,max(dot_size#,cap_curve#));
repeat_once;
endchar;

ecchar"Cedilla accent";
beginchar(oct"013",8u#,0,.875desc_depth#);
adjust_fit(0,0);
uppercase_cedilla(.5w,0,1,2,3,4,5);
penlabels(1,2,3,4,5); endchar;

ecchar"Ogonek";
beginchar(oct"014",5u#,0,desc_depth#);
italcorr 0;
adjust_fit(0,0);
ogon_one   := 1;
ogon_two   := 2;
ogon_three := 3;
if serifs:
 x[ogon_one]r=0.7w;
 %+outer_jut;
else:
 x[ogon_one]r=0.6w;
fi
 pickup crisp.nib;
 pos[ogon_one](
    if 0.9vair>currentbreadth: 0.9vair else: currentbreadth+eps fi,-60);
 pos[ogon_two](stem,0);
 pos[ogon_three](vair,145);
 x[ogon_two]=x[ogon_one]-2.5u if monospace: /expansion_factor fi ;
 x[ogon_three]=x[ogon_one]+0.5u if monospace: /expansion_factor fi;
 bot y[ogon_one]r = 0;
 bot y[ogon_three]=0.5(-d-o);  %0.4
 bot y[ogon_two]=0.5(-d-o);
 filldraw stroke z[ogon_one]e{dir 225}...
   z[ogon_two]e{dir -110}...{dir 60}z[ogon_three]e;  % hook
penlabels(1,2,3); endchar;

iff not is_small_cap:
ecchar"Capital tie accent";
beginchar(oct"033",max(6u#,4u#+cap_stem#),uc_acc_height#,0); % same width as `I'
italcorr 4/9[x_height#,uc_acc_height#]*slant+5u#+2letter_fit#+.5hair#;
adjust_fit(if monospace:2u#,2u# else:serif_fit#,serif_fit# fi);
pickup fine.nib; pos1(hair,180); pos2(vround 1/5[vair,stem],90); 
pos3(hair,0);
lft x1r=hround(.5w-.5hair); x2=.5[x1,x3];
rt x3r=hround(w+4.5u+2letter_fit+.5hair);
y1=y3=cap_height + if hefty: .5 fi accent_gap; top y2r=cap_height+acc_height;
filldraw stroke super_arc.e(1,2) & super_arc.e(2,3);  % arc
penlabels(1,2,3); endchar;

iff not is_small_cap:
ecchar"New capital tie accent"; % centered
beginchar(oct"035",9u#,asc_height#,0);
italcorr 4/9[x_height#,uc_acc_height#]*slant+5u#+2letter_fit#+.5hair#;
adjust_fit(if monospace:2u#,2u# else:serif_fit#,serif_fit# fi);
pickup fine.nib; pos1(hair,180); pos2(vround 1/5[vair,stem],90); 
pos3(hair,0);
lft x1r=w-rt x3r=hround(u-.5vair); x2=.5w;
y1=y3=cap_height + if hefty: .5 fi accent_gap; top y2r=cap_height+acc_height;
filldraw stroke super_arc.e(1,2) & super_arc.e(2,3);  % arc
penlabels(1,2,3); endchar;


% Restore original values of |cap_height| and |cap_height#|
cap_height:=saved_cap_height; numeric saved_cap_height;
cap_height#:=saved_cap_height#; numeric saved_cap_height#;

endinput;