diff options
| author | Kenichi Handa | 1997-05-12 06:56:32 +0000 |
|---|---|---|
| committer | Kenichi Handa | 1997-05-12 06:56:32 +0000 |
| commit | b28ecb7dc68642006e29bb06de043587d7978bf3 (patch) | |
| tree | 6b1c40808823f084dd6ba3600f9be8835b6e9b5f /lisp/term | |
| parent | 908b8443a63e10610908c3fe66d65d588c65492d (diff) | |
| download | emacs-b28ecb7dc68642006e29bb06de043587d7978bf3.tar.gz emacs-b28ecb7dc68642006e29bb06de043587d7978bf3.zip | |
Create bold, italic, and bold-italic variants of
default fontset. Name a fontset created from user-specified ASCII
font as "fontset-startup".
Diffstat (limited to 'lisp/term')
| -rw-r--r-- | lisp/term/x-win.el | 45 |
1 files changed, 29 insertions, 16 deletions
diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el index bd654a48668..dd9c0317f11 100644 --- a/lisp/term/x-win.el +++ b/lisp/term/x-win.el | |||
| @@ -650,37 +650,50 @@ This is in addition to the primary selection.") | |||
| 650 | (progn | 650 | (progn |
| 651 | ;; Create a default fontset. | 651 | ;; Create a default fontset. |
| 652 | (create-fontset-from-fontset-spec default-fontset-spec) | 652 | (create-fontset-from-fontset-spec default-fontset-spec) |
| 653 | ;; Create variants of a default fontset. | ||
| 654 | (create-fontset-from-fontset-spec default-fontset-spec 'bold) | ||
| 655 | (create-fontset-from-fontset-spec default-fontset-spec 'italic) | ||
| 656 | (create-fontset-from-fontset-spec default-fontset-spec 'bold-italic) | ||
| 653 | 657 | ||
| 654 | ;; Create fontset specified in X resources. | 658 | ;; Create fontset specified in X resources "Fontset-N" (N is 0, 1, ...). |
| 655 | (create-fontset-from-x-resource) | 659 | (create-fontset-from-x-resource) |
| 656 | 660 | ||
| 657 | ;; Try to create a fontset from font specification which comes from | 661 | ;; Try to create a fontset from a font specification which comes |
| 658 | ;; initial-frame-alist, default-frame-alist, or X resource if the font | 662 | ;; from initial-frame-alist, default-frame-alist, or X resource. |
| 659 | ;; name conforms to XLFD and the registry part is `fontset'. A font | 663 | ;; A font specification in command line argument (i.e. -fn XXXX) |
| 660 | ;; specification in command line argument (-fn XXXX) should be in | 664 | ;; should be already in default-frame-alist as a `font' |
| 661 | ;; default-frame-alist already. However, any font specification in | 665 | ;; parameter. However, any font specifications in site-start |
| 662 | ;; site-start library, user's init file (.emacs), and default.el are | 666 | ;; library, user's init file (.emacs), and default.el are not |
| 663 | ;; not yet handled here. | 667 | ;; yet handled here. |
| 664 | 668 | ||
| 665 | (let ((font (or (cdr (assq 'font initial-frame-alist)) | 669 | (let ((font (or (cdr (assq 'font initial-frame-alist)) |
| 666 | (cdr (assq 'font default-frame-alist)) | 670 | (cdr (assq 'font default-frame-alist)) |
| 667 | (x-get-resource "font" "Font") | 671 | (x-get-resource "font" "Font"))) |
| 668 | (x-get-resource "fontset" "Fontset"))) | ||
| 669 | xlfd-fields fontlist) | 672 | xlfd-fields fontlist) |
| 670 | (if (and font | 673 | (if (and font |
| 671 | (not (query-fontset font)) | 674 | (not (query-fontset font)) |
| 672 | (setq xlfd-fields (x-decompose-font-name font))) | 675 | (setq xlfd-fields (x-decompose-font-name font))) |
| 673 | (progn | 676 | (let (alias) |
| 674 | (if (not (string= "fontset" | 677 | (or (string= "fontset" |
| 675 | (aref xlfd-fields xlfd-regexp-registry-subnum))) | 678 | (aref xlfd-fields xlfd-regexp-registry-subnum)) |
| 676 | (progn | 679 | (progn |
| 677 | ;; Create a fontset of the name FONT. | 680 | ;; Create a fontset from FONT. The name is also |
| 681 | ;; generated from FONT. | ||
| 678 | (setq fontlist (list (cons 'ascii font))) | 682 | (setq fontlist (list (cons 'ascii font))) |
| 679 | (aset xlfd-fields xlfd-regexp-foundry-subnum nil) | 683 | (aset xlfd-fields xlfd-regexp-foundry-subnum nil) |
| 680 | (aset xlfd-fields xlfd-regexp-family-subnum nil) | 684 | (aset xlfd-fields xlfd-regexp-family-subnum nil) |
| 681 | (aset xlfd-fields xlfd-regexp-adstyle-subnum nil) | 685 | (aset xlfd-fields xlfd-regexp-adstyle-subnum nil) |
| 682 | (aset xlfd-fields xlfd-regexp-avgwidth-subnum nil))) | 686 | (aset xlfd-fields xlfd-regexp-avgwidth-subnum nil) |
| 683 | (new-fontset font (x-complement-fontset-spec xlfd-fields fontlist))))))) | 687 | (aset xlfd-fields xlfd-regexp-registry-subnum "fontset") |
| 688 | (aset xlfd-fields xlfd-regexp-encoding-subnum "startup") | ||
| 689 | (setq alias font | ||
| 690 | font (x-compose-font-name xlfd-fields)))) | ||
| 691 | (new-fontset font | ||
| 692 | (x-complement-fontset-spec xlfd-fields fontlist)) | ||
| 693 | (if alias | ||
| 694 | (setq fontset-alias-alist | ||
| 695 | (cons (cons font alias) fontset-alias-alist))) | ||
| 696 | ))))) | ||
| 684 | 697 | ||
| 685 | ;; Sun expects the menu bar cut and paste commands to use the clipboard. | 698 | ;; Sun expects the menu bar cut and paste commands to use the clipboard. |
| 686 | ;; This has ,? to match both on Sunos and on Solaris. | 699 | ;; This has ,? to match both on Sunos and on Solaris. |