From: tomo Date: Wed, 12 Jan 2005 04:21:29 +0000 (+0000) Subject: (chise-tex-coded-charset-expression-alist): Add settings for X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8bdde1859342459788e9dfa530b00ea03d849e4b;p=chise%2Fomega.git (chise-tex-coded-charset-expression-alist): Add settings for `=ucs-hangul' and `=ucs@jis/2000'; prefer `=ucs@ks' than `=gt-pj-*'. (chise-tex-encode-region-for-jis): Add settings for JIS X 0213 characters, Hangul characters, U+2022 and U+0294; use GB domain characters as a fallback. --- diff --git a/chise2otf/elisp/chise-tex.el b/chise2otf/elisp/chise-tex.el index b580985..8cb81a3 100644 --- a/chise2otf/elisp/chise-tex.el +++ b/chise2otf/elisp/chise-tex.el @@ -25,8 +25,11 @@ ;;; Code: (defvar chise-tex-coded-charset-expression-alist - '((=ucs@gb "UCSgb" 4 X) + '((=ucs-hangul "UCShang" 4 X) + (=ucs@gb "UCSgb" 4 X) (=ucs@jis "UCSjis" 4 X) + (=ucs@jis/2000 "UCSjis" 4 X) + (=ucs@ks "UCSks" 4 X) (=gt-pj-1 "GTpj1" 4 X) (=gt-pj-2 "GTpj2" 4 X) (=gt-pj-3 "GTpj3" 4 X) @@ -38,7 +41,6 @@ (=gt-pj-9 "GTpj9" 4 X) (=gt-pj-10 "GTpj10" 4 X) (=gt-pj-11 "GTpj11" 4 X) - (=ucs@ks "UCSks" 4 X) (=ucs@cns "UCScns" 4 X))) (defun chise-tex-encode-region-for-gb (start end) @@ -94,6 +96,32 @@ ;; ((setq ret (encode-char chr '=jis-x0208-1990)) ;; (delete-char) ;; (insert (decode-char '=jis-x0208-1983 ret))) + ((and (or (encode-char chr '=jis-x0213-1-2000) + (encode-char chr '=jis-x0213-2-2000)) + (setq ret (or (encode-char chr '=ucs@jis/2000) + (encode-char chr '=ucs@jis/fw)))) + (delete-char) + ;; (if (eq (char-before) ?《) + ;; (insert " ")) + (insert (format "\\UCSjis{%04X}" ret))) + ((setq ret (encode-char chr '=ucs-hangul)) + (delete-char) + ;; (if (eq (char-before) ?《) + ;; (insert " ")) + (insert (format "\\UCSks{%04X}" ret))) + ((eq chr ?\u2022) + (delete-char) + (insert "\\textbullet{}")) + ((eq chr ?\u0294) + (delete-char) + (insert "\\UCSjis{0294}")) + ((and (encode-char chr '=ucs@jp) + (setq ret (char-representative-of-domain chr 'gb)) + (setq ret (encode-char ret '=ucs@gb))) + (delete-char) + ;; (if (eq (char-before) ?《) + ;; (insert " ")) + (insert (format "\\UCSgb{%04X}" ret))) ((catch 'tag (setq rest chise-tex-coded-charset-expression-alist) (while (setq spec (car rest)) @@ -117,12 +145,11 @@ (save-restriction (narrow-to-region start end) (goto-char start) - (let (macro code ret ms me) + (let (macro code ret me rest spec) (while (re-search-forward "\\\\\\([a-zA-Z0-9]+\\){\\([0-9A-Fa-f]+\\)}" nil t) (setq macro (match-string 1) code (match-string 2) - ms (match-beginning 0) me (match-end 0)) (if (and (catch 'tag (setq rest chise-tex-coded-charset-expression-alist)