Revision: 1.6 - (view) (download)
1 : | ktanaka | 1.1 | ;(cond ((definedp 'kanjilib)) |
2 : | ; (t (exfile 'lib.l))) | ||
3 : | ktanaka | 1.4 | (declare (local_gothicwidth) special) |
4 : | ktanaka | 1.1 | (defun gothic2 (p1 p2 w) |
5 : | (lets ((p12 (diff2 p2 p1)) | ||
6 : | (l1 (normlen2 w (rot270 p12)))) | ||
7 : | `(((angle .,(plus2 p1 l1)) | ||
8 : | (angle .,(plus2 p2 l1))) | ||
9 : | ((angle .,(diff2 p1 l1)) | ||
10 : | (angle .,(diff2 p2 l1)))))) | ||
11 : | ; | ||
12 : | (defun gothic3 (p1 p2 p3 w (ratio 0.6666666666)) | ||
13 : | (lets ((p12 (diff2 p2 p1)) | ||
14 : | (l1 (normlen2 w (rot270 p12))) | ||
15 : | (p23 (diff2 p3 p2)) | ||
16 : | (l3 (normlen2 w (rot270 p23))) | ||
17 : | (dp1 (times2 (times 3 ratio) p12)) | ||
18 : | (dp2 (times2 (times 3 ratio) p23)) | ||
19 : | (ddp1 (plus2 | ||
20 : | (times2 6.0 (diff2 p3 p1)) | ||
21 : | (times2 -4.0 dp1) | ||
22 : | (times2 -2.0 dp2))) | ||
23 : | (ddp2 (plus2 | ||
24 : | (times2 6.0 (diff2 p1 p3)) | ||
25 : | (times2 4.0 dp2) | ||
26 : | (times2 2.0 dp1))) | ||
27 : | (dp1_ddp1 (mul2 dp1 ddp1)) | ||
28 : | (dp2_ddp2 (mul2 dp2 ddp2)) | ||
29 : | (lendp1 (length2 dp1)) | ||
30 : | (lendp2 (length2 dp2)) | ||
31 : | (lendp1_3 (expt lendp1 3)) | ||
32 : | (lendp2_3 (expt lendp2 3)) | ||
33 : | (a1 (plus2 p1 l1)) | ||
34 : | (a2 (plus2 p3 l3)) | ||
35 : | (b1 (diff2 p1 l1)) | ||
36 : | (b2 (diff2 p3 l3)) | ||
37 : | (da1 (plus2 | ||
38 : | dp1 | ||
39 : | (times2 (quotient w lendp1) (rot270 ddp1)) | ||
40 : | (times2 (quotient (times w dp1_ddp1) lendp1_3) (rot90 dp1)))) | ||
41 : | (da2 (plus2 | ||
42 : | dp2 | ||
43 : | (times2 (quotient w lendp2) (rot270 ddp2)) | ||
44 : | (times2 (quotient (times w dp2_ddp2) lendp2_3) (rot90 dp2)))) | ||
45 : | (db1 (plus2 | ||
46 : | dp1 | ||
47 : | (times2 (quotient w lendp1) (rot90 ddp1)) | ||
48 : | (times2 (quotient (times w dp1_ddp1) lendp1_3) (rot270 dp1)))) | ||
49 : | (db2 (plus2 | ||
50 : | dp2 | ||
51 : | (times2 (quotient w lendp2) (rot90 ddp2)) | ||
52 : | (times2 (quotient (times w dp2_ddp2) lendp2_3) (rot270 dp2)))) | ||
53 : | ) | ||
54 : | ; (break) | ||
55 : | `(((angle .,a1) | ||
56 : | (bezier .,(plus2 a1 (times2 0.33333333 da1))) | ||
57 : | (bezier .,(plus2 a2 (times2 -0.33333333 da2))) | ||
58 : | (angle .,a2)) | ||
59 : | ((angle .,b1) | ||
60 : | (bezier .,(plus2 b1 (times2 0.33333333 db1))) | ||
61 : | (bezier .,(plus2 b2 (times2 -0.33333333 db2))) | ||
62 : | (angle .,b2))))) | ||
63 : | |||
64 : | (defun gothiccurve (p1 p2 p3 w (ratio 0.6666666666)) | ||
65 : | (lets ((p12 (diff2 p2 p1)) | ||
66 : | (l1 (normlen2 w (rot270 p12))) | ||
67 : | (p23 (diff2 p3 p2)) | ||
68 : | (l3 (normlen2 w (rot270 p23))) | ||
69 : | (w1 (quotient (times -1.0 w (length2 l1)(length2 p23)) | ||
70 : | (mul2 l1 p23))) | ||
71 : | (a1 (plus2 p1 l1)) | ||
72 : | (a2 (plus2 p2 (normlen2 w1 (diff2 p2 p1))(normlen2 w1 (diff2 p2 p3)))) | ||
73 : | (a3 (plus2 p3 l3)) | ||
74 : | (b1 (diff2 p1 l1)) | ||
75 : | (b2 (plus2 p2 (normlen2 w1 (diff2 p1 p2))(normlen2 w1 (diff2 p3 p2)))) | ||
76 : | (b3 (diff2 p3 l3))) | ||
77 : | ; (break) | ||
78 : | ktanaka | 1.4 | ; (setq test 'bezier) |
79 : | ktanaka | 1.1 | `(((angle .,a1) |
80 : | ktanaka | 1.4 | (bezier .,(inter2 a1 a2 ratio)) |
81 : | (bezier .,(inter2 a3 a2 ratio)) | ||
82 : | ktanaka | 1.1 | (angle .,a3)) |
83 : | ((angle .,b1) | ||
84 : | ktanaka | 1.4 | (bezier .,(inter2 b1 b2 ratio)) |
85 : | (bezier .,(inter2 b3 b2 ratio)) | ||
86 : | ktanaka | 1.1 | (angle .,b3))))) |
87 : | |||
88 : | |||
89 : | ; | ||
90 : | (defkazari gothic ((tate hidari tatehidari tatehane kokoro tasuki magaritate) 0 | ||
91 : | (tate hidari tatehidari tatehane kokoro tasuki magaritate) 1) | ||
92 : | (lets ((p0 (vref cross 0)) | ||
93 : | (p1 (vref cross 1)) | ||
94 : | (p2 (vref cross 2)) | ||
95 : | (p3 (vref cross 3)) | ||
96 : | (d0 (norm2 (diff2 p3 p1))) | ||
97 : | (len (metric2 p0 p1)) | ||
98 : | (sintheta (times 0.5 (car d0)))) | ||
99 : | `((angle .,p0) | ||
100 : | (bezier ., | ||
101 : | (plus2 p1 (normlen2 (plus (times len 0.2)(times len sintheta)) (diff2 p3 p1)) | ||
102 : | (normlen2 (times len 0.5) (diff2 p1 p0)))) | ||
103 : | (bezier ., | ||
104 : | (plus2 p1 (normlen2 (plus (times len 0.6)(times 1.5 len sintheta)) (diff2 p3 p1)) | ||
105 : | (normlen2 (times len 0.5) (diff2 p1 p0)))) | ||
106 : | (angle ., | ||
107 : | (plus2 p1 (normlen2 (plus (times len 0.8)(times len sintheta)) (diff2 p3 p1))))))) | ||
108 : | ; | ||
109 : | (defkazari gothic (migiue 0 migiue 1) | ||
110 : | (lets ((p1 (vref cross 0)) | ||
111 : | (p0 (vref cross 1)) | ||
112 : | (p3 (vref cross 2)) | ||
113 : | (p2 (vref cross 3)) | ||
114 : | (d0 (norm2 (diff2 p3 p1))) | ||
115 : | (len (metric2 p0 p1)) | ||
116 : | ; (sintheta (times 0.5 (car d0))) | ||
117 : | (sintheta 0) | ||
118 : | ) | ||
119 : | `( | ||
120 : | (angle ., | ||
121 : | (plus2 p1 (normlen2 (plus (times len 0.8)(times len sintheta)) (diff2 p3 p1)))) | ||
122 : | (bezier ., | ||
123 : | (plus2 p1 (normlen2 (plus (times len 0.6)(times 1.5 len sintheta)) (diff2 p3 p1)) | ||
124 : | (normlen2 (times len 0.5) (diff2 p1 p0)))) | ||
125 : | (bezier ., | ||
126 : | (plus2 p1 (normlen2 (plus (times len 0.2)(times len sintheta)) (diff2 p3 p1)) | ||
127 : | (normlen2 (times len 0.5) (diff2 p1 p0)))) | ||
128 : | (angle .,p0)))) | ||
129 : | ; | ||
130 : | (defkazari gothic ((sanzui kokoro migiue tasuki) 2 (sanzui kokoro migiue tasuki) 3) | ||
131 : | (lets ((p1 (vref cross 0)) | ||
132 : | (p0 (vref cross 1)) | ||
133 : | (p3 (vref cross 2)) | ||
134 : | (p2 (vref cross 3)) | ||
135 : | (d0 (norm2 (diff2 p3 p1))) | ||
136 : | (sintheta (min 0.25 (times 0.5 (cadr d0)))) | ||
137 : | (l0 (normlen2 (times sintheta (metric2 p0 p1)) d0)) | ||
138 : | ) | ||
139 : | `((angle .,(plus2 p1 l0)) | ||
140 : | (angle .,(diff2 p0 l0))))) | ||
141 : | (defkazari gothic (ten 2 ten 3) | ||
142 : | (lets ((p1 (vref cross 0)) | ||
143 : | (p0 (vref cross 1)) | ||
144 : | (p3 (vref cross 2)) | ||
145 : | (p2 (vref cross 3)) | ||
146 : | (l0 (times2 -0.1 (diff2 p3 p1)))) | ||
147 : | `((angle .,(plus2 p1 l0)) | ||
148 : | (angle .,(diff2 p0 l0))))) | ||
149 : | ; | ||
150 : | (defkazari gothic | ||
151 : | ; ((hidari tatehidari migi tatehane tsukurihane shin-nyuu kozato) 2 | ||
152 : | ; (hidari tatehidari migi tatehane tsukurihane shin-nyuu kozato) 3) | ||
153 : | ((hidari tatehidari migi shin-nyuu) 2 | ||
154 : | (hidari tatehidari migi shin-nyuu) 3) | ||
155 : | (lets ((p1 (vref cross 0)) | ||
156 : | (p0 (vref cross 1)) | ||
157 : | (p3 (vref cross 2)) | ||
158 : | (p2 (vref cross 3)) | ||
159 : | (d0 (norm2 (diff2 p3 p1))) | ||
160 : | (costheta (times 0.2 (car d0))) | ||
161 : | (l0 (normlen2 (times costheta (metric2 p0 p1)) d0)) | ||
162 : | ) | ||
163 : | `((angle .,(diff2 p1 l0)) | ||
164 : | (angle .,(plus2 p0 l0))))) | ||
165 : | ; | ||
166 : | (defkazari gothic ((magaritate tsukurihane hidari) 1 yoko 3) | ||
167 : | (lets ((p0 (vref cross 0)) | ||
168 : | (p1 (vref cross 1)) | ||
169 : | (p2 (vref cross 2)) | ||
170 : | (p3 (vref cross 3))) | ||
171 : | `((angle .,(inter2 p2 p3 0.3)) | ||
172 : | (angle .,(inter2 p1 p3 0.3))))) | ||
173 : | (defkazari gothic (hidari 2 ten 0) | ||
174 : | (lets ((p0 (vref cross 0)) | ||
175 : | (p1 (vref cross 1)) | ||
176 : | (p2 (vref cross 2)) | ||
177 : | (p3 (vref cross 3)) | ||
178 : | (newp0 (plus2 p3 (normlen2 (times 3.0 local_gothicwidth)(diff2 p0 p3)))) | ||
179 : | ) | ||
180 : | `((angle .,newp0)))) | ||
181 : | ;; | ||
182 : | ;; エレメントの定義 | ||
183 : | ;; | ||
184 : | ; | ||
185 : | ; 点の定義 | ||
186 : | ; | ||
187 : | (defelement gothic ten | ||
188 : | (lets ((x (car points)) | ||
189 : | (y (cadr points)) | ||
190 : | (x (inter2 y x 0.9)) | ||
191 : | (w local_gothicwidth) | ||
192 : | (diff (diff2 y x)) | ||
193 : | (m (plus2 (times2 0.5 (plus2 x y)) | ||
194 : | (times2 0.1 (list (cadr diff)(minus (car diff))))))) | ||
195 : | (gothic3 x m y w))) | ||
196 : | |||
197 : | ; (niku3 x m y 0.3 0.3 w w w (times 1.1 w)))) | ||
198 : | ; | ||
199 : | ; 縦棒の定義 | ||
200 : | ; | ||
201 : | (defelement gothic tate | ||
202 : | (let ((x (car points)) | ||
203 : | (y (cadr points)) | ||
204 : | (w local_gothicwidth)) | ||
205 : | (gothic2 x y w)))) | ||
206 : | |||
207 : | ; | ||
208 : | ; 横棒の定義 | ||
209 : | ; | ||
210 : | (defelement gothic yoko | ||
211 : | (let ((x (car points)) | ||
212 : | (y (cadr points)) | ||
213 : | (w local_gothicwidth)) | ||
214 : | (gothic2 (inter2 x y 0.000001) (inter2 y x 0.00001) w))) | ||
215 : | ; | ||
216 : | ; 右上はらいの定義 | ||
217 : | ; | ||
218 : | (defelement gothic migiue | ||
219 : | (let ((x (car points)) | ||
220 : | (y (cadr points)) | ||
221 : | (z (caddr points)) | ||
222 : | (w local_gothicwidth) | ||
223 : | ) | ||
224 : | ; (niku3 x y z 0.3 0.3 w w w w) | ||
225 : | (gothic3 x y z w) | ||
226 : | )) | ||
227 : | |||
228 : | ; | ||
229 : | ; 左はらいの定義 | ||
230 : | ; | ||
231 : | (defelement gothic hidari | ||
232 : | (lets ((p0 (car points)) | ||
233 : | (p1 (cadr points)) | ||
234 : | (p2 (caddr points)) | ||
235 : | (w local_gothicwidth) | ||
236 : | ) | ||
237 : | (gothic3 p0 p1 p2 w))) | ||
238 : | ; | ||
239 : | ; 縦左はらいの定義 | ||
240 : | ; | ||
241 : | (defelement gothic tatehidari | ||
242 : | (lets ((p0 (car points)) | ||
243 : | (p1 (cadr points)) | ||
244 : | (p2 (caddr points)) | ||
245 : | (p3 (cadddr points)) | ||
246 : | (w local_gothicwidth) | ||
247 : | (l0 (gothic2 p0 p1 w)) | ||
248 : | (l1 (gothic3 p1 p2 p3 w))) | ||
249 : | `(,(nconc (car l0) (cdar l1)) | ||
250 : | ,(nconc (cadr l0) (cdadr l1))))) | ||
251 : | ; | ||
252 : | ; 右はらいの定義 | ||
253 : | ; | ||
254 : | (defelement gothic migi | ||
255 : | (let ((x (car points)) | ||
256 : | (y (cadr points)) | ||
257 : | (z (caddr points)) | ||
258 : | (w local_gothicwidth)) | ||
259 : | ; (niku3 x y z 0.3 0.3 w w w w) | ||
260 : | (gothic3 x y z w) | ||
261 : | )) | ||
262 : | ; | ||
263 : | ; こざと偏の一部 | ||
264 : | ; | ||
265 : | (defelement gothic kozato | ||
266 : | (lets ((p0 (car points)) | ||
267 : | (p1 (cadr points)) | ||
268 : | (p2 (caddr points)) | ||
269 : | (p3 (fourth points)) | ||
270 : | (p12 (inter2 p1 p2 0.5)) | ||
271 : | (w local_gothicwidth)) | ||
272 : | (curve2 p0 (inter2 p0 p1 0.6)(inter2 p12 p1 0.6) p12 | ||
273 : | w w w w | ||
274 : | (hane p12 p2 p3 | ||
275 : | w w w)))) | ||
276 : | ; | ||
277 : | ; 縦跳ね | ||
278 : | ; | ||
279 : | (defelement gothic tatehane | ||
280 : | (lets ((p0 (car points)) | ||
281 : | (p1 (cadr points)) | ||
282 : | (p2 (caddr points)) | ||
283 : | (w local_gothicwidth) | ||
284 : | (p1 (plus2 p1 (normlen2 w (diff2 p0 p1)))) | ||
285 : | (p2 (plus2 p2 (normlen2 w (diff2 p0 p1)))) | ||
286 : | (len0 (metric2 p0 p1)) | ||
287 : | (len1 (metric2 p1 p2)) | ||
288 : | (p01 (inter2 p1 p0 (quotient len1 len0))) | ||
289 : | (p2 (plus2 p1 (normlen2 (max (times 2.0 w)(metric2 p2 p1)) | ||
290 : | (diff2 p2 p1))))) | ||
291 : | (line2 p0 p01 w (hane p01 p1 p2 w w w)))) | ||
292 : | ; (out1 (gothic2 p0 p01 w)) | ||
293 : | ; (out2 (gothiccurve p01 p1 p2 w))) | ||
294 : | ; `(,(nconc (car out1)(cdar out2)) | ||
295 : | ; ,(nconc (cadr out1)(cdadr out2))))) | ||
296 : | ; | ||
297 : | ; 旁の跳ね | ||
298 : | ; | ||
299 : | (defelement gothic tsukurihane | ||
300 : | (lets ((p0 (car points)) | ||
301 : | (p1 (cadr points)) | ||
302 : | (p2 (caddr points)) | ||
303 : | (p3 (cadddr points)) | ||
304 : | (w local_gothicwidth) | ||
305 : | (p2 (plus2 p2 (normlen2 w (diff2 p1 p2)))) | ||
306 : | (p3 (plus2 p3 (normlen2 w (diff2 p1 p2)))) | ||
307 : | (p3 (cond ((lessp (metric2 p2 p3) (times w 2)) | ||
308 : | (plus2 p2 (normlen2 (times w 2)(diff2 p3 p2)))) | ||
309 : | (t p3))) | ||
310 : | (p4 (inter2 p1 p2 0.5)) | ||
311 : | ; (out1 (gothic3 p0 p1 p4 w)) | ||
312 : | ; (out2 (gothic3 p4 p2 p3 w)) | ||
313 : | ) | ||
314 : | ; (break) | ||
315 : | (curve2 p0 (inter2 p0 p1 0.6)(inter2 p4 p1 0.6) p4 | ||
316 : | w w w w | ||
317 : | (hane p4 p2 p3 | ||
318 : | w w w)))) | ||
319 : | ; )) | ||
320 : | ; ) | ||
321 : | ; `(,(nconc (car out1)(cdar out2)) | ||
322 : | ; ,(nconc (cadr out1)(cdadr out2))))) | ||
323 : | ; | ||
324 : | ; さんずい | ||
325 : | ; | ||
326 : | (defelement gothic sanzui | ||
327 : | (lets ((p0 (car points)) | ||
328 : | (p1 (cadr points)) | ||
329 : | (dx (difference (car p0)(car p1))) | ||
330 : | (p0 (plus2 p0 `(,dx 0))) | ||
331 : | (p1 (inter2 p0 p1 0.7)) | ||
332 : | (p0 (inter2 p1 p0 0.9)) | ||
333 : | (v0 (times2 0.05 (rot270 (diff2 p1 p0)))) | ||
334 : | (p2 (plus2 (inter2 p0 p1 0.5) v0)) | ||
335 : | (w local_gothicwidth)) | ||
336 : | (gothic3 p0 p2 p1 w))) | ||
337 : | |||
338 : | ; | ||
339 : | ; こころ | ||
340 : | ; | ||
341 : | (defelement gothic kokoro | ||
342 : | (lets ((p0 (car points)) | ||
343 : | (p1 (cadr points)) | ||
344 : | (p2 (caddr points)) | ||
345 : | (p3 (cadddr points)) | ||
346 : | (w local_gothicwidth) | ||
347 : | (p2 (plus2 p2 (normlen2 (times w 1.2)(diff2 p1 p2)))) | ||
348 : | (p1 (plus2 p1 (normlen2 w (diff2 p0 p1)))) | ||
349 : | (p2 (plus2 p2 (normlen2 w (diff2 p3 p2)))) | ||
350 : | (w2 (times w 2)) | ||
351 : | (p10 (plus2 p1 (normlen2 w2 (diff2 p0 p1)))) | ||
352 : | (p12 (cond ((lessp (metric2 p1 p2) (times w2 2.0)) | ||
353 : | (inter2 p1 p2 0.5)) | ||
354 : | (t (plus2 p1 (normlen2 w2 (diff2 p2 p1)))))) | ||
355 : | (p21 (cond ((lessp (metric2 p1 p2) (times w2 2.0)) | ||
356 : | nil) | ||
357 : | (t (plus2 p2 (normlen2 w2 (diff2 p1 p2)))))) | ||
358 : | (p23 (plus2 p2 (normlen2 (min w2 (times 0.8 (metric2 p3 p2)))(diff2 p3 p2)))) | ||
359 : | (out1 (gothic2 p0 p10 w)) | ||
360 : | (out2 (gothiccurve p10 p1 p12 w)) | ||
361 : | (out3 (cond (p21 (gothic2 p12 p21 w)) | ||
362 : | (t '((nil) (nil))))) | ||
363 : | (out4 (cond (p21 (gothiccurve p21 p2 p23 w)) | ||
364 : | (t (gothiccurve p12 p2 p23 w)))) | ||
365 : | (out5 (gothic2 p23 p3 w))) | ||
366 : | `(,(nconc (car out1)(cdar out2)(cdar out3)(cdar out4)(cdar out5)) | ||
367 : | ,(nconc (cadr out1)(cdadr out2)(cdadr out3)(cdadr out4)(cdadr out5))))) | ||
368 : | ; | ||
369 : | ; たすき | ||
370 : | ; | ||
371 : | (defelement gothic tasuki | ||
372 : | (lets ((p0 (car points)) | ||
373 : | (p1 (cadr points)) | ||
374 : | (p2 (caddr points)) | ||
375 : | (p3 (cadddr points)) | ||
376 : | (w local_gothicwidth) | ||
377 : | (p21 (plus2 p2 (normlen2 | ||
378 : | (min (times 0.5 (metric2 p1 p2))(times 4 w)) | ||
379 : | (diff2 p1 p2)))) | ||
380 : | (p23 (plus2 p2 (normlen2 | ||
381 : | (min (times 0.5 (metric2 p2 p3))(times 4 w)) | ||
382 : | (diff2 p3 p2))))) | ||
383 : | (curve2 p0 (inter2 p0 p1 0.7)(inter2 p21 p1 0.7) p21 | ||
384 : | w w w w | ||
385 : | (curve2 p21 (inter2 p21 p2 0.7)(inter2 p23 p2 0.7) p23 | ||
386 : | w w w w | ||
387 : | (gothic2 p23 p3 w))))) | ||
388 : | ; `(,(nconc (car out1)(cdar out2)(cdar out3)) | ||
389 : | ; ,(nconc (cadr out1)(cdadr out2)(cdadr out3))))) | ||
390 : | ; | ||
391 : | ; まがりたて | ||
392 : | ; | ||
393 : | (defelement gothic magaritate | ||
394 : | (let ((p0 (car points)) | ||
395 : | (p1 (cadr points)) | ||
396 : | (p2 (caddr points)) | ||
397 : | (w local_gothicwidth)) | ||
398 : | (cond ((lessp (metric2 p1 p2)(times 4.0 w)) | ||
399 : | (gothic2 p0 p2 w)) | ||
400 : | (t | ||
401 : | (gothic3 p0 p1 p2 w))))) | ||
402 : | ; | ||
403 : | ; かぎ | ||
404 : | ; | ||
405 : | (defelement gothic kagi | ||
406 : | (lets ((p0 (car points)) | ||
407 : | (p1 (cadr points)) | ||
408 : | (p2 (caddr points)) | ||
409 : | (w local_gothicwidth) | ||
410 : | (p1 (plus2 p1 (normlen2 w (diff2 p0 p1)))) | ||
411 : | (p2 (plus2 p2 (normlen2 w (diff2 p0 p1)))) | ||
412 : | (w2 (times w 3)) | ||
413 : | (p10 (cond ((lessp w2 (metric2 p0 p1)) | ||
414 : | (plus2 p1 (normlen2 w2 (diff2 p0 p1)))) | ||
415 : | (t p0))) | ||
416 : | ktanaka | 1.6 | (p12 (cond ((lessp w2 (metric2 p2 p1)) |
417 : | (plus2 p1 (normlen2 w2 (diff2 p2 p1)))) | ||
418 : | (t (inter2 p1 p2 0.9)))) | ||
419 : | ktanaka | 1.1 | (out1 (cond ((not (eq p0 p10)) (gothic2 p0 p10 w))(t '(nil nil)))) |
420 : | (out2 (gothiccurve p10 p1 p12 w circle-ratio)) | ||
421 : | (out3 (gothic2 p12 p2 w))) | ||
422 : | `(,(nconc (car out1)(cdar out2)(cdar out3)) | ||
423 : | ,(nconc (cadr out1)(cdadr out2)(cdadr out3))))) | ||
424 : | ; | ||
425 : | ; しんにゅう | ||
426 : | ; | ||
427 : | (defelement gothic shin-nyuu | ||
428 : | (lets ((p0 (car points)) | ||
429 : | (p1 (cadr points)) | ||
430 : | (p2 (caddr points)) | ||
431 : | (w local_gothicwidth)) | ||
432 : | (curve2 p0 (inter2 p0 p1 0.7)(inter2 p2 p1 0.7) p2 w w w w))) | ||
433 : | ; (gothic3 p0 p1 p2 w))) | ||
434 : | ; | ||
435 : | (deftypehook gothic | ||
436 : | (function gothic-prim)) | ||
437 : | (declare (yokopoints) special) | ||
438 : | (defun rm-geta (prim getalen) | ||
439 : | (lets ((points (car prim)) | ||
440 : | (elements (cadr prim)) | ||
441 : | (newelements) | ||
442 : | (linkpoints) | ||
443 : | (yokopoints)) | ||
444 : | (do ((l elements (cdr l))(p)(link)) | ||
445 : | ((atom l)) | ||
446 : | (and (setq link (assq 'link (cddar l))) | ||
447 : | (setq linkpoints (append (cdr link) linkpoints))) | ||
448 : | (and (eq (caar l) 'yoko) | ||
449 : | (setq p (cadar l)) | ||
450 : | (setq yokopoints `(,(car p) ,(cadr p) .,yokopoints))) | ||
451 : | (or (memq (caar l) '(tate magaritate)) | ||
452 : | (setq linkpoints (append (cadar l) linkpoints)))) | ||
453 : | (do ((l elements (cdr l))(epoints)(p1)(lastp)(rp1)(link)(yokolink)) | ||
454 : | ((atom l) | ||
455 : | `(,points ,(nreverse newelements) .,(cddr prim))) | ||
456 : | (cond ((memq (caar l) '(tate magaritate)) | ||
457 : | (setq epoints (copy (cadar l))) | ||
458 : | (setq lastp (last epoints)) | ||
459 : | (setq rp1 (nth (setq p1 (car lastp)) points)) | ||
460 : | (setq link (assq 'link (cddar l))) | ||
461 : | (and link | ||
462 : | (setq yokolink | ||
463 : | (do ((ll (cdr link)(cdr ll))(ret)) | ||
464 : | ((atom ll)(nreverse ret)) | ||
465 : | (and (memq (car ll) yokopoints) | ||
466 : | (push (car ll) ret))))) | ||
467 : | (cond ((or (null link)(null yokolink)(memq p1 linkpoints)) | ||
468 : | (push (car l) newelements)) | ||
469 : | (t | ||
470 : | (do ((ll yokolink (cdr ll))(minlink)(minlen)(p)(len)) | ||
471 : | ((atom ll) | ||
472 : | (cond ((lessp minlen getalen) | ||
473 : | (rplaca lastp minlink) | ||
474 : | ; (break) | ||
475 : | (push `(,(caar l) ,epoints | ||
476 : | (link .,(remq minlink (cdr link))) | ||
477 : | .,(cddar l)) newelements)) | ||
478 : | (t | ||
479 : | (push (car l) newelements)))) | ||
480 : | (setq p (nth (car ll) points)) | ||
481 : | (setq len (metric2 rp1 p)) | ||
482 : | (and (or (null minlink)(lessp len minlen)) | ||
483 : | (setq minlink (car ll) minlen len)))))) | ||
484 : | (t (push (car l) newelements)))))) | ||
485 : | |||
486 : | (defun gothic-prim (prim) | ||
487 : | (lets ((prim (rm-geta prim 30.0)) | ||
488 : | (points (car prim)) | ||
489 : | (elements (cadr prim)) | ||
490 : | (alist (cddr prim)) | ||
491 : | (origunits (units prim)) | ||
492 : | (units (units | ||
493 : | `(,points ,elements | ||
494 : | .,(every alist | ||
495 : | #'(lambda (x) | ||
496 : | (not (memq (car x) | ||
497 : | '(xunit yunit)))))))) | ||
498 : | (width (min gothicwidth | ||
499 : | (times 0.16 (min (car origunits)(cdr origunits)(car units)(cdr units)))))) | ||
500 : | ; (break) | ||
501 : | (setq local_gothicwidth width) | ||
502 : | `(,points ,elements .,alist))) |
ktanaka Powered by ViewCVS 1.0-dev |
ViewCVS and CVS Help |