From 387b6dfd286a069e592b821dba9b7b0ef1753794 Mon Sep 17 00:00:00 2001 From: MORIOKA Tomohiko Date: Mon, 22 Feb 2021 16:06:39 +0900 Subject: [PATCH] (chise-wiki-bitmap-glyph-image-url): New variable. (chise-wiki-legacy-bitmap-glyphs-url): Renamed from `chise-wiki-bitmap-glyphs-url'; use "https://www.chise.org/glyphs" instead of "http://www.chise.org/glyphs". (chise-wiki-hng-bitmap-glyphs-url): Use "https://image.hng-data.org/glyphs/HNG" instead of "http://hng.chise.org/glyphs/HNG". (chise-wiki-daijiten-bitmap-glyphs-url): Use "https://image.hng-data.org/glyphs/daijiten" instead of "http://hng.chise.org/glyphs/daijiten". (chise-wiki-glyph-cgi-url): Use "https://www.chise.org/chisewiki/glyph.cgi" instead of "http://www.chise.org/chisewiki/glyph.cgi". (www-format-encode-string): - Add settings for `=>>daikanwa' and `===ucs@ks'. - Use `chise-wiki-legacy-bitmap-glyphs-url' instead of `chise-wiki-bitmap-glyphs-url'. - Use `chise-wiki-bitmap-glyph-image-url' for glyph-image path of JEF-CHINA3 instead of http://kanji.zinbun.kyoto-u.ac.jp/db/CHINA3/Gaiji/; use JEF-CHINA3/.png instead of CHINA3/Gaiji/.gif. - Use https://mojikiban.ipa.go.jp/ instead of http://mojikiban.ipa.go.jp/. - Use chise-wiki-glyphwiki-glyph-image-url instead of "http://glyphwiki.org/glyph"; use SVG instead of 100px PNG. - Add setting for &(o-|G-|g2-|R-)KU(+|-);. - Use "https://www.unicode.org/cgi-bin/refglyph?24-" instead of "http://www.unicode.org/cgi-bin/refglyph?24-". (coded-charset-GlyphWiki-id-alist): Add setting for `===jis-x0208@1978'. --- cwiki-common.el | 89 ++++++++++++++++++++++++++++++++++++------------------- 1 file changed, 59 insertions(+), 30 deletions(-) diff --git a/cwiki-common.el b/cwiki-common.el index 289cb9b..81892db 100644 --- a/cwiki-common.el +++ b/cwiki-common.el @@ -69,17 +69,23 @@ (defvar chise-wiki-view-url "view.cgi") (defvar chise-wiki-edit-url "edit.cgi") -(defvar chise-wiki-bitmap-glyphs-url - "http://www.chise.org/glyphs") +(defvar chise-wiki-bitmap-glyph-image-url + "https://image.chise.org/glyphs") + +(defvar chise-wiki-legacy-bitmap-glyphs-url + "https://www.chise.org/glyphs") (defvar chise-wiki-hng-bitmap-glyphs-url - "http://hng.chise.org/glyphs/HNG") + "https://image.hng-data.org/glyphs/HNG") (defvar chise-wiki-daijiten-bitmap-glyphs-url - "http://hng.chise.org/glyphs/daijiten") + "https://image.hng-data.org/glyphs/daijiten") + +(defvar chise-wiki-glyphwiki-glyph-image-url + "https://glyphwiki.org/glyph") (defvar chise-wiki-glyph-cgi-url - "http://www.chise.org/chisewiki/glyph.cgi") + "https://www.chise.org/chisewiki/glyph.cgi") (defvar chise-wiki-displayed-features nil) @@ -907,6 +913,8 @@ '(==cbeta "CB" 5 d) '(=big5 "B-" 4 X) '(=daikanwa "M-" 5 d) + '(=>>daikanwa "G-M-" 5 d) + '(===ucs@ks "R-KU+" 4 X) coded-charset-entity-reference-alist))) (encode-coding-region (point-min)(point-max) 'utf-8-mcs-er) @@ -917,7 +925,7 @@ (format "\"CB%05d\"" code - chise-wiki-bitmap-glyphs-url + chise-wiki-legacy-bitmap-glyphs-url (/ code 1000) code www-format-char-img-style) t 'literal)) @@ -930,7 +938,7 @@ style=\"%s\">" (format "\"J%s-%04X\"" plane code - chise-wiki-bitmap-glyphs-url + chise-wiki-legacy-bitmap-glyphs-url plane (- (lsh code -8) 32) (- (logand code 255) 32) @@ -944,7 +952,7 @@ style=\"%s\">" (format "\"J0-%04X\"" code - chise-wiki-bitmap-glyphs-url + chise-wiki-legacy-bitmap-glyphs-url (- (lsh code -8) 32) (- (logand code 255) 32) www-format-char-img-style) @@ -958,7 +966,7 @@ style=\"%s\">" (format "\"HD-%s-%04X\"" plane code - chise-wiki-bitmap-glyphs-url + chise-wiki-legacy-bitmap-glyphs-url plane (- (lsh code -8) 32) (- (logand code 255) 32) @@ -973,7 +981,7 @@ style=\"%s\">" (format "\"HD-%s-%04X\"" plane code - chise-wiki-bitmap-glyphs-url + chise-wiki-legacy-bitmap-glyphs-url plane code www-format-char-img-style) t 'literal)) @@ -985,7 +993,7 @@ style=\"%s\">" (format "\"HD-KS%06d\"" code - chise-wiki-bitmap-glyphs-url + chise-wiki-legacy-bitmap-glyphs-url code www-format-char-img-style) t 'literal)) @@ -997,7 +1005,7 @@ style=\"vertical-align:middle\">" (format "\"HD-KS%06d\"" code - chise-wiki-bitmap-glyphs-url + chise-wiki-legacy-bitmap-glyphs-url code www-format-char-img-style) t 'literal)) @@ -1010,7 +1018,7 @@ style=\"vertical-align:middle\">" (format "\"GB%d-%04X\"" plane code - chise-wiki-bitmap-glyphs-url + chise-wiki-legacy-bitmap-glyphs-url plane (- (lsh code -8) 32) (- (logand code 255) 32) @@ -1025,7 +1033,7 @@ style=\"%s\">" (format "\"CNS%d-%04X\"" plane code - chise-wiki-bitmap-glyphs-url + chise-wiki-legacy-bitmap-glyphs-url plane code www-format-char-img-style) t 'literal)) @@ -1034,8 +1042,8 @@ style=\"%s\">" (while (re-search-forward "&\\(R-\\)?JC3-\\([0-9A-F][0-9A-F][0-9A-F][0-9A-F]\\);" nil t) (setq code (string-to-int (match-string 2) 16)) (replace-match - (format "\"JC3-%04X\"" - code code) + (format "\"JC3-%04X\"" + code chise-wiki-bitmap-glyph-image-url code) t 'literal)) (goto-char (point-min)) @@ -1045,7 +1053,7 @@ style=\"%s\">" (format "\"ZOB-%04d\"" code - chise-wiki-bitmap-glyphs-url + chise-wiki-legacy-bitmap-glyphs-url code www-format-char-img-style) t 'literal)) @@ -1075,7 +1083,7 @@ style=\"vertical-align:middle; width: auto; max-height: 60px\">" style=\"vertical-align:middle; width: auto; max-height: 80px\">%s" plane code - chise-wiki-bitmap-glyphs-url + chise-wiki-legacy-bitmap-glyphs-url plane code (charset-description (if (string= subcode "") @@ -1115,7 +1123,7 @@ class=\"tooltiptext\">%s" (format "\"AJ1-%05d\"" code - chise-wiki-bitmap-glyphs-url + chise-wiki-legacy-bitmap-glyphs-url code www-format-char-img-style) t 'literal)) @@ -1124,7 +1132,7 @@ style=\"vertical-align:middle\">" (while (re-search-forward "&\\(A-\\|o-\\|G-\\|g2-\\|R-\\)?MJ\\([0-9]+\\);" nil t) (setq code (string-to-int (match-string 2))) (replace-match - (format "\"MJ%06d\"" code code @@ -1135,9 +1143,22 @@ style=\"vertical-align:middle; width: 48px; height: 48px\">" (while (re-search-forward "&\\(o-\\|G-\\|g2-\\)?IU[+-]\\([0-9A-F]+\\);" nil t) (setq code (string-to-int (match-string 2) 16)) (replace-match - (format "\"u%04x\"" + code + chise-wiki-glyphwiki-glyph-image-url + code + www-format-char-img-style) + t 'literal)) + + (goto-char (point-min)) + (while (re-search-forward "&\\(o-\\|G-\\|g2-\\|R-\\)?KU[+-]\\([0-9A-F]+\\);" nil t) + (setq code (string-to-int (match-string 2) 16)) + (replace-match + (format "\"u%04x-k\"" code + chise-wiki-glyphwiki-glyph-image-url code www-format-char-img-style) t 'literal)) @@ -1146,9 +1167,10 @@ style=\"vertical-align:middle; width: 48px; height: 48px\">" (while (re-search-forward "&A-\\(comp\\|cgn\\)U[+-]\\([0-9A-F]+\\);" nil t) (setq code (string-to-int (match-string 2) 16)) (replace-match - (format "\"u%04x\"" code + chise-wiki-glyphwiki-glyph-image-url code www-format-char-img-style) t 'literal)) @@ -1160,10 +1182,11 @@ style=\"vertical-align:middle; width: 48px; height: 48px\">" (setq plane (string-to-int (match-string 2)) code (string-to-int (match-string 3) 16)) (replace-match - (format "\"u%04x-itaiji-%03d\"" code plane + chise-wiki-glyphwiki-glyph-image-url code plane www-format-char-img-style) @@ -1173,9 +1196,10 @@ style=\"vertical-align:middle; width: 48px; height: 48px\">" (while (re-search-forward "&A-IWDSU\\+\\([0-9A-F]+\\);" nil t) (setq code (string-to-int (match-string 1) 16)) (replace-match - (format "\"A-IWDSU+%04x\"" code + chise-wiki-glyphwiki-glyph-image-url code www-format-char-img-style) t 'literal)) @@ -1187,10 +1211,11 @@ style=\"vertical-align:middle; width: 48px; height: 48px\">" (setq plane (string-to-int (match-string 2)) code (string-to-int (match-string 3) 16)) (replace-match - (format "\"cdp-%04x-itaiji-%03d\"" code plane + chise-wiki-glyphwiki-glyph-image-url code plane www-format-char-img-style) @@ -1203,10 +1228,11 @@ style=\"vertical-align:middle; width: 48px; height: 48px\">" (setq plane (string-to-int (match-string 2)) code (string-to-int (match-string 3) 16)) (replace-match - (format "\"cdp-%04x-var-%03d\"" code plane + chise-wiki-glyphwiki-glyph-image-url code plane www-format-char-img-style) @@ -1214,13 +1240,14 @@ style=\"vertical-align:middle; width: 48px; height: 48px\">" (goto-char (point-min)) (while (re-search-forward - "&\\(A-\\|g2-\\)?M-\\([0-9]+\\);" + "&\\(A-\\|G-\\|g2-\\|R-\\)?M-\\([0-9]+\\);" nil t) (setq code (string-to-int (match-string 2))) (replace-match - (format "\"dkw-%05d\"" code + chise-wiki-glyphwiki-glyph-image-url code www-format-char-img-style) t 'literal)) @@ -1230,10 +1257,11 @@ style=\"vertical-align:middle; width: 48px; height: 48px\">" (setq plane (string-to-int (match-string 2)) code (string-to-int (match-string 3) 16)) (replace-match - (format "\"u%04x-var-%03d\"" code plane + chise-wiki-glyphwiki-glyph-image-url code plane www-format-char-img-style) @@ -1332,7 +1360,7 @@ style=\"vertical-align:middle\">" (while (re-search-forward "&\\(A-\\|G-\\|g2-\\|R-\\)?\\(UU\\+\\|U-\\)\\([0-9A-F]+\\);" nil t) (setq code (string-to-int (match-string 3) 16)) (replace-match - (format "\"UU+%04X\"" code code @@ -1432,6 +1460,7 @@ style=\"vertical-align:middle\">" (===ucs@jis "u" 4 x "-j") (===daikanwa "dkw-" 5 d nil) (===ucs@ks "u" 4 x "-k") + (===jis-x0208@1978 "j78-" 4 x nil) (==ucs-itaiji-005 "u" 4 x "-itaiji-005") (=ucs-var-001 "u" 4 x "-var-001") (=ucs-var-002 "u" 4 x "-var-002") -- 1.7.10.4