X-Git-Url: http://git.chise.org/gitweb/?a=blobdiff_plain;f=www%2Fwww-ids-find.el;h=1dce832793de8353af081e476a306c0b40b62347;hb=2fadf24f129be384945dd64fdc7c80ff3e1fd8d3;hp=8c5b29a995658bf4471ac97807121fc2cbeea653;hpb=b8670993f9cc923f9d509ae0c5733f91e7542a2f;p=chise%2Fids.git diff --git a/www/www-ids-find.el b/www/www-ids-find.el index 8c5b29a..1dce832 100644 --- a/www/www-ids-find.el +++ b/www/www-ids-find.el @@ -1,4 +1,7 @@ (require 'ids-find) +(require 'cwiki-common) + +(setq www-format-char-img-style "vertical-align:middle;") (defun decode-url-string (string &optional coding-system) (if (> (length string) 0) @@ -15,7 +18,7 @@ (concat dest (substring string i)) coding-system)))) -(defconst www-ids-find-version "0.25.0") +(defconst www-ids-find-version "0.26") (defvar www-ids-find-ideographic-products-file-name (expand-file-name "ideographic-products" @@ -25,6 +28,9 @@ "character" chise-system-db-directory)))) +(defvar www-ids-find-char-viewer-url + "/est/view/character/") + (defvar www-ids-find-chise-link-map-url-prefix "http://fonts.jp/chise_linkmap/map.cgi?code=") @@ -32,93 +38,108 @@ "~tomo/projects/chise/ids/www/tang-chars.udd") (defun www-ids-find-format-char (c &optional code-desc) - (let ((str (encode-coding-string (format "%c" c) 'utf-8-er)) - plane code) - (princ - (with-temp-buffer - (cond - ((string-match "&CB\\([0-9]+\\);" str) - (setq code (string-to-int (match-string 1 str))) - (insert "\"CB%05d\"\n" - code (/ code 1000) code)) - (when code-desc - (insert (format "CB%05d" code))) - ) - ((string-match "&JC3-\\([0-9A-F]+\\);" str) - (setq code (string-to-int (match-string 1 str) 16)) - (insert "\"JC3-%04X\"\n" - code code)) - (when code-desc - (insert (format "JC3-%04X" code))) - ) - ((string-match "&J\\(78\\|83\\|90\\|SP\\)-\\([0-9A-F]+\\);" str) - (setq plane (match-string 1 str) - code (string-to-int (match-string 2 str) 16)) - (insert "\"J%s-%04X\"\n" - plane code plane - (- (lsh code -8) 32) - (- (logand code 255) 32))) - (when code-desc - (insert (format "J%s-%04X" plane code))) - ) - ((string-match "&G\\([01]\\)-\\([0-9A-F]+\\);" str) - (setq plane (string-to-int (match-string 1 str)) - code (string-to-int (match-string 2 str) 16)) - (insert "\"G%d-%04X\"\n" - plane code plane - (- (lsh code -8) 32) - (- (logand code 255) 32))) - (when code-desc - (insert (format "G%d-%04X" plane code))) - ) - ((string-match "&C\\([1-7]\\)-\\([0-9A-F]+\\);" str) - (setq plane (string-to-int (match-string 1 str)) - code (string-to-int (match-string 2 str) 16)) - (insert "\"C%d-%04X\"\n" - plane code plane code)) - (when code-desc - (insert (format "C%d-%04X" plane code))) - ) - ((string-match "&ZOB-\\([0-9]+\\);" str) - (setq code (string-to-int (match-string 1 str))) - (insert "\"ZOB-%04d\"\n" - code code)) - (when code-desc - (insert (format "ZOB-%04d" code))) - ) - (t - (insert "") - (insert str) - (insert "") - )) - (goto-char (point-min)) - (while (search-forward "&" nil t) - (replace-match "&" t 'literal)) - (buffer-string))))) + (princ + (format "%s" + www-ids-find-char-viewer-url + (www-uri-encode-object c) + (www-format-encode-string (char-to-string c)))) + ;; (let ((str (encode-coding-string (format "%c" c) 'utf-8-er)) + ;; plane code) + ;; (princ + ;; (with-temp-buffer + ;; (cond + ;; ((string-match "&CB\\([0-9]+\\);" str) + ;; (setq code (string-to-int (match-string 1 str))) + ;; (insert (format "\"CB%05d\"\n" + ;; code (/ code 1000) code)) + ;; (when code-desc + ;; (insert (format "CB%05d" code))) + ;; ) + ;; ((string-match "&JC3-\\([0-9A-F]+\\);" str) + ;; (setq code (string-to-int (match-string 1 str) 16)) + ;; (insert (format "\"JC3-%04X\"\n" + ;; code code)) + ;; (when code-desc + ;; (insert (format "JC3-%04X" code))) + ;; ) + ;; ((string-match "&J\\(78\\|83\\|90\\|SP\\)-\\([0-9A-F]+\\);" str) + ;; (setq plane (match-string 1 str) + ;; code (string-to-int (match-string 2 str) 16)) + ;; (insert (format "\"J%s-%04X\"\n" + ;; plane code plane + ;; (- (lsh code -8) 32) + ;; (- (logand code 255) 32))) + ;; (when code-desc + ;; (insert (format "J%s-%04X" plane code))) + ;; ) + ;; ((string-match "&G\\([01]\\)-\\([0-9A-F]+\\);" str) + ;; (setq plane (string-to-int (match-string 1 str)) + ;; code (string-to-int (match-string 2 str) 16)) + ;; (insert (format "\"G%d-%04X\"\n" + ;; plane code plane + ;; (- (lsh code -8) 32) + ;; (- (logand code 255) 32))) + ;; (when code-desc + ;; (insert (format "G%d-%04X" plane code))) + ;; ) + ;; ((string-match "&C\\([1-7]\\)-\\([0-9A-F]+\\);" str) + ;; (setq plane (string-to-int (match-string 1 str)) + ;; code (string-to-int (match-string 2 str) 16)) + ;; (insert (format "\"C%d-%04X\"\n" + ;; plane code plane code)) + ;; (when code-desc + ;; (insert (format "C%d-%04X" plane code))) + ;; ) + ;; ((string-match "&ZOB-\\([0-9]+\\);" str) + ;; (setq code (string-to-int (match-string 1 str))) + ;; (insert (format "\"ZOB-%04d\"\n" + ;; code code)) + ;; (when code-desc + ;; (insert (format "ZOB-%04d" code))) + ;; ) + ;; (t + ;; (insert (format "") + ;; (insert str) + ;; (insert "") + ;; )) + ;; (goto-char (point-min)) + ;; (while (search-forward "&" nil t) + ;; (replace-match "&" t 'literal)) + ;; (buffer-string)))) + ) (defun www-ids-find-format-line (c is) (let (ucs len i ids) + (princ "") (www-ids-find-format-char c 'code-desc) + (princ "") (princ (or (if (setq ucs (or (char-ucs c) (encode-char c 'ucs))) @@ -139,9 +160,11 @@ (setq ids (ideographic-structure-to-ids is)) (setq i 0 len (length ids)) + (princ "") (while (< i len) (www-ids-find-format-char (aref ids i)) - (setq i (1+ i)))) + (setq i (1+ i))) + (princ "")) (when (and ucs (with-current-buffer (find-file-noselect @@ -266,6 +289,18 @@ CHISE IDS Find + @@ -358,11 +393,11 @@ href=\"http://www.shuiren.org/\">睡人亭)による解説