]> code.delx.au - gnu-emacs/commitdiff
Fill weight and slant fields of a fontset
authorKenichi Handa <handa@m17n.org>
Fri, 3 Jul 1998 04:39:22 +0000 (04:39 +0000)
committerKenichi Handa <handa@m17n.org>
Fri, 3 Jul 1998 04:39:22 +0000 (04:39 +0000)
generted from the specified ASCII font by values got from the
resolved ASCII font name.

lisp/term/x-win.el

index 46a05a51280ac45659aaa0893645fed5072b3a63..d9370a66536f345c1e3e4dc6c32fb7e7365a7bf3 100644 (file)
@@ -674,10 +674,10 @@ This is in addition to the primary selection.")
       (let ((font (or (cdr (assq 'font initial-frame-alist))
                      (cdr (assq 'font default-frame-alist))
                      (x-get-resource "font" "Font")))
-           xlfd-fields)
+           xlfd-fields resolved-name)
        (if (and font
                 (not (query-fontset font))
-                (x-resolve-font-name font)
+                (setq resolved-name (x-resolve-font-name font))
                 (setq xlfd-fields (x-decompose-font-name font)))
            (if (string= "fontset"
                         (aref xlfd-fields xlfd-regexp-registry-subnum))
@@ -703,6 +703,23 @@ This is in addition to the primary selection.")
                (aset xlfd-fields xlfd-regexp-family-subnum nil)
                (aset xlfd-fields xlfd-regexp-registry-subnum "fontset")
                (aset xlfd-fields xlfd-regexp-encoding-subnum "startup")
+               ;; The fontset name should have concrete values in
+               ;; weight and slant field.
+               (let ((weight (aref xlfd-fields xlfd-regexp-weight-subnum))
+                     (slant (aref xlfd-fields xlfd-regexp-slant-subnum))
+                     xlfd-temp)
+                 (if (or (not weight) (string-match "[*?]*" weight))
+                     (progn
+                       (setq xlfd-temp (x-decompose-font-name resolved-name))
+                       (aset xlfd-fields xlfd-regexp-weight-subnum
+                             (aref xlfd-temp xlfd-regexp-weight-subnum))))
+                 (if (or (not slant) (string-match "[*?]*" slant))
+                     (progn
+                       (or xlfd-temp
+                           (setq xlfd-temp
+                                 (x-decompose-font-name resolved-name)))
+                       (aset xlfd-fields xlfd-regexp-slant-subnum
+                             (aref xlfd-temp xlfd-regexp-slant-subnum)))))
                (setq fontset (x-compose-font-name xlfd-fields))
                (create-fontset-from-fontset-spec
                 (concat fontset ", ascii:" font) styles)