changeset 17763:9ba20cfe79f2

Create bold, italic, and bold-italic variants of default fontset. Name a fontset created from user-specified ASCII font as "fontset-startup".
author Kenichi Handa <handa@m17n.org>
date Mon, 12 May 1997 06:56:32 +0000
parents dfefaeb20c75
children 561a8476368f
files lisp/term/x-win.el
diffstat 1 files changed, 29 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/term/x-win.el	Mon May 12 06:56:27 1997 +0000
+++ b/lisp/term/x-win.el	Mon May 12 06:56:32 1997 +0000
@@ -650,37 +650,50 @@
     (progn
       ;; Create a default fontset.
       (create-fontset-from-fontset-spec default-fontset-spec)
+      ;; Create variants of a default fontset.
+      (create-fontset-from-fontset-spec default-fontset-spec 'bold)
+      (create-fontset-from-fontset-spec default-fontset-spec 'italic)
+      (create-fontset-from-fontset-spec default-fontset-spec 'bold-italic)
 
-      ;; Create fontset specified in X resources.
+      ;; Create fontset specified in X resources "Fontset-N" (N is 0, 1, ...).
       (create-fontset-from-x-resource)
 
-      ;; Try to create a fontset from font specification which comes from
-      ;; initial-frame-alist, default-frame-alist, or X resource if the font
-      ;; name conforms to XLFD and the registry part is `fontset'.  A font
-      ;; specification in command line argument (-fn XXXX) should be in
-      ;; default-frame-alist already.  However, any font specification in
-      ;; site-start library, user's init file (.emacs), and default.el are
-      ;; not yet handled here.
+      ;; Try to create a fontset from a font specification which comes
+      ;; from initial-frame-alist, default-frame-alist, or X resource.
+      ;; A font specification in command line argument (i.e. -fn XXXX)
+      ;; should be already in default-frame-alist as a `font'
+      ;; parameter.  However, any font specifications in site-start
+      ;; library, user's init file (.emacs), and default.el are not
+      ;; yet handled here.
 
       (let ((font (or (cdr (assq 'font initial-frame-alist))
 		      (cdr (assq 'font default-frame-alist))
-		      (x-get-resource "font" "Font")
-		      (x-get-resource "fontset" "Fontset")))
+		      (x-get-resource "font" "Font")))
 	    xlfd-fields fontlist)
 	(if (and font
 		 (not (query-fontset font))
 		 (setq xlfd-fields (x-decompose-font-name font)))
-	    (progn
-	      (if (not (string= "fontset"
-				(aref xlfd-fields xlfd-regexp-registry-subnum)))
+	    (let (alias)
+	      (or (string= "fontset"
+			   (aref xlfd-fields xlfd-regexp-registry-subnum))
 		  (progn
-		    ;; Create a fontset of the name FONT.
+		    ;; Create a fontset from FONT.  The name is also
+		    ;; generated from FONT.
 		    (setq fontlist (list (cons 'ascii font)))
 		    (aset xlfd-fields xlfd-regexp-foundry-subnum nil)
 		    (aset xlfd-fields xlfd-regexp-family-subnum nil)
 		    (aset xlfd-fields xlfd-regexp-adstyle-subnum nil)
-		    (aset xlfd-fields xlfd-regexp-avgwidth-subnum nil)))
-	      (new-fontset font (x-complement-fontset-spec xlfd-fields fontlist)))))))
+		    (aset xlfd-fields xlfd-regexp-avgwidth-subnum nil)
+		    (aset xlfd-fields xlfd-regexp-registry-subnum "fontset")
+		    (aset xlfd-fields xlfd-regexp-encoding-subnum "startup")
+		    (setq alias font
+			  font (x-compose-font-name xlfd-fields))))
+	      (new-fontset font
+			   (x-complement-fontset-spec xlfd-fields fontlist))
+	      (if alias
+		  (setq fontset-alias-alist
+			(cons (cons font alias) fontset-alias-alist)))
+	      )))))
 
 ;; Sun expects the menu bar cut and paste commands to use the clipboard.
 ;; This has ,? to match both on Sunos and on Solaris.