[wadalabfont-kit] / lisp / mincho.l.new  

View of /lisp/mincho.l.new

Parent Directory | Revision Log
Revision: 1.1 - (download) (annotate)
Thu Dec 28 08:54:19 2000 UTC (23 years, 10 months ago) by ktanaka
Branch point for: ktanaka, MAIN
Initial revision
; 単位は400*400の座標系
; 縦線の太さ
(declare (minchowidth tateyokoratio minchoheight kazariheight
		      tomeheight meshsize)
	 special)
(setq minchowidth 18.0)
; 縦線に対する横線の太さの比
(setq tateyokoratio 0.25)
; 縦線と横線の連結の高さの縦線に対する比
;(setq minchoheight 15.0)
(setq kazariheight 0.75)
; 横線の止めの縦線に対する比
(setq tomeheight 1.5)
; デフォルトのmeshsizeを十分小さくすると害がない. 
(setq meshsize 0.1) 
; ライブラリをexfileする
(cond ((definedp 'kanjilib))
      (t (exfile 'lib.l)))
;
;
; 点の定義
;
(defelement mincho ten
  (lets ((dotsize (meshwidth minchowidth))
	 (w (times meshsize 0.5 dotsize))
	 (p0 (grid (car points) dotsize))
	 (p1 (grid (cadr points) dotsize))
	 (len (metric2 p0 p1)))
    (mincho1 
     p0 
     p1
     '((80 171 136 255)
       ((angle 80 171)(bezier 119 214)(bezier 104 256)(angle 136 255))
       ((angle 80 171)(bezier 155 204)(bezier 173 251)(angle 136 255)))
     (cond ((lessp (times 3.0 w) len)
	    (quotient w 20.0))
	   (t (quotient len 60.0))))))
;
; 縦棒の定義
;
(defelement mincho tate
    (lets ((dotsize (meshwidth minchowidth))
	   (w (times meshsize 0.5 dotsize))
	   (p0 (gridx (car points) dotsize))
	   (p1 (gridx (cadr points) dotsize)))
      (cond ((lessp (times 0.08 w) meshsize)
	     (line2 p0 p1 w))
	    (t
	     (niku2 p0 p1 0.4 0.4 w (times w 0.92)(times w 0.92) w)))))
;
; 横棒の定義
;
(defelement mincho yoko
  (lets ((dotsize (meshwidth (times minchowidth tateyokoratio)))
	 (w (times 0.5 meshsize dotsize))
	 (p0 (gridy (car points) dotsize))
	 (p1 (gridy (cadr points) dotsize)))
    (cond ((lessp (times 0.2 w) meshsize)
	   (line2 p0 p1 w))
	  (t
	   (niku2 p0 p1 0.3 0.3 w (times w 0.8)(times w 0.8) w)))))
;
; 右上はらいの定義
;
(defelement mincho migiue
  (lets ((dotsize (meshwidth minchowidth))
	 (w0 (times meshsize 0.5 dotsize))
	 (w1 (times meshsize 0.5))
      	 (p0 (gridy (car points) dotsize))
	 (p1 (gridy (cadr points) dotsize))
	 (p2 (gridy (caddr points) 1)))
    (niku3 p0 p1 p2 0.3 0.3 w0 (inter w0 w1 0.3)(inter w0 w1 0.7) w1)))
;
; 右はらいの定義
;
(defelement mincho migi
  (lets ((dotsize0 (meshwidth (times minchowidth 0.2)))
	 (w0 (times meshsize 0.5 dotsize0))
	 (dotsize1 (meshwidth (times minchowidth 1.0)))
	 (w1 (times meshsize 0.5 dotsize1))
	 (p0 (grid (car points) dotsize0))
	 (p1 (cadr points))
	 (p2 (grid (caddr points) dotsize1)))
    (niku3 p0 p1 p2 0.3 0.3 
	   w0 (inter w0 w1 0.25)(inter w0 w1 0.75) w1)))
;
;しんにょう
;
(defelement mincho shin-nyuu
    (lets 
     ((dotsize0 (meshwidth (times minchowidth 0.2)))
      (w0 (times meshsize 0.5 dotsize0))
      (dotsize1 (meshwidth (times minchowidth 1.1)))
      (w1 (times meshsize 0.5 dotsize1))
      (p0 (grid (car points) dotsize0))
      (p1 (cadr points))
      (p2 (grid (caddr points) dotsize1))
      (len0 (metric2 p0 p1))
      (len1 (metric2 p1 p2))
      (len (plus len0 len1)))
     (curve2 p0 (inter2 p0 p1 0.5)(inter2 p2 p1 0.9) p2
	     w0 (inter w0 w1 0.2) w1 w1)))
;
; まがりたて 
;
(defelement mincho magaritate
  (lets ((dotsize (meshwidth minchowidth))
	 (w0 (times meshsize 0.5 dotsize))
	 (w1 (times w0 0.9))
	 (p0 (grid (car points) dotsize))
	 (p1 (cadr points))
	 (p2 (grid (caddr points) dotsize)))
    (curve2 p0 (inter2 p0 p1 0.7)(inter2 p2 p1 0.7) p2 w0 w1 w1 w0)))
;
; かぎ
;
(defelement mincho kagi
  (lets ((dotsize0 (meshwidth minchowidth))
	 (w0 (times meshsize 0.5 dotsize0))
	 (dotsize1 (meshwidth (times 1.0 minchowidth)))
	 (w1 (times meshsize 0.5 dotsize1))
	 (p0 (gridx (car points) dotsize0))
	 (l0 (normlen2 w1 (rot90 (diff2 (caddr points)(cadr points)))))
	 (p1 (gridx (gridy (plus2 (cadr points) l0) dotsize1) dotsize0))
	 (p2 (gridy (plus2 (caddr points) l0) dotsize1))
	 (len0 (metric2 p0 p1))
	 (len1 (metric2 p1 p2))
	 (rate0 (min 0.9 (//$ (times w0 4.0) len0)))
	 (rate1 (min 0.9 (//$ (times w1 4.0) len1)))
	 (p01 (inter2 p1 p0 rate0))
	 (p12 (inter2 p1 p2 rate1)))
    (line2 p0 p01 w0
	   (curve2 p01 (inter2 p1 p01 0.1)(inter2 p1 p12 0.1) p12 w0 w0 w1 w1
		   (line2 p12 p2 w1)))))
; 縦左はらいの定義
(defelement mincho tatehidari
  (lets ((dotsize (meshwidth minchowidth))
	 (w (times meshsize 0.5 dotsize))
	 (p0 (grid (car points) dotsize))
	 (p1 (grid (cadr points) dotsize))
	 (p2 (grid (caddr points) dotsize))
	 (p3 (grid (cadddr points) dotsize))
	 (l0 (normlen2 w (rot90 (diff2 p0 p1))))
	 (w1 (//$ w (float (costheta l0 (diff2 p3 p2)))))
	 (l1 (plus2 (normlen2 w1 (diff2 p3 p2))
		    (normlen2 w1 (diff2 p1 p2)))))
    `(((angle .,(plus2 p0 l0))
       (angle .,(plus2 p1 l0))
       (bezier .,(plus2 (inter2 p1 p2 0.5) l0))
       (bezier .,(plus2 p2 l1))
       (angle .,p3))
      ((angle .,(diff2 p0 l0))
       (angle .,(diff2 p1 l0))
       (bezier .,(diff2 (inter2 p1 p2 0.5) l0))
       (bezier .,(diff2 p2 l1))
       (angle .,p3)))))
; こころ
; こざと偏の一部
; 縦跳ね
; 旁の跳ね
; たすき

; さんずい
; 左はらいの定義

ktanaka

Powered by ViewCVS 1.0-dev

ViewCVS and CVS Help