diff options
| author | Geoff Voelker | 1999-01-28 04:46:42 +0000 |
|---|---|---|
| committer | Geoff Voelker | 1999-01-28 04:46:42 +0000 |
| commit | e7a8ad1fdb56c622496bd0e2e3c82ee307387f0f (patch) | |
| tree | 1c158894429b33a7c0f8cf94bb18e3f866c05a4e | |
| parent | 5878523b19b879fe56ffc7eb9a2550cd22abf4b4 (diff) | |
| download | emacs-e7a8ad1fdb56c622496bd0e2e3c82ee307387f0f.tar.gz emacs-e7a8ad1fdb56c622496bd0e2e3c82ee307387f0f.zip | |
(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.
| -rw-r--r-- | lisp/term/w32-win.el | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el index 9681ea56d53..030732a6d2f 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.") | |||
| 626 | ;; W32 systems have different fonts than commonly found on X, so | 626 | ;; W32 systems have different fonts than commonly found on X, so |
| 627 | ;; we define our own standard fontset here. | 627 | ;; we define our own standard fontset here. |
| 628 | (defvar w32-standard-fontset-spec | 628 | (defvar w32-standard-fontset-spec |
| 629 | "-*-Courier New*-normal-r-*-*-13-*-*-*-c-*-fontset-standard" | 629 | "-*-Courier New-normal-r-*-*-13-*-*-*-c-*-fontset-standard" |
| 630 | "String of fontset spec of the standard fontset. This defines a | 630 | "String of fontset spec of the standard fontset. This defines a |
| 631 | fontset consisting of the Courier New variations for European | 631 | fontset consisting of the Courier New variations for European |
| 632 | languages which are distributed with Windows as \"Multilanguage Support\". | 632 | languages which are distributed with Windows as \"Multilanguage Support\". |
| @@ -707,11 +707,7 @@ specified in X resources." | |||
| 707 | (create-fontset-from-fontset-spec | 707 | (create-fontset-from-fontset-spec |
| 708 | (concat fontset ", ascii:" font) styles) | 708 | (concat fontset ", ascii:" font) styles) |
| 709 | ))))) | 709 | ))))) |
| 710 | ;; This cannot be run yet, as creating fontsets requires a | 710 | (w32-create-initial-fontsets))) |
| 711 | ;; Window to be initialised so the fonts can be listed. | ||
| 712 | ;; Add it to a hook so it gets run later. | ||
| 713 | (add-hook 'before-init-hook 'w32-create-initial-fontsets) | ||
| 714 | )) | ||
| 715 | 711 | ||
| 716 | ;; Apply a geometry resource to the initial frame. Put it at the end | 712 | ;; Apply a geometry resource to the initial frame. Put it at the end |
| 717 | ;; of the alist, so that anything specified on the command line takes | 713 | ;; 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 | |||
| 883 | `w32-use-w32-font-dialog' is nil.") | 879 | `w32-use-w32-font-dialog' is nil.") |
| 884 | 880 | ||
| 885 | (defun mouse-set-font (&rest fonts) | 881 | (defun mouse-set-font (&rest fonts) |
| 882 | "Select a font. If `w32-use-w32-font-dialog' is non-nil (the default), | ||
| 883 | use the Windows font dialog. Otherwise use a pop-up menu (like Emacs | ||
| 884 | on other platforms) initialized with the fonts in | ||
| 885 | `w32-fixed-font-alist'. Emacs will attempt to create a fontset from | ||
| 886 | the font chosen, covering all the charsets that can be fully represented | ||
| 887 | with the font." | ||
| 886 | (interactive | 888 | (interactive |
| 887 | (if w32-use-w32-font-dialog | 889 | (if w32-use-w32-font-dialog |
| 888 | (list (w32-select-font)) | 890 | (list (w32-select-font)) |
| @@ -892,15 +894,21 @@ Courier. These fonts are used in the font menu if the variable | |||
| 892 | (if (fboundp 'new-fontset) | 894 | (if (fboundp 'new-fontset) |
| 893 | (append w32-fixed-font-alist (list (generate-fontset-menu))))))) | 895 | (append w32-fixed-font-alist (list (generate-fontset-menu))))))) |
| 894 | (if fonts | 896 | (if fonts |
| 895 | (let (font) | 897 | (let (font fontset) |
| 896 | (while fonts | 898 | (while fonts |
| 897 | (condition-case nil | 899 | (condition-case nil |
| 898 | (progn | 900 | (progn |
| 899 | (set-default-font (car fonts)) | 901 | (setq font (car fonts)) |
| 900 | (setq font (car fonts)) | 902 | (if (fontset-name-p font) |
| 901 | (setq fonts nil)) | 903 | (setq fontset font) |
| 902 | (error | 904 | (condition-case nil |
| 903 | (setq fonts (cdr fonts))))) | 905 | (setq fontset (create-fontset-from-ascii-font font)) |
| 906 | (error nil))) | ||
| 907 | (if fontset | ||
| 908 | (set-default-font fontset) | ||
| 909 | (set-default-font font)) | ||
| 910 | (setq fonts nil)) | ||
| 911 | (error (setq fonts (cdr fonts))))) | ||
| 904 | (if (null font) | 912 | (if (null font) |
| 905 | (error "Font not found"))))) | 913 | (error "Font not found"))))) |
| 906 | 914 | ||