changeset 17195:9c0c6ae6dcad

(x-complement-fontset-spec): Setup alternative-fontname-alist while complementing fontnames.
author Kenichi Handa <handa@m17n.org>
date Wed, 19 Mar 1997 16:38:41 +0000
parents ae76b2a59dcc
children 1b2490698826
files lisp/international/fontset.el
diffstat 1 files changed, 28 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/international/fontset.el	Wed Mar 19 16:33:48 1997 +0000
+++ b/lisp/international/fontset.el	Wed Mar 19 16:38:41 1997 +0000
@@ -222,25 +222,40 @@
 Fontnames for charsets not listed in FONTLIST are generated from
 XLFD-FIELDS and a property of x-charset-register of each charset
 automatically."
-  (let ((charsets charset-list))
+  (let ((charsets charset-list)
+	(loose-xlfd-fields (copy-sequence xlfd-fields)))
+    (aset loose-xlfd-fields xlfd-regexp-pixelsize-subnum nil)
+    (aset loose-xlfd-fields xlfd-regexp-pointsize-subnum nil)
+    (aset loose-xlfd-fields xlfd-regexp-resx-subnum nil)
+    (aset loose-xlfd-fields xlfd-regexp-resy-subnum nil)
+    (aset loose-xlfd-fields xlfd-regexp-spacing-subnum nil)
+    (aset loose-xlfd-fields xlfd-regexp-avgwidth-subnum nil)
     (while charsets
       (let ((charset (car charsets)))
 	(if (null (assq charset fontlist))
 	    (let ((registry (get-charset-property charset
-						  'x-charset-registry)))
+						  'x-charset-registry))
+		  registry-val encoding-val fontname loose-fontname)
 	      (if (string-match "-" registry)
 		  ;; REGISTRY contains `CHARSET_ENCODING' field.
-		  (progn
-		    (aset xlfd-fields xlfd-regexp-registry-subnum
-			  (substring registry 0 (match-beginning 0)))
-		    (aset xlfd-fields xlfd-regexp-encoding-subnum
-			  (substring registry (match-end 0))))
-		(aset xlfd-fields xlfd-regexp-registry-subnum
-		      (concat registry "*"))
-		(aset xlfd-fields xlfd-regexp-encoding-subnum "*"))
-	      (setq fontlist
-		    (cons (cons charset (x-compose-font-name xlfd-fields t))
-			  fontlist)))))
+		  (setq registry-val (substring registry 0 (match-beginning 0))
+			encoding-val (substring registry (match-end 0)))
+		(setq registry-val (concat registry "*")
+		      encoding-val "*"))
+	      (aset xlfd-fields xlfd-regexp-registry-subnum registry-val)
+	      (aset xlfd-fields xlfd-regexp-encoding-subnum encoding-val)
+	      (aset loose-xlfd-fields xlfd-regexp-registry-subnum registry-val)
+	      (aset loose-xlfd-fields xlfd-regexp-encoding-subnum encoding-val)
+	      (setq fontname (x-compose-font-name xlfd-fields t))
+	      (setq fontlist (cons (cons charset fontname) fontlist))
+	      (or (assoc fontname alternative-fontname-alist)
+		  (setq alternative-fontname-alist
+			(cons (list
+			       fontname
+			       (x-compose-font-name loose-xlfd-fields t)
+			       (concat "*-" registry-val "-" encoding-val))
+			      alternative-fontname-alist)))
+	      )))
       (setq charsets (cdr charsets))))
   fontlist)