changeset 88483:b6df31da4a9e

(fontset-plain-name): Handle the case that size, weight, slant are not specified in the fontset name.
author Kenichi Handa <handa@m17n.org>
date Mon, 13 May 2002 13:01:22 +0000
parents effba1417b74
children 3667d64a1787
files lisp/international/fontset.el
diffstat 1 files changed, 15 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/international/fontset.el	Mon May 13 12:09:57 2002 +0000
+++ b/lisp/international/fontset.el	Mon May 13 13:01:22 2002 +0000
@@ -415,21 +415,23 @@
 	  (if (not (string-match "^fontset-\\(.*\\)$" nickname))
 	      fontset
 	    (setq nickname (match-string 1 nickname))
-	    (if (> (string-to-int size) 0)
+	    (if (and (integerp size) (> (string-to-int size) 0))
 		(setq name (format "%s: %s-dot" nickname size))
 	      (setq name nickname))
-	    (cond ((string-match "^medium$" weight)
-		   (setq name (concat name " " "medium")))
-		  ((string-match "^bold$\\|^demibold$" weight)
-		   (setq name (concat name " " weight))))
-	    (cond ((string-match "^i$" slant)
-		   (setq name (concat name " " "italic")))
-		  ((string-match "^o$" slant)
-		   (setq name (concat name " " "slant")))
-		  ((string-match "^ri$" slant)
-		   (setq name (concat name " " "reverse italic")))
-		  ((string-match "^ro$" slant)
-		   (setq name (concat name " " "reverse slant"))))
+	    (and weight
+		 (cond ((string-match "^medium$" weight)
+			(setq name (concat name " " "medium")))
+		       ((string-match "^bold$\\|^demibold$" weight)
+			(setq name (concat name " " weight)))))
+	    (and slant
+		 (cond ((string-match "^i$" slant)
+			(setq name (concat name " " "italic")))
+		       ((string-match "^o$" slant)
+			(setq name (concat name " " "slant")))
+		       ((string-match "^ri$" slant)
+			(setq name (concat name " " "reverse italic")))
+		       ((string-match "^ro$" slant)
+			(setq name (concat name " " "reverse slant")))))
 	    name))
       fontset)))