Mercurial > emacs
comparison lisp/term/x-win.el @ 17014:828cf55629fc
Require fontset. Create fontsets from
default-fontset-spec, X resources, and "-fn" command line
argument.
author | Karl Heuer <kwzh@gnu.org> |
---|---|
date | Thu, 20 Feb 1997 05:51:26 +0000 |
parents | 7584a510ad85 |
children | 018de297d2d5 |
comparison
equal
deleted
inserted
replaced
17013:d6ce795e84da | 17014:828cf55629fc |
---|---|
73 (require 'mouse) | 73 (require 'mouse) |
74 (require 'scroll-bar) | 74 (require 'scroll-bar) |
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 |
81 (defvar x-command-line-resources nil) | 82 (defvar x-command-line-resources nil) |
82 | 83 |
638 (setq frame-creation-function 'x-create-frame-with-faces) | 639 (setq frame-creation-function 'x-create-frame-with-faces) |
639 | 640 |
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\\." |
646 (x-server-vendor)) | 681 (x-server-vendor)) |
647 (menu-bar-enable-clipboard)) | 682 (menu-bar-enable-clipboard)) |