Debian Codegraph @

texmf-dist/fonts/source/public/elvish/tengdev.mf

raw
1
2 def draw_refl_luva(suffix i,j,k,l)
3 (expr luva_type,bow_stem_y,bow_arch_x,
4 bow_side_y,bow_end_x) =
5 y.i = bow_stem_y * ex ;
6 x.j - x.i = bow_arch_x * (x.k - x.i) ;
7 y.k = (if (luva_type = "calma") or (luva_type = "quesse"): 1 - fi bow_side_y) * ex ;
8 x.l - x.i = bow_end_x * (x.k - x.i) ;
9 numeric x.luva_serif,y.luva_serif ;
10 z.luva_serif = z.l + 0.03em *
11 if luva_type = "tinco": dir 135 else: dir 315 fi ;
12
13 path luva_path ;
14 luva_path = z.i{dir( if (luva_type = "tinco") or (luva_type = "parma"):
15 180-penangle else: -penangle fi)}
16 .. z.j{if (luva_type = "tinco") or (luva_type = "parma"):
17 left else: right fi}
18 .. z.k ..
19 if (luva_type = "parma") or (luva_type = "quesse"): {curl 0.3}z.l
20 else: z.l .. {curl 2}z.luva_serif fi ;
21 draw luva_path ;
22 labels(i,j,k,l)
23 enddef ;
24
25 def draw_refl_parma_luva(suffix i,j,k,l) =
26 % this draws a complete reflected parma luva
27 rt x.i = w - straight_sidebar ; % intersection with stem
28 top y.j = round(ex + o) ; % top
29 lft x.k = round (x.i - luva_width) ; % right
30 y.l = 0 ;% bottom
31 draw_refl_luva(i,j,k,l)("parma",tp_bow_stem_y,
32 pq_bow_arch_x,
33 pq_bow_side_y,
34 pq_bow_end_x )
35 enddef ;
36
37 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
38
39 beginchar("0",.8tinco_width#,ex#,0); "The tengwa number zero";
40 pickup main_nib ;
41 lft x1 = curve_sidebar = w - rt x3 ; x2 = .5[x1,x3 ] ;
42 x4 = .2w ;
43 top y2 = h ;
44 y1 = .7h ; y3 = .55h ; y4 = 0 ;
45 z1' = z1 + .03em*dir(penangle-90) ;
46 draw z1'{dir(penangle+90)} .. z1 .. z2{right} .. z3{down} .. z4 ;
47 endchar ;
48
49 beginchar("1",.9tinco_width#,ex#,0) ; "The tengwa number one" ;
50 pickup main_nib ;
51 lft x1 = straight_sidebar = w - rt x2 ; top y1 = h = top y2 ;
52 draw_bar(1,2,"r") ;
53 x3 = x1 ; y3 = .4h = y5 ;
54 x4 = .4w ; bot y4 = 0 - o ;
55 rt x5 = .75w ;
56 z5' = z5 + 0.05em*dir140 ;
57 draw_telco(1,3,"t") ;
58 draw z3{down} .. z4{right} .. z5 %%%.. z5' ;
59 endchar ;
60
61 beginchar("2",1.4tinco_width#,ex#,0) ; "The tengwa number two" ;
62 pickup main_nib ;
63 lft x1 = straight_sidebar = w - rt x3 ; top y1 = top y2 = top y3 = h ;
64 draw_bar(1,3,"r") ;
65 rt x2 = round(.9*.75tinco_width) ; x2 = x6 ;
66 y4 = y6 = y8 = .4h ;
67 bot y5 = bot y7 = 0 ;
68 x8 - x6 = x6 - x4 ;
69 x5 = .4*.9tinco_width ; x4 = x1 ;
70 x5 - x4 = x7 - x6 ;
71 z8' = z8 + 0.05em*dir140 ;
72 draw_telco(1,4,"t") ; draw z2 -- z6 ;
73 draw z4{down} .. z5{right} .. z6 ;
74 draw z6{down} .. z7{right} .. z8 %%%.. z8' ;
75 endchar ;
76
77 beginchar("3",1.9tinco_width#,ex#,0) ; "The tengwa number three" ;
78 pickup main_nib ;
79 lft x1 = straight_sidebar = w - rt x3 ;
80 top y1 = top y2 = top y2' = top y3 = h ;
81 draw_bar(1,3,"r") ;
82 rt x2 = round(.9*.75tinco_width) ; x2 = x6 ;
83 x2' = x8 ;
84 y4 = y6 = y8 = y10 = .4h ;
85 bot y5 = bot y7 = bot y9 = 0 ;
86 x8 - x6 = x6 - x4 = x10 - x8 ;
87 x5 = .4*.9tinco_width ; x4 = x1 ;
88 x5 - x4 = x7 - x6 = x9 - x8 ;
89 z10' = z10 + 0.05em*dir140 ;
90 draw_telco(1,4,"t") ; draw z2 -- z6 ; draw z2' -- z8 ;
91 draw z4{down} .. z5{right} .. z6 ;
92 draw z6{down} .. z7{right} .. z8 ;
93 draw z8{down} .. z9{right} .. z10 %%%.. z10' ;
94 endchar ;
95
96 beginchar("4",.9tinco_width#,asc#,desc#) ; "The tengwa number four" ;
97 pickup main_nib ;
98 lft x1 = straight_sidebar = w - rt x2 ; top y1 = round ex = top y2 ;
99 x1' = x1 ; top y1' = h ;
100 %%draw_bar(1,2,"r") ;
101 x3 = x1 ; top y3 = 0 = y5 ;
102 x4 = .4w ; bot y4 = vround(-.7d-o) ;
103 rt x5 = .85w ;
104 z5' = z5 + 0.05em*dir140 ;
105 draw_telco(1',3,"t") ;
106 draw z3{down} .. z4{right} .. z5 %%%%.. z5' ;
107 endchar ;
108
109 beginchar("5",1.4tinco_width#,asc#,desc#) ; "The tengwa number five" ;
110 pickup main_nib ;
111 lft x1 = straight_sidebar = w - rt x3 ;
112 x1' = x1 ; top y1' = h ;
113 top y1 = top y2 = top y3 = round ex ;
114 draw_bar(1,3,"r") ;
115 rt x2 = round(.9*.75tinco_width) ; x2 = x6 ;
116 top y4 = -.1d ; y6 = y8 = .4ex ;
117 bot y5 = vround(-.7d-o) ; bot y7 = 0 ;
118 x8 - x6 = x6 - x4 ;
119 x5 = .4*.9tinco_width ; x4 = x1 ;
120 x5 - x4 = x7 - x6 ; x5' = .5[x4,x7] ; y5' = y5 ;
121 z8' = z8 + 0.05em*dir140 ;
122 draw_telco(1',4,"t") ; draw z2 -- z6 ;
123 draw z4{down} .. z5'{right} ... z7 ;
124 draw z6{down} .. z7{right} .. z8 %%%.. z8' ;
125 endchar ;
126
127 beginchar("6",1.9tinco_width#,asc#,desc#) ; "The tengwa number six" ;
128 pickup main_nib ;
129 lft x1 = straight_sidebar = w - rt x3 ;
130 x1' = x1 ; top y1' = h ;
131 top y1 = top y2 = top y3 = round ex ;
132 draw_bar(1,3,"r") ;
133 rt x2 = round(.9*.75tinco_width) ; x2 = x6 ;
134 x2' - x2 = x2 - x1 ; y2' = y2 ;
135 top y4 = -.1d ; y6 = y8 = y10 = .4ex ;
136 bot y5 = vround(-.7d-o) ; bot y7 = bot y9 = 0 ;
137 x8 - x6 = x6 - x4 = x10 - x8 ;
138 x5 = .4*.9tinco_width ; x4 = x1 ;
139 x5 - x4 = x7 - x6 = x9 - x8 ; x5' = .5[x4,x7] ; y5' = y5 ;
140 z8' = z8 + 0.05em*dir140 ;
141 draw_telco(1',4,"t") ; draw z2 -- z6 ; draw z2' -- z8 ;
142 draw z4{down} .. z5'{right} ... z7 ;
143 draw z6{down} .. z7{right} .. z8 ; %%%.. z8' ;
144 draw z8{down} .. z9{right} .. z10 ;
145 endchar ;
146
147 beginchar("7",.9parma_width#,ex#,desc#); "The tengwa number 7";
148 pickup main_nib ;
149 lft x1 = straight_sidebar ;
150 x5 = x1+hround(.6parma_width) ; top y5 = asc ; % top of stem
151 x6 = x5 ; y6 = 0 ; % bottom of stem
152 draw_telco(5,6)("t") ;
153 lft x9 = curve_sidebar ; top y9 = -.3d ;
154 x10 = .5[x6,x9] ; bot y10 = vround(-d-o) ;
155 x6' = x6 ; y6' = -.3d ;
156 draw z6 .. z6'{down} .. z10{left} .. z9 ;
157 endchar ;
158
159
160 def draw_number_luva(suffix i,j,k,l) =
161 % this draws a complete number luva
162 lft x.i = hround(.6parma_width) + straight_sidebar ; % intersection with stem
163 top y.j = round(ex + o) ; % top
164 rt x.k = round (x.i + luva_width) ; % right
165 y.l = 0 ;% bottom
166 draw_luva(i,j,k,l)("parma",tp_bow_stem_y,
167 pq_bow_arch_x,
168 pq_bow_side_y,
169 pq_bow_end_x )
170 enddef ;
171
172 beginchar("8",1.6parma_width#,ex#,desc#); "The tengwa number 8";
173 pickup main_nib ;
174 draw_number_luva(1,2,3,4) ;
175 x5 = x1 ; top y5 = asc ; % top of stem
176 x6 = x5 ; y6 = 0 ; % bottom of stem
177 draw_telco(5,6)("t") ;
178 x7 = x5 ; y7 = good.y o = y8 ; x8 = x3 + 0.05em ; % N.B. praps bot y7 = bot y8 = 0
179 draw_bar(7,8)("r") ;
180 lft x9 = curve_sidebar ; top y9 = -.1d ;
181 x10 = .5[x5,x9] ; bot y10 = vround(-d-o) ;
182 x6' = x6 ; y6' = -.3d ;
183 draw z6 .. z6'{down} .. z10{left} .. z9 ;
184 endchar ;
185
186 def draw_double_number_luva(suffix i,j,k,l,ii,jj,kk,ll) =
187 % this draws a complete umbar luva
188 % first bow
189 lft x.i = hround(.6parma_width)+straight_sidebar ; % intersection with stem
190 top y.j = round(ex + o) ; % top
191 rt x.k = round (x.i + luva_width) ; % right
192 y.l = 0 ;% bottom
193 draw_luva(i,j,k,l)("parma",tp_bow_stem_y,
194 pq_bow_arch_x,
195 pq_bow_side_y,
196 pq_bow_end_x ) ;
197 %second bow
198 z.second = ( (x.i+pt,y.i) .. (infinity,y.i) ) intersectionpoint luva_path ;
199 x.ii = good.x (xpart z.second) ;
200 y.jj = y.j ;
201 rt x.kk = round (x.ii + luva_width) ; % right
202 y.ll = y.l ;
203 draw_luva(ii,jj,kk,ll)("parma",tp_bow_stem_y,
204 pq_bow_arch_x,
205 pq_bow_side_y,
206 pq_bow_end_x )
207 enddef ;
208
209 beginchar("9",2.25parma_width#,ex#,desc#); "The tengwa number 9";
210 pickup main_nib ;
211 draw_double_number_luva(1,2,3,4,9,10,11,12) ;
212 x5 = x1 ; top y5 = asc ; % top of stem
213 x6 = x5 ; y6 = 0 ; % bottom of stem
214 draw_telco(5,6)("t") ;
215 x7 = x5 ; y7 = good.y o = y8 ; x8 = x11 + 0.05em ;
216 draw_bar(7,8)("r") ;
217 lft x13 = curve_sidebar ; top y13 = -.1d ;
218 x14 = .5[x5,x13] ; bot y14 = vround(-d-o) ;
219 x6 = x6' ; y6' = -.3d ;
220 draw z6 .. z6'{down} .. z14{left} .. z13 ;
221 endchar ;
222
223 beginchar("+",0.9*tinco_width#,asc#,0) ; "The tengwa number 10" ;
224 pickup main_nib ;
225 rt x4 = w - curve_sidebar ; y4 = 0.65ex ; % right side of bow
226 bot y3 = round(-o) ; x3 = good.x 0.5w ; % bottom
227 x2 = w - x4 ; y2 = 0.45ex ; % left side of bow
228 x1 = good.x 0.3w ; y1 = 0.7ex ; % end of bow
229 z1' = z1 + 0.03em*dir(10) ; % serif
230 x5 = 0.25w ; y5 = 0.95asc ; % top end of letter
231 z6 = z5 + 0.05em*(dir(penangle+80)) ; % for serif
232 draw z1'{dir(180+penangle)} .. z1 .. z2 .. z3
233 .. z4{up} .. tension 0.9 and 3 .. z5 ;
234 labels(1,1',2,3,4,5,6) ;
235 endchar ;
236
237 beginchar("-",0.85tinco_width#,asc#,desc#) ; "The tengwa number" ;
238 pickup main_nib ;
239 numeric t[] ;
240 % top bow first - make a path for later use
241 x1 = 0.25w ; y1 = 0.95asc ; % top
242 z1' = z1 + 0.05em*dir(penangle+80) ; % serif
243 rt x2 = w - curve_sidebar ; y2 = 0.5h ; % right side of top bow ;
244 x3 = 0.5w ; y3 = good.y 0.2h ; % bottom of top bow
245 x4 = 0.3w ; y4 = 0.5h ; % end of bow
246 z4' = z4 + 0.03em*dir(10) ; % serif
247 path p ;
248 p = z4'{dir(penangle+180)} .. z4 .. z3{right} .. z2{up} ..
249 tension 0.9 and 2.5 .. z1 ;
250 draw p ;
251 x5' = x1 ; y5'-y7 = y1-y3 ; % top of bottom bow
252 x6 = x2 ; y6 - y7 = y2 - y3 ; % side
253 x7 = x3 ; bot y7 = round(-0.9desc) ; % bottom
254 z8 - z7 = z4 - z3 ; % end
255 z8' - z8 = z4' - z4 ;
256 path pa ;
257 pa = z8'{dir(penangle+180)} .. z8 .. z7{right} .. z6{up} ..
258 tension 0.9 and 1.3 .. z5' ;
259 (t1,t2) = p intersectiontimes pa ;
260 draw subpath(0,t2) of pa ;
261 labels(1,2,3,4,5,6,7,8) ;
262 endchar ;
263
264 beginchar("/",0.9*tinco_width#,ex#,desc#); "The tengwa number 12";
265 pickup main_nib ;
266 lft x2 = curve_sidebar ; y2 = 0.6 ex ; % left
267 top y3 = round(ex+o) ; x3 = 0.55w ; % top
268 rt x4 = w - curve_sidebar ; y4 = 0.4 ex ;
269 x1 = x2 + 0.45w ; y1 = 0.2 ex ; % curly end
270 x5 = x2 ; y5 = -0.9desc ;
271 draw z1{dir(penangle+180)} .. z2{up} .. z3{right} ..
272 z4{down} .. tension 3 .. z5 ;
273 labels(1,2,3,4,5) ;
274 endchar ;
275
276 beginchar("{",0.2em#,1.5ex#,0) ; "The circle-over tehta" ;
277 pickup tehta_nib ;
278 x1 = x3 = good.x .5w ; bot y3 = vround(1.3ex) ;
279 y1 = y3 + vround .45ex ; y1 - y3 = x2 - x4 ;
280 y2 = y4 = .5[y1,y3] ; x1 = .5[x2,x4] ;
281 draw z1 .. z2 .. z3 .. z4 .. cycle ;
282 endchar ;
283
284 beginchar("}",0.2em#,0,desc#) ; "The circle-over tehta" ;
285 pickup tehta_nib ;
286 x1 = x3 = good.x .5w ; top y1 = vround -.3ex ;
287 y1 = y3 + vround .45ex ; y1 - y3 = x2 - x4 ;
288 y2 = y4 = .5[y1,y3] ; x1 = .5[x2,x4] ;
289 draw z1 .. z2 .. z3 .. z4 .. cycle ;
290 endchar ;
291
292
293
294 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
295
296 beginchar(28,parma_width#,ex#,desc#); "Reflected parma"; % ^^\
297 pickup main_nib ;
298 draw_refl_parma_luva(1,2,3,4) ;
299 x5 = x1 ; top y5 = ex ; % top of stem
300 x6 = x5 ; bot y6 = -desc ; % bottom of stem
301 draw_telco(5,6)("tb") ;
302 x7 = x5 ; y7 = good.y o = y8 ; x8 = x3 - 0.05em ; % N.B. praps bot y7 = bot y8 = 0
303 draw_bar(7,8)("r") ;
304 endchar ;
305
306 beginchar(29,parma_width#,ex#,0); "Reflected formen";
307 pickup main_nib ;
308 draw_refl_parma_luva(1,2,3,4) ;
309 x5 = x1 ; top y5 = asc ; % top of stem
310 x6 = x5 ; y6 = 0 ; % bottom of stem
311 draw_telco(5,6)("t") ;
312 x7 = x5 ; y7 = good.y o = y8 ; x8 = x3 - 0.05em ; % N.B. praps bot y7 = bot y8 = 0
313 draw_bar(7,8)("r") ;
314 endchar ;
315
316 beginchar("(",0.4em#,asc#,0) ; "Left paren" ;
317 pickup main_nib ;
318 top y1 = round asc ; bot y3 = 0 ; y2 = 1/2[y1,y3] ;
319 lft x2 = straight_sidebar = w - rt x1 = w - rt x3 ;
320 draw z1 .. z2 .. z3 ;
321 endchar ;
322
323 beginchar(")",0.4em#,asc#,0) ; "Right paren" ;
324 pickup main_nib ;
325 top y1 = round asc ; bot y3 = 0 ; y2 = 1/2[y1,y3] ;
326 lft x1 = lft x3 = straight_sidebar = w - rt x2 ;
327 draw z1 .. z2 .. z3 ;
328 endchar ;
329
330 beginchar("`",0.5em#,ex#,0) ; "Left guillemet" ;
331 pickup tehta_nib ;
332 y2 = 0.6ex = 1/2[y1,y3] ;
333 y1 - y3 = 0.4ex ;
334 lft x2 = straight_sidebar = w - rt x1 - 0.2em ; x1 = x3 ;
335 draw z1 .. z2 .. z3 ;
336 forsuffixes i=1,2,3: x.i' = x.i + round(0.2em) ; y.i' = y.i ; endfor ;
337 draw z1' .. z2' .. z3' ;
338 endchar ;
339
340 beginchar("'",0.5em#,ex#,0) ; "Right guillemet" ;
341 pickup tehta_nib ;
342 y2 = 0.6ex = 1/2[y1,y3] ;
343 y1 - y3 = 0.4ex ;
344 rt x2 = w - straight_sidebar = w - lft x1 + 0.2em ; x1 = x3 ;
345 draw z1 .. z2 .. z3 ;
346 forsuffixes i=1,2,3: x.i' = x.i - round(0.2em) ; y.i' = y.i ; endfor ;
347 draw z1' .. z2' .. z3' ;
348 endchar ;
349
350 end.