Debian Codegraph @

texmf-dist/fonts/source/public/amsfonts/cyrillic/cyrmax.mf

raw
1 %% filename: cyrmax.mf
2 %% version: 2.2
3 %% date: 1995/01/04
4 %%
5 %% American Mathematical Society
6 %% Technical Support
7 %% Publications Technical Group
8 %% 201 Charles Street
9 %% Providence, RI 02904
10 %% USA
11 %% tel: (401) 455-4080
12 %% (800) 321-4267 (USA and Canada only)
13 %% fax: (401) 331-3842
14 %% email: [email protected]
15 %%
16 %% Copyright 1995 Humanities and Arts Computing Center, University of
17 %% Washington.
18 %%
19 %% Unlimited copying and redistribution of this file are permitted as
20 %% long as this file is not modified. Modifications, and distribution
21 %% of modified versions, are permitted, but only if the resulting file
22 %% is renamed.
23 %%
24 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
25 def slantswitch =
26 slant:=-slant;
27 currenttransform:= identity slanted slant yscaled aspect_ratio scaled granularity;
28 enddef; %reverse slant so that mirror() will work
29
30 def lowerfit = 0 enddef;
31
32 transform MIRROR;
33 MIRROR=identity reflectedabout(origin,up);
34
35 % produce a mirror image of current picture reflected about a vertical axis
36 def mirror (expr axis) =
37 currentpicture:=currentpicture transformed MIRROR shifted (2axis,0);
38 slantswitch; % restore normal slant
39 enddef;
40
41 vardef armup(suffix $,$$,@)(expr darkness,jut) = % arm from |z$| to |z$$|
42 x@0=good.x(x$$r-jut); y@0=y$l;
43 if serifs: y@1=y$r; z@1=z$$r-whatever*(z@0-z$$r);
44 z@2=.5[z$r,z@1];
45 filldraw z$$l{z@1-z$$l}...darkness[z@1,.5[z@2,z$$l] ]...z@2
46 ---z$r--z$l--z@0--z$$r--cycle; % arm and beak
47 else: filldraw z$l--z$r--z@0--z$$r--cycle; fi % sans-serif arm
48 penlabels(@0,@1,@2); enddef;
49
50 def varwid =
51 if serifs: if hefty: vair else: 1.5cap_hair fi else: vair fi
52 enddef;
53
54
55 vardef cyrsanserif(suffix $) =
56 x$.css.r=x$r; x$.css.l=x$l; x$.css=x$;
57 y$.css.r=y$r-2slab; y$.css.l=y$l-2slab; y$.css=y$-2slab;
58 filldraw stroke z$e--z$.css.e;
59 enddef;
60
61 vardef lcyrsanserif(suffix $) =
62 numeric cssdif; cssdif=.5(x$r-x$l); if cssdif<0: cssdif:=-cssdif; fi
63 x$'.css.r=x$r+cssdif; x$'.css.l=x$l+cssdif; x$'.css=x$+cssdif;
64 y$'.css.r=y$'.css.l=y$'.css=bot y$ + slab;
65 x$.css.r=x$r+cssdif; x$.css.l=x$l+cssdif; x$.css=x$+cssdif;
66 y$.css.r=y$r-2slab; y$.css.l=y$l-2slab; y$.css=y$-2slab;
67 filldraw stroke z$'.css.e--z$.css.e;
68 enddef;
69
70 vardef rcyrsanserif(suffix $) =
71 numeric cssdif; cssdif=.5(x$r-x$l); if cssdif<0: cssdif:=-cssdif; fi
72 x$'.css.r=x$r-cssdif; x$'.css.l=x$l-cssdif; x$'.css=x$-cssdif;
73 y$'.css.r=y$'.css.l=y$'.css=bot y$ + slab;
74 x$.css.r=x$r-cssdif; x$.css.l=x$l-cssdif; x$.css=x$-cssdif;
75 y$.css.r=y$r-2slab; y$.css.l=y$l-2slab; y$.css=y$-2slab;
76 filldraw stroke z$'.css.e--z$.css.e;
77 enddef;
78
79 numeric flouradjust; flouradjust=.09designsize;
80 vardef cyr_serif(suffix $,$$,@) % serif at |z$| for stroke from |z$$|
81 (expr darkness,jut) suffix modifier =
82 pickup crisp.nib; numeric bracket_height; pair downward;
83 bracket_height=if dark.modifier: 1.5 fi\\ bracket;
84 if y$<y$$: y@2=min(y$+bracket_height,y$$);
85 top y@1-slab=bot y@0+eps=tiny.bot y$; downward=z$-z$$;
86 if y@1>y@2: y@2:=y@1; fi
87 else: y@2=max(y$-bracket_height,y$$);
88 bot y@1+slab=top y@0-eps=tiny.top y$; downward=z$$-z$;
89 if y@1<y@2: y@2:=y@1; fi fi
90 y@3=y@2; z@3=whatever[z$,z$$];
91 if jut<0: z@2+penoffset downward of currentpen =
92 z$l+penoffset downward of pen_[tiny.nib]+whatever*downward;
93 lft x@0=lft x@1=tiny.lft x$l+jut;
94 if x@3<x@2+eps: x@3:=x@2+eps; fi
95 else: z@2-penoffset downward of currentpen =
96 z$r-penoffset downward of pen_[tiny.nib]+whatever*downward;
97 rt x@0=rt x@1=tiny.rt x$r+jut;
98 if x@3>x@2-eps: x@3:=x@2-eps; fi fi
99 pair corner; ypart corner=y@1; corner=z@2+whatever*downward;
100 pair flourish; xpart flourish= x@0 if jut > 0: + cyrflwd else: - cyrflwd fi;
101 ypart flourish= y@0 - cyrflht;
102 if (designsize < 15pt):
103 pair flourishcorner; xpart flourishcorner=flouradjust[x@2,(xpart flourish)];
104 ypart flourishcorner=ypart flourish; %if jut > 0: -1.5 else: +1.5 fi;
105 filldraw z@2{z$-z$$}
106 ...darkness[corner,.5[z@1,z@2] ]{z@1-z@2}
107 ...{jut,0}z@1--z@0{down}...{jut,-1}flourish--flourishcorner{-jut,0}
108 ...{-jut,0}(x$,y@0)--z@3--cycle; % the serif
109 else: filldraw z@2{z$-z$$}
110 ...darkness[corner,.5[z@1,z@2] ]{z@1-z@2}
111 ...{jut,0}z@1--z@0{down}...{jut,-1}flourish{-jut,0}
112 ...{-jut,0}(x$,y@0)--z@3--cycle; % the serif
113 fi
114 labels (@0,@1,@2,@3); enddef;
115
116
117 def dish_cyr_serif(suffix $,$$,@)(expr left_darkness,left_jut)
118 (suffix @@)(expr right_darkness,right_jut) suffix modifier =
119 cyr_serif($,$$,@,left_darkness,-left_jut) modifier;
120 cyr_serif($,$$,@@,right_darkness,right_jut) modifier;
121 enddef;
122
123 def l_cyr_serif(suffix $,$$,@)(expr left_darkness,left_jut)
124 (suffix @@)(expr right_darkness,right_jut) suffix modifier =
125 cyr_serif($,$$,@,left_darkness,-left_jut) modifier;
126 serif($,$$,@@,right_darkness,right_jut) modifier;
127 enddef;
128
129 def r_cyr_serif(suffix $,$$,@)(expr left_darkness,left_jut)
130 (suffix @@)(expr right_darkness,right_jut) suffix modifier =
131 serif($,$$,@,left_darkness,-left_jut) modifier;
132 cyr_serif($,$$,@@,right_darkness,right_jut) modifier;
133 enddef;
134
135 % cyrbrev is called with suffix, dummy_suffix e.g.
136 % cyrbrev(2,q) where the breve will be centered
137 % above x2 using dummy suffixes q_1, q_2 etc.
138 def cyrbrev (suffix $,@) =
139 pickup crisp.nib; pos@_1(vair,-180); pos@_3(vair,0);
140 top y@_1=top y@_3=h;
141 lft x@_1r=hround(x$-4u-.5vair); rt x@_3r=hround(x$+4u+.5vair);
142 numeric mid_thickness; mid_thickness=vround 1/3[vair,stem];
143 pos@_2(mid_thickness,-90); x@_2=x$;
144 bot y@_2r=y$+dot_size;
145 filldraw stroke z@_1e{down}...z@_2e{right}...{up}z@_3e; % stroke
146 pos@_11(dot_size,0); pos@_12(dot_size,90);
147 pos@_13(dot_size,0); pos@_14(dot_size,90);
148 lft x@_11l=lft x@_1r; rt x@_13r=rt x@_3r; y@_11=y@_12=y@_13=y@_14=h;
149 x@_12=x@_11; x@_14=x@_13; dot(@_11,@_12); dot(@_13,@_14);
150 penlabels(@_1,@_2,@_3,@_11,@_13); enddef;
151
152 boolean altaccent; altaccent=false; % altaccent inhibits right side dot
153 def nucyrbrev (suffix $,@) =
154 pickup crisp.nib; pos@_1(vair,-180); pos@_3(vair,0);
155 top y@_1=top y@_3=y@_2r+cyrspread;
156 lft x@_1r=hround(x$-4u-.5vair); rt x@_3r=hround(x$+4u+.5vair);
157 numeric mid_thickness; mid_thickness=vround 1/3[vair,stem];
158 pos@_2(mid_thickness,-90); x@_2=x$;
159 bot y@_2r=y$+.5dot_size;
160 filldraw stroke z@_1e{down}...z@_2e{right}...{up}z@_3e; % stroke
161
162 if square_dots: % relax
163 else:
164 pos@_11(dot_size,0); pos@_12(dot_size,90);
165 pos@_13(dot_size,0); pos@_14(dot_size,90);
166 lft x@_11l=lft x@_1r; rt x@_13r=rt x@_3r;
167 y@_11=y@_12=y@_13=y@_14=y@_2r+cyrspread;
168 x@_12=x@_11; x@_14=x@_13; dot(@_11,@_12);
169 if altaccent: % relax
170 else: dot(@_13,@_14); fi
171 fi
172 penlabels(@_1,@_2,@_3,@_11,@_13); enddef;
173
174 % flip rotates 180 degrees about the centerpoint whose suffix is passed
175 def flip (suffix $) =
176 picture V; transform FLIP;
177 y$:=y$*aspect_ratio;
178 FLIP=identity rotatedaround(z$,180) shifted(2slant*y$,0);
179 V=currentpicture transformed FLIP; currentpicture:=V;
180 enddef;
181
182 def dot_sharp_values =
183 numeric dot_diam#; dot_diam#=max(dot_size#,cap_curve#);
184 numeric dot_top#; dot_top#=min(asc_height#,10/7x_height#+.5dot_diam#);
185 enddef;
186
187
188 % umlaut
189 % calling specification is (xx,q) where xx is a point over which to center
190 % the umlaut, q is a dummy suffix which may be used
191 def umlaut (suffix $,@) =
192 dot_sharp_values;
193 define_whole_blacker_pixels(dot_diam);
194 pickup tiny.nib; pos@_1(dot_diam,0); pos@_2(dot_diam,90);
195 x@_1=x@_2=x$-dot_diam; top y@_2r=2dot_diam+y$;
196 y@_1=.5[y@_2l,y@_2r];
197 dot(@_1,@_2); % dot
198 pos@_3(dot_diam,0); pos@_4(dot_diam,90);
199 x@_3=x@_4=x$+1.75u; top y@_4r=2dot_diam+y$;
200 y@_3=.5[y@_4l,y@_4r];
201 dot(@_3,@_4); % dot
202 enddef;