summaryrefslogtreecommitdiff
path: root/Master/texmf-dist/fonts/source/lh/base/lycyracc.mf
blob: 053856c787dd40ae6bf80801f3360b78486b85e4 (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
312
313
314
315
316
317
%
% lycyracc.mf
%
%% Cyrillic font container with T2 encoding beta-support
%
% This file is future part of lxfonts package
% Version 3.4 // Patchlevel=0
% (c) O.Lapko
%
% This package belongs to the public domain under conditions similar to
% those of D. E. Knuth specified for the Computer Modern family of fonts.
% In particular, only the authors are entitled to modify this file
% and to save it under the same name.
%
% Content:
%
% accents from txaccent.mf (tc fonts) + Cyrillic accents
%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

% Accents for capital letters
%

LHver_check(3,4); % like |version_check| in ec

% 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;

%turn for this file: is_cap toggled by this value
cyrcaph:=true;

lhchar"Grave accent";
cyrchar_twice(Agrave,9u#,x_height#,0); % |put_gravis| changes the height
adjust_fit(0,0);
put_gravis;
repeat_once;
endchar;

lhchar"Acute accent"; % using acute from plfonts
cyrchar_twice(Aacute,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;

lhchar"Circumflex (hat) accent";
cyrchar(Ahat,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;

lhchar"Tilde (squiggle) accent";
cyrchar(Atilde,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;

lhchar"Umlaut (double dot) accent";
cyrchar(Aumlaut,9u#,cap_accent_height#,0);
adjust_fit(0,0);
uppercase_umlaut(0,0,1,2,3,4);
penlabels(1,2,3,4); endchar;

lhchar"Double acute accent (Long Hungarian umlaut accent)";
cyrchar_twice(Aacute_dbl,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;

lhchar"Scandinavian circle accent";
cyrchar(Aring,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;

lhchar"Hachek (check) accent";
cyrchar(Ahachek,9u#,cap_accent_height#,0);
adjust_fit(0,0);
uc_hachek_accent(.5w);
endchar;

lhchar"Breve accent";
cyrchar(Abreve,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;

lhchar"Macron (bar) accent";
numeric macron_breadth#; macron_breadth#=.2[vair#,stem#];
cyrchar(Abar,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;

lhchar"Dot accent";
cyrchar_twice(Adot,5u#,x_height#,0);
adjust_fit(0,0);
put_dot(tiny,max(dot_size#,cap_curve#));
repeat_once;
endchar;

lhchar"Cedilla accent";
cyrchar(Acedilla,8u#,0,.875desc_depth#);
adjust_fit(0,0);
uppercase_cedilla(.5w,0,1,2,3,4,5);
penlabels(1,2,3,4,5); endchar;

lhchar"Ogonek";
cyrchar(Aogonek,5u#,0,desc_depth#);
italcorr 0;
adjust_fit(0,0);
%the_ogonek(.5w,0,1,2,3);
% polish-like "easy_ogonek" instead of Computer Modern "the_ogonek"
def the_pen=if known ogonek_pen: ogonek_pen
    elseif serifs: tiny elseif is_bold: fisp else: fine fi
enddef;
% |diag_end| refers to |tiny| pen, hence |tiny| in the following equation:
ogonek_pos=(.5w if not serifs: +.5stem if is_bold: +.75tiny fi\\ fi,.5the_pen)
   if serifs and not is_egyptian: +(.5xvair,0) fi;
easy_ogonek(the_pen, 1,2,3); % ogonek
penlabels(1,2,3); endchar;

%
% differs from lowercase form
%
lhchar "Cyrillic accent Ahcross - horisontal cross";
cyrchar(Ahcross,7u#,cap_height#,desc_depth#);
italcorr asc_height#*slant+.5dot_size#-2u#;
adjust_fit(0,0);
% hcross
pickup crisp.nib; numeric outer_jut;
% some funny fonts have an extremally small |jut|:
outer_jut=.5cap_stem+if serifs: max(limit_dist,cap_jut) else: 1.8u fi;
pos1(bar,90); pos2(bar,90);
top y1r=top y2r=vround (.52h+.5bar)+eps;
x1=.5w-outer_jut; x2=.5w+outer_jut;
filldraw stroke z1e--z2e; % cross bar
endchar;

% differs from lowercase form
lhchar "Cyrillic accent Avcross - vertical cross";
cyrchar(Avcross,5u#,cap_height#,0);
italcorr asc_height#*slant+.5dot_size#-2u#;
adjust_fit(0,0);
% vcross
if serifs: pickup crisp.nib; else: pickup fine.nib; fi
pos1(bar,0); pos2(bar,0);
lft x1l=lft x2l=hround(.5w-.5bar);
top y2-bot y1=.5cap_height; .5[y1,y2]=.52h;
filldraw stroke z1e--z2e;
endchar;

lhchar "Cyrillic accent Aacute_cross - diagonal cross"; % cross from pl_ml (plfonts)
cyrchar_twice(Aacute_cross,7u#,cap_height#,0);
italcorr asc_height#*slant-serif_fit#+.5stem#-2u#;
adjust_fit(serif_fit#,serif_fit#);
numeric unbalance,outer_jut;
unbalance=if monospace: 1 else: 1.1 fi;
% some funny fonts have an extremally small |jut|:
outer_jut=.5cap_stem+if serifs: max(limit_dist,cap_jut) else: 1.8u fi;
put_cyrcross(.5w,0,outer_jut,unbalance*outer_jut);
repeat_once;
endchar;

lhchar "Cyrillic accent Agrave_cross - diagonal cross"; % cross from pl_ml (plfonts)
cyrchar_twice(Agrave_cross,7u#,cap_height#,0);
italcorr asc_height#*slant-serif_fit#+.5stem#-2u#;
adjust_fit(serif_fit#,serif_fit#);
numeric unbalance,outer_jut;
unbalance=if monospace: 1 else: 1.1 fi;
% some funny fonts have an extremally small |jut|:
outer_jut=.5cap_stem+if serifs: max(limit_dist,cap_jut) else: 1.8u fi;
put_cyrcross(.5w,0,-unbalance*outer_jut,-outer_jut);
repeat_once;
endchar;

lhchar"Cyrillic accent Agrave_dbl - double grave";
cyrchar_twice(Agrave_dbl,9u#,x_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_gravis; hpos_corr=1.5u; put_gravis; fi
repeat_once;
endchar;

lhchar "Cyrillic accent Acyrbreve - cyrillic breve";
cyrchar(Acyrbreve,9u#,cap_height#+acc_height#,0);
italcorr h#*slant+.5vair#-1.5u#;
adjust_fit(0,0);
cbreve(.5w,0, 1,2,3,4,5,6,7);
endchar;

lhchar"Cyrillic tie accent"; % centered
cyrchar(Atie,9u#,asc_height#,0);
italcorr 4/9[x_height#,asc_height#]*slant+4.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(2u-.5vair); x2=.5w;
y1=y3=4/9[x_height,asc_height]; top y2r=vround 8/9[x_height,asc_height];
filldraw stroke super_arc.e(1,2) & super_arc.e(2,3);  % arc
penlabels(1,2,3); endchar;

lhchar "Cyrillic frown accent";
cyrchar(Afrown,9u#,x_height#+acc_height#,0);
italcorr h#*slant+.5vair#-1.5u#;
adjust_fit(0,0);
%!!! uppercase_breve flipped
x_center:=.5w; y_move:=0; _one:=1; _two:=2; _three:=3;
%
pickup crisp.nib; pos[_one](vair,-180);
pos[_three](vair,0);
top y[_two]r=cap_height + acc_height;
x[_two]=hround x_center;
x[_two]-rt x[_one]l
  =(lft x[_three]l)-x[_two]
  =hround (2.5u if monospace: /expansion_factor fi -.5vair);
numeric mid_thickness;
mid_thickness=max(crisp.breadth,vround min(1/3[vair,stem],.5acc_height));%!!!
pos[_two](mid_thickness,90);
% |accent_gap| SHOULD be defined by the acute accent, before this macro runs
if unknown accent_gap: % accent_gap emulation
   if serifs:
      y[_two]'=h-.5mid_stem+eps-max(2/3[h,hi.x_height],hi.x_height+o+hair);
      accent_gap=a_ht-(y[_two]'+.5mid_stem)-hi.x_height;
   else:
      top y[_two]'=h-vround(2/3[h,hi.x_height]);
      accent_gap=a_ht-y[_two]'-hi.x_height;
   fi
fi
bot y[_one]=bot y[_three]=cap_height + if hefty: .5 fi accent_gap;
filldraw stroke z[_one]e{up}...z[_two]e{right}...
     {down}z[_three]e;  % stroke
%
penlabels(1,2,3); endchar;

lhchar "Cyrillic accent Abreve_long - long breve"; %accent width enlarged by 3u
cyrchar(Abreve_long,12u#,x_height#+acc_height#,0);
italcorr h#*slant+.5vair#-1.5u#;
adjust_fit(0,0);
x_center:=.5w; y_move:=0;
_one:=1; _two:=2; _three:=3;
pickup crisp.nib; pos[_one](vair,-180);
pos[_three](vair,0);
top y[_one]=top y[_three]=h;
x[_two]=x_center;
lft x[_one]r=hround(x[_two]-4.75u%!2.5u
   if monospace: /expansion_factor fi -0.5vair);
rt x[_three]r=hround(x[_two]+4.75u%!2.5u
   if monospace: /expansion_factor fi +0.5vair);
numeric mid_thickness; mid_thickness=vround 1/3[vair,stem];
pos[_two](mid_thickness,-90);
bot y[_two]r=
   vround max(x_height+o+tiny,1/3[x_height,h]+o-.5mid_thickness);
filldraw stroke z[_one]e{down}...
         z[_two]e{right}...{up}z[_three]e;  % stroke
endchar;

lhchar "Cyrillic accent Abar_long - long bar"; %accent width enlarged by 3u
cyrchar(Abar_long,12u#,lc_trema_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 .5u;%!1.25u
filldraw stroke z1e--z2e;  % bar
penlabels(1,2); endchar;

%
% outsiders
%

lhchar "Cyrillic accent Adesc_up - uppercase descender";
cyrchar(Adesc_up,5u#,pdot_diam#,cap_sbeak#);
adjust_fit(0,cap_serif_fit#);
pickup tiny.nib;
pos1(cap_stem,0); pos2(cap_stem,0);
rt x1r=rt x2r=w-hround max(2u,3u-.5cap_stem);
top y1=h; bot y2=0;
inner_jut:=.5cap_stem+eps;
save bracket; bracket:=0;
numeric left_jut;
left_jut=if serifs:
	    max(limit_dist,if monospace: 1.414cap_jut else: 1.1cap_jut fi)
	 else: hround (r-rt x2r-.65u) fi;
cyr_serif(2,1,a,1/3,beak_darkness,left_jut,beak_jut); % right descender
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#;

cyrcaph:=false; %turned back

endinput;
%end of file