(est-eval-value-as-ids): New implementation.
[chise/est.git] / cwiki-glyph.el
index 78aec8d..9fcbaa0 100644 (file)
@@ -7,6 +7,15 @@
     (setq size 40))
   (let (png-file dir font char ret plain)
     (cond
+     ((eq ccs '=ucs@JP/hanazono)
+      (setq font
+           (if (<= code-point 65535)
+               "/usr/local/share/fonts/TrueType/Hanazono/HanaMinA.ttf"
+             "/usr/local/share/fonts/TrueType/Hanazono/HanaMinB.ttf"))
+      (setq char (decode-char '=ucs code-point)
+           png-file (format "/opt/chisewiki/glyphs/%d/Hanazono/u%04X.png"
+                            size code-point))
+      )
      ((eq ccs '=gt)
       (setq char (decode-char '=gt code-point)
            png-file (format "/opt/chisewiki/glyphs/%d/GT/%05d.png"
       (when (setq ret (encode-char char '=ucs@jis/1990))
        (setq char (decode-char '=ucs ret)))
       )
+     ((eq ccs '=gt-k)
+      (setq char (decode-char '=gt-k code-point)
+           png-file (format "/opt/chisewiki/glyphs/%d/GT-K/%05d.png"
+                            size code-point))
+      (setq plain 1)
+      (while (and (<= plain 11)
+                 (null
+                  (setq ret (encode-char
+                             char
+                             (intern (format "=gt-pj-k%d" plain))))))
+       (setq plain (1+ plain)))
+      (setq font (format
+                 "/usr/local/share/fonts/TrueType/GT/gt2000k%d.ttf"
+                 plain)
+           char (decode-char '=jis-x0208@1990 ret))
+      (when (setq ret (encode-char char '=ucs@jis/1990))
+       (setq char (decode-char '=ucs ret)))
+      )
      ((eq ccs '=big5)
       (setq font "/usr/local/share/fonts/TrueType/Arphic/bsmi00lp.ttf"
            char (decode-char '=big5 code-point)
            char (decode-char '=big5-pua code-point)
            png-file (format "/opt/chisewiki/glyphs/%d/CDP/%04X.png"
                             size code-point))
+      )
+     ((eq ccs '=ruimoku-v6)
+      (setq font "/usr/local/share/fonts/TrueType/Zinbun/rui6-eudc.ttf"
+           char (decode-char '=ucs code-point)
+           png-file (format "/opt/chisewiki/glyphs/%d/Ruimoku-v6/%04X.png"
+                            size code-point))
       ))
     (when font
       (if (= (call-process
     (setq size (string-to-int size)))
   (let ((png-file
         (cond
+         ((string-match "^hana-JU\\+\\([0-9A-F]+\\)" char-rep)
+          (www-glyph-generate-png
+           '=ucs@JP/hanazono
+           (string-to-int (match-string 1 char-rep) 16)
+           size)
+          )
          ((string-match "^GT-\\([0-9]+\\)" char-rep)
           (www-glyph-generate-png
            '=gt
            (string-to-int (match-string 1 char-rep))
            size)
           )
+         ((string-match "^GT-K\\([0-9]+\\)" char-rep)
+          (www-glyph-generate-png
+           '=gt-k
+           (string-to-int (match-string 1 char-rep))
+           size)
+          )
          ((string-match "^B-\\([0-9A-F]+\\)" char-rep)
           (www-glyph-generate-png
            '=big5
            '=big5-cdp
            (string-to-int (match-string 1 char-rep) 16)
            size)
+          )
+         ((string-match "^RUI6-\\([0-9A-F]+\\)" char-rep)
+          (www-glyph-generate-png
+           '=ruimoku-v6
+           (string-to-int (match-string 1 char-rep) 16)
+           size)
           ))
         ))
     (when png-file