Revision: 1.1 - (view) (download)
1 : | ktanaka | 1.1 | (deftypehook gothic |
2 : | (function gothic-prim)) | ||
3 : | (subfont naal gothic) | ||
4 : | (setq circle-ratio (quotient (times 4.0 (difference (sqrt 2) 1)) 3.0)) | ||
5 : | (defkazari naal ((tate hidari tatehidari kokoro magaritate tasuki tatehane tsukurihane kagi) 0 | ||
6 : | yoko 1) | ||
7 : | (naalout (vref cross 0)(vref cross 1)(vref cross 2)(vref cross 3))) | ||
8 : | (defkazari naal ((tate hidari tatehidari kokoro magaritate tasuki tatehane tsukurihane kagi) 1 | ||
9 : | yoko 0) | ||
10 : | (naalin (vref cross 0)(vref cross 1)(vref cross 2)(vref cross 3))) | ||
11 : | (defkazari naal ((tate hidari tatehidari kokoro magaritate tasuki tatehane tsukurihane kagi) 1 | ||
12 : | yoko 3) | ||
13 : | (naalout (vref cross 2)(vref cross 3)(vref cross 0)(vref cross 1))) | ||
14 : | (defkazari naal ((tate hidari tatehidari kokoro magaritate tasuki tatehane tsukurihane kagi) 0 | ||
15 : | yoko 2) | ||
16 : | (naalin (vref cross 2)(vref cross 3)(vref cross 0)(vref cross 1))) | ||
17 : | (defkazari naal ((tate hidari tatehidari kokoro magaritate tasuki tatehane tsukurihane kagi) 2 | ||
18 : | (kozato yoko) 0) | ||
19 : | (naalout (vref cross 1)(vref cross 0)(vref cross 3)(vref cross 2))) | ||
20 : | (defkazari naal ((tate hidari tatehidari kokoro magaritate tasuki tatehane tsukurihane kagi) 3 | ||
21 : | (kozato yoko) 1) | ||
22 : | (naalin (vref cross 1)(vref cross 0)(vref cross 3)(vref cross 2))) | ||
23 : | (defkazari naal ((tate hidari tatehidari kokoro magaritate tasuki tatehane tsukurihane kagi) 3 | ||
24 : | yoko 2) | ||
25 : | (naalout (vref cross 3)(vref cross 2)(vref cross 1)(vref cross 0))) | ||
26 : | (defkazari naal ((tate hidari tatehidari kokoro magaritate tasuki tatehane tsukurihane kagi) 2 | ||
27 : | yoko 3) | ||
28 : | (naalin (vref cross 3)(vref cross 2)(vref cross 1)(vref cross 0))) | ||
29 : | |||
30 : | (defkazari naal ((yoko ten migiue kozato tasuki sanzui) 0 | ||
31 : | (yoko ten migiue kozato tasuki sanzui) 1) | ||
32 : | (naalstart (vref cross 0)(vref cross 1)(vref cross 2)(vref cross 3))) | ||
33 : | (defkazari naal ((kagi) 0 | ||
34 : | (kagi) 1) | ||
35 : | (naalstart (vref cross 0)(vref cross 1)(vref cross 2)(vref cross 3))) | ||
36 : | (defkazari naal ((yoko ten migiue kozato kagi tasuki sanzui) 2 | ||
37 : | (yoko ten migiue kozato kagi tasuki sanzui) 3) | ||
38 : | (reverse | ||
39 : | (naalstart (vref cross 1)(vref cross 0)(vref cross 3)(vref cross 2)))) | ||
40 : | (defkazari naal ((tate hidari tatehidari kokoro magaritate tasuki migi) 0 | ||
41 : | (tate hidari tatehidari kokoro magaritate tasuki migi) 1) | ||
42 : | (naalstart (vref cross 0)(vref cross 1)(vref cross 2)(vref cross 3))) | ||
43 : | (defkazari naal ((tate hidari tatehidari magaritate migi) 2 | ||
44 : | (tate hidari tatehidari magaritate migi) 3) | ||
45 : | (reverse | ||
46 : | (naalstart (vref cross 1)(vref cross 0)(vref cross 3)(vref cross 2)))) | ||
47 : | (defkazari naal ((tatehane tsukurihane shin-nyuu hira-long) 0 | ||
48 : | (tatehane tsukurihane shin-nyuu hira-long) 1) | ||
49 : | (naalstart (vref cross 0)(vref cross 1)(vref cross 2)(vref cross 3))) | ||
50 : | (defkazari naal ((shin-nyuu hira-long) 2 | ||
51 : | (shin-nyuu hira-long) 3) | ||
52 : | (reverse | ||
53 : | (naalstart (vref cross 1)(vref cross 0)(vref cross 3)(vref cross 2)))) | ||
54 : | (defkazari naal ((tatehane tsukurihane kokoro tasuki) 2 | ||
55 : | (tatehane tsukurihane kokoro tasuki) 3) | ||
56 : | (reverse | ||
57 : | (naalstart1 (vref cross 1)(vref cross 0)(vref cross 3)(vref cross 2) 20))) | ||
58 : | (defun naalstart1 (p0 p1 p2 p3 offset) | ||
59 : | (lets ((v (normlen2 offset (diff2 p0 p2)))) | ||
60 : | (naalstart (plus2 p0 v)(plus2 p1 v)(plus2 p2 v)(plus2 p3 v)))) | ||
61 : | |||
62 : | ; | ||
63 : | (defun naalhane (p0 p1 p2 w0 w1 w2) | ||
64 : | (lets ((d0 (diff2 p1 p0)) | ||
65 : | (d1 (diff2 p2 p1)) | ||
66 : | (l0 (normlen2 w0 (rot270 d0))) | ||
67 : | (l1 (normlen2 w0 (rot270 d1))) | ||
68 : | (a0 (plus2 p0 l0)) | ||
69 : | (a2 (plus2 p2 (normlen2 w1 l1))) | ||
70 : | (d2 (diff2 a2 (plus2 l1 (diff2 p1 l0)))) | ||
71 : | (a1 (cross2 a0 a2 d0 d2)) | ||
72 : | (a3 (plus2 a2 (normlen2 w2 d2))) | ||
73 : | (a4 a3) | ||
74 : | (b0 (diff2 p0 l0)) | ||
75 : | (b1 (diff2 (diff2 p1 l0) l1)) | ||
76 : | (b2 (diff2 p2 (normlen2 w1 l1))) | ||
77 : | (b4 b2) | ||
78 : | (t0 (plus2 a2 (normlen2 w0 d2))) | ||
79 : | (t1 (diff2 p2 (normlen2 (times w1 -0.2) l1))) | ||
80 : | (b3 (cross2 a3 b2 (diff2 t1 a3)(diff2 t0 b2))) | ||
81 : | (b3 (cond ((lessp (metric2 a3 b3) 1.0) | ||
82 : | (inter2 b2 a3 0.5)) | ||
83 : | (t b3))) | ||
84 : | ) | ||
85 : | `(((angle .,a0) | ||
86 : | (bezier .,(inter2 a0 a1 0.66666)) | ||
87 : | (bezier .,(inter2 a4 a1 0.66666)) | ||
88 : | (angle .,a4) | ||
89 : | ; (angle .,a3) | ||
90 : | ) | ||
91 : | ((angle .,b0) | ||
92 : | (bezier .,(inter2 b0 b1 0.66666)) | ||
93 : | (bezier .,(inter2 b4 b1 0.66666)) | ||
94 : | (angle .,b4))))) | ||
95 : | (defun naalstart (p0 p1 p2 p3) | ||
96 : | (lets ((p0 (inter2 p0 p1 0.01))(p2 (inter2 p2 p3 0.01)) | ||
97 : | (p02 (inter2 p0 p2 0.499)) | ||
98 : | (p01 (inter2 p0 p1 0.45)) | ||
99 : | (p13 (inter2 p1 p3 0.45))) | ||
100 : | `((angle .,p02) | ||
101 : | (bezier .,(inter2 p02 p0 circle-ratio)) | ||
102 : | (bezier .,(inter2 p01 p0 circle-ratio)) | ||
103 : | (angle .,p01) | ||
104 : | (bezier .,(inter2 p01 p1 circle-ratio)) | ||
105 : | (bezier .,(inter2 p13 p1 circle-ratio)) | ||
106 : | (angle .,p13)))) | ||
107 : | (setq naalr nil) | ||
108 : | (defun naalout (p0 p1 p2 p3) | ||
109 : | (lets ((l (min (plus (metric2 p3 p2) naalr) (times 1.9 (metric2 p3 p2)))) | ||
110 : | (a0 (plus2 p1 (normlen2 l(diff2 p0 p1)))) | ||
111 : | (a1 (plus2 p1 (normlen2 l(diff2 p3 p1))))) | ||
112 : | `((angle .,a0) | ||
113 : | (bezier .,(inter2 a0 p1 circle-ratio)) | ||
114 : | (bezier .,(inter2 a1 p1 circle-ratio)) | ||
115 : | (angle .,a1)))) | ||
116 : | (defun naalin (p0 p1 p2 p3) | ||
117 : | (lets ((costheta (costheta (diff2 p2 p3)(diff2 p2 p0))) | ||
118 : | (diffl (times costheta (metric2 p2 p3))) | ||
119 : | (l (difference (min naalr (times 0.9 (metric2 p3 p2))) diffl)) | ||
120 : | (b0 (plus2 p2 (normlen2 l (diff2 p2 p3)))) | ||
121 : | (b1 (plus2 p2 (normlen2 l (diff2 p2 p0))))) | ||
122 : | (cond ((greaterp costheta 0.3) | ||
123 : | `((angle .,p2))) | ||
124 : | (t | ||
125 : | `((angle .,b0) | ||
126 : | (bezier .,(inter2 b0 p2 circle-ratio)) | ||
127 : | (bezier .,(inter2 b1 p2 circle-ratio)) | ||
128 : | (angle .,b1)))))) | ||
129 : | ; | ||
130 : | (deftypehook naal | ||
131 : | (function naal-prim)) | ||
132 : | ; | ||
133 : | (defun naalr (prim) | ||
134 : | (lets ((points (car prim)) | ||
135 : | (elements (cadr prim)) | ||
136 : | (once)(twice)(ret (times local_gothicwidth 10))) | ||
137 : | (do ((l elements (cdr l))) | ||
138 : | ((atom l)) | ||
139 : | (do ((ll (cadr (car l))(cdr ll))) | ||
140 : | ((atom ll)) | ||
141 : | (cond ((memq (car ll) twice)) | ||
142 : | ((memq (car ll) once) | ||
143 : | (push (car ll) twice)) | ||
144 : | (t | ||
145 : | (push (car ll) once))))) | ||
146 : | (do ((l elements (cdr l))(p0)(p1)(r)) | ||
147 : | ((atom l) | ||
148 : | (times 0.49 | ||
149 : | (difference ret (times local_gothicwidth 2)))) | ||
150 : | (cond ((and (memq (setq p0 (first (cadr (car l)))) twice) | ||
151 : | (memq (setq p1 (car (last (cadr (car l))))) twice)) | ||
152 : | (setq r (metric2 (nth p0 points)(nth p1 points))) | ||
153 : | (and (lessp r ret)(setq ret r))) | ||
154 : | ((or (memq (setq p0 (first (cadr (car l)))) twice) | ||
155 : | (memq (setq p1 (car (last (cadr (car l))))) twice)) | ||
156 : | (setq r (times 1.1 (metric2 (nth p0 points)(nth p1 points)))) | ||
157 : | (and (lessp r ret)(setq ret r))))))) | ||
158 : | |||
159 : | ; | ||
160 : | (defun naal-prim (prim) | ||
161 : | (lets ((prim (last-joint (gothic-prim prim)))) | ||
162 : | (setq naalr (naalr prim)) | ||
163 : | prim)) | ||
164 : | ; | ||
165 : | ; 縦跳ね | ||
166 : | ; | ||
167 : | (defelement gothic tatehane | ||
168 : | (lets ((p0 (car points)) | ||
169 : | (p1 (cadr points)) | ||
170 : | (p2 (caddr points)) | ||
171 : | (w local_gothicwidth) | ||
172 : | (p1 (plus2 p1 (normlen2 w (diff2 p0 p1)))) | ||
173 : | (p2 (plus2 p2 (normlen2 w (diff2 p0 p1)))) | ||
174 : | (len0 (metric2 p0 p1)) | ||
175 : | (len1 (metric2 p1 p2)) | ||
176 : | (p01 (inter2 p1 p0 (quotient len1 len0))) | ||
177 : | (p2 (plus2 p1 (normlen2 (max (times 2.0 w)(metric2 p2 p1)) | ||
178 : | (diff2 p2 p1))))) | ||
179 : | (line2 p0 p01 w (naalhane p01 p1 p2 w w w)))) | ||
180 : | ; | ||
181 : | ; こざと偏の一部 | ||
182 : | ; | ||
183 : | (defelement gothic kozato | ||
184 : | (lets ((p0 (car points)) | ||
185 : | (p1 (cadr points)) | ||
186 : | (p2 (caddr points)) | ||
187 : | (p3 (fourth points)) | ||
188 : | (p12 (inter2 p1 p2 0.5)) | ||
189 : | (w local_gothicwidth)) | ||
190 : | (curve2 p0 (inter2 p0 p1 0.6)(inter2 p12 p1 0.6) p12 | ||
191 : | w w w w | ||
192 : | (naalhane p12 p2 p3 | ||
193 : | w w w)))) | ||
194 : | ; | ||
195 : | ; 旁の跳ね | ||
196 : | ; | ||
197 : | (defelement gothic tsukurihane | ||
198 : | (lets ((p0 (car points)) | ||
199 : | (p1 (cadr points)) | ||
200 : | (p2 (caddr points)) | ||
201 : | (p3 (cadddr points)) | ||
202 : | (w local_gothicwidth) | ||
203 : | (p2 (plus2 p2 (normlen2 w (diff2 p1 p2)))) | ||
204 : | (p3 (plus2 p3 (normlen2 w (diff2 p1 p2)))) | ||
205 : | (p3 (cond ((lessp (metric2 p2 p3) (times w 2)) | ||
206 : | (plus2 p2 (normlen2 (times w 2)(diff2 p3 p2)))) | ||
207 : | (t p3))) | ||
208 : | (p4 (inter2 p1 p2 0.5)) | ||
209 : | ) | ||
210 : | (curve2 p0 (inter2 p0 p1 0.6)(inter2 p4 p1 0.6) p4 | ||
211 : | w w w w | ||
212 : | (naalhane p4 p2 p3 | ||
213 : | w w w)))) | ||
214 : |
ktanaka Powered by ViewCVS 1.0-dev |
ViewCVS and CVS Help |