diff options
| author | Karl Heuer | 1997-02-20 05:51:26 +0000 |
|---|---|---|
| committer | Karl Heuer | 1997-02-20 05:51:26 +0000 |
| commit | f90080d4aaaf7a660742c0d7df33226245147edf (patch) | |
| tree | 60ed65fe734cdef6b37dd94da8fb674b31897d96 | |
| parent | ee0a4f29f9a0269a72aa3ca4d2e37376e1623394 (diff) | |
| download | emacs-f90080d4aaaf7a660742c0d7df33226245147edf.tar.gz emacs-f90080d4aaaf7a660742c0d7df33226245147edf.zip | |
Require fontset. Create fontsets from
default-fontset-spec, X resources, and "-fn" command line
argument.
| -rw-r--r-- | lisp/term/x-win.el | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el index 12a1ec48163..4855206c865 100644 --- a/lisp/term/x-win.el +++ b/lisp/term/x-win.el | |||
| @@ -75,6 +75,7 @@ | |||
| 75 | (require 'faces) | 75 | (require 'faces) |
| 76 | (require 'select) | 76 | (require 'select) |
| 77 | (require 'menu-bar) | 77 | (require 'menu-bar) |
| 78 | (require 'fontset) | ||
| 78 | 79 | ||
| 79 | (defvar x-invocation-args) | 80 | (defvar x-invocation-args) |
| 80 | 81 | ||
| @@ -640,6 +641,40 @@ This is in addition to the primary selection.") | |||
| 640 | (setq x-cut-buffer-max (min (- (/ (x-server-max-request-size) 2) 100) | 641 | (setq x-cut-buffer-max (min (- (/ (x-server-max-request-size) 2) 100) |
| 641 | x-cut-buffer-max)) | 642 | x-cut-buffer-max)) |
| 642 | 643 | ||
| 644 | ;; Create a default fontset. | ||
| 645 | (create-fontset-from-fontset-spec default-fontset-spec) | ||
| 646 | |||
| 647 | ;; Create fontset specified in X resources. | ||
| 648 | (create-fontset-from-x-resource) | ||
| 649 | |||
| 650 | ;; Try to create a fontset from font specification which comes from | ||
| 651 | ;; initial-frame-alist, default-frame-alist, or X resource if the font | ||
| 652 | ;; name conforms to XLFD and the registry part is `fontset'. A font | ||
| 653 | ;; specification in command line argument (-fn XXXX) should be in | ||
| 654 | ;; default-frame-alist already. However, any font specification in | ||
| 655 | ;; site-start library, user's init file (.emacs), and default.el are | ||
| 656 | ;; not yet handled here. | ||
| 657 | |||
| 658 | (let ((font (or (cdr (assq 'font initial-frame-alist)) | ||
| 659 | (cdr (assq 'font default-frame-alist)) | ||
| 660 | (x-get-resource "font" "Font") | ||
| 661 | (x-get-resource "fontset" "Fontset"))) | ||
| 662 | xlfd-fields fontlist) | ||
| 663 | (if (and font | ||
| 664 | (not (query-fontset font)) | ||
| 665 | (setq xlfd-fields (x-decompose-font-name font))) | ||
| 666 | (progn | ||
| 667 | (if (not (string= "fontset" | ||
| 668 | (aref xlfd-fields xlfd-regexp-registry-subnum))) | ||
| 669 | (progn | ||
| 670 | ;; Create a fontset of the name FONT. | ||
| 671 | (setq fontlist (list (cons 'ascii font))) | ||
| 672 | (aset xlfd-fields xlfd-regexp-foundry-subnum nil) | ||
| 673 | (aset xlfd-fields xlfd-regexp-family-subnum nil) | ||
| 674 | (aset xlfd-fields xlfd-regexp-adstyle-subnum nil) | ||
| 675 | (aset xlfd-fields xlfd-regexp-avgwidth-subnum nil))) | ||
| 676 | (new-fontset font (x-complement-fontset-spec xlfd-fields fontlist))))) | ||
| 677 | |||
| 643 | ;; Sun expects the menu bar cut and paste commands to use the clipboard. | 678 | ;; Sun expects the menu bar cut and paste commands to use the clipboard. |
| 644 | ;; This has ,? to match both on Sunos and on Solaris. | 679 | ;; This has ,? to match both on Sunos and on Solaris. |
| 645 | (if (string-match "Sun Microsystems,? Inc\\." | 680 | (if (string-match "Sun Microsystems,? Inc\\." |