aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/term
diff options
context:
space:
mode:
authorGeoff Voelker <[email protected]>1999-01-28 04:46:42 +0000
committerGeoff Voelker <[email protected]>1999-01-28 04:46:42 +0000
commite7a8ad1fdb56c622496bd0e2e3c82ee307387f0f (patch)
tree1c158894429b33a7c0f8cf94bb18e3f866c05a4e /lisp/term
parent5878523b19b879fe56ffc7eb9a2550cd22abf4b4 (diff)
(w32-standard-fontset-spec): Remove wildcard
from FAMILY field. (w32-create-initial-fontsets): Do not use before-init-hook. (mouse-set-font): Document. Automatically create and use fontsets.
Diffstat (limited to 'lisp/term')
-rw-r--r--lisp/term/w32-win.el32
1 files changed, 20 insertions, 12 deletions
diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el
index 9681ea56d5..030732a6d2 100644
--- a/lisp/term/w32-win.el
+++ b/lisp/term/w32-win.el
@@ -626,7 +626,7 @@ This is in addition to the primary selection.")
;; W32 systems have different fonts than commonly found on X, so
;; we define our own standard fontset here.
(defvar w32-standard-fontset-spec
- "-*-Courier New*-normal-r-*-*-13-*-*-*-c-*-fontset-standard"
+ "-*-Courier New-normal-r-*-*-13-*-*-*-c-*-fontset-standard"
"String of fontset spec of the standard fontset. This defines a
fontset consisting of the Courier New variations for European
languages which are distributed with Windows as \"Multilanguage Support\".
@@ -707,11 +707,7 @@ specified in X resources."
(create-fontset-from-fontset-spec
(concat fontset ", ascii:" font) styles)
)))))
- ;; This cannot be run yet, as creating fontsets requires a
- ;; Window to be initialised so the fonts can be listed.
- ;; Add it to a hook so it gets run later.
- (add-hook 'before-init-hook 'w32-create-initial-fontsets)
- ))
+ (w32-create-initial-fontsets)))
;; Apply a geometry resource to the initial frame. Put it at the end
;; of the alist, so that anything specified on the command line takes
@@ -883,6 +879,12 @@ Courier. These fonts are used in the font menu if the variable
`w32-use-w32-font-dialog' is nil.")
(defun mouse-set-font (&rest fonts)
+ "Select a font. If `w32-use-w32-font-dialog' is non-nil (the default),
+use the Windows font dialog. Otherwise use a pop-up menu (like Emacs
+on other platforms) initialized with the fonts in
+`w32-fixed-font-alist'. Emacs will attempt to create a fontset from
+the font chosen, covering all the charsets that can be fully represented
+with the font."
(interactive
(if w32-use-w32-font-dialog
(list (w32-select-font))
@@ -892,15 +894,21 @@ Courier. These fonts are used in the font menu if the variable
(if (fboundp 'new-fontset)
(append w32-fixed-font-alist (list (generate-fontset-menu)))))))
(if fonts
- (let (font)
+ (let (font fontset)
(while fonts
(condition-case nil
(progn
- (set-default-font (car fonts))
- (setq font (car fonts))
- (setq fonts nil))
- (error
- (setq fonts (cdr fonts)))))
+ (setq font (car fonts))
+ (if (fontset-name-p font)
+ (setq fontset font)
+ (condition-case nil
+ (setq fontset (create-fontset-from-ascii-font font))
+ (error nil)))
+ (if fontset
+ (set-default-font fontset)
+ (set-default-font font))
+ (setq fonts nil))
+ (error (setq fonts (cdr fonts)))))
(if (null font)
(error "Font not found")))))