(www-display-object-desc): For each character object to represent HNG
authorMORIOKA Tomohiko <tomo.git@chise.org>
Wed, 29 Jun 2016 08:11:13 +0000 (17:11 +0900)
committerMORIOKA Tomohiko <tomo.git@chise.org>
Wed, 29 Jun 2016 08:11:13 +0000 (17:11 +0900)
glyph-image, generate features `sources@HNG/card' and
`sources@zinbun/takuhon' and display them.

cwiki-view.el

index 3a76163..da0447d 100644 (file)
@@ -68,7 +68,7 @@ size=\"64\" maxlength=\"256\" value=\"%s\">
        without-header
        logical-feature chise-wiki-displayed-features
        parents
-       GlyphWiki-id HNG-card ret object-spec
+       GlyphWiki-id HNG-card HNG-card-id HNG-card-cobj ret object-spec
        width height image-cobj base-image x y w h)
     (if (eq level 0)
        (setq level 1
@@ -306,12 +306,15 @@ style=\"height: 480px;\" />"
        (t
        (setq ret (www-format-encode-string
                   (est-format-object object 'readable)))
-       (setq HNG-card
-             (if (string-match
-                  "<img alt=\"HNG\\([0-9]+\\)-\\([0-9]+\\)[a-z]?\"" ret)
-                 (format "hng-card/rep.id=%d-%d"
-                         (string-to-int (match-string 1 ret))
-                         (string-to-int (match-string 2 ret)))))
+       (when (string-match
+              "<img alt=\"HNG\\([0-9]+\\)-\\([0-9]+\\)[a-z]?\"" ret)
+         (setq HNG-card-id
+               (intern
+                (format "%d-%d"
+                        (string-to-int (match-string 1 ret))
+                        (string-to-int (match-string 2 ret)))))
+         (setq HNG-card
+               (format "hng-card/rep.id=%s" HNG-card-id)))
        (princ
         (format "<h%d>%s%s</h%d>\n"
                 level
@@ -350,6 +353,18 @@ size=\"30\" maxlength=\"30\" value=\"%s\">)</p>
                  genre genre
                  (decode-uri-string uri-object 'utf-8-mcs-er))
          'utf-8-mcs-er)))
+      (when (and HNG-card-id
+                (eq genre 'character)
+                (setq HNG-card-cobj
+                      (concord-decode-object
+                       '=id HNG-card-id
+                       'hng-card)))
+       (put-char-attribute object 'sources@HNG/card (list HNG-card-cobj))
+       (if (setq ret (concord-object-get
+                      HNG-card-cobj
+                      '->glyph-image@zinbun/takuhon))
+           (put-char-attribute object 'sources@zinbun/takuhon ret))
+       )
       (setq object-spec
            (cond
             (uri-feature-name