diff options
| author | Kenichi Handa | 1998-06-12 07:10:59 +0000 |
|---|---|---|
| committer | Kenichi Handa | 1998-06-12 07:10:59 +0000 |
| commit | 12755bafbfaadc09c4bf000dd157410fad7cb588 (patch) | |
| tree | bc7c7cc58273f40236e6b346260703279bb62903 | |
| parent | 70ccc86659c536faae2f554f3d551cbc132b71b7 (diff) | |
| download | emacs-12755bafbfaadc09c4bf000dd157410fad7cb588.tar.gz emacs-12755bafbfaadc09c4bf000dd157410fad7cb588.zip | |
While creating fontsets of style variants, pay
attention to X resources XXX.attributeFont.
| -rw-r--r-- | lisp/term/x-win.el | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el index 2d3a0a98359..3a5cd81d28d 100644 --- a/lisp/term/x-win.el +++ b/lisp/term/x-win.el | |||
| @@ -677,26 +677,36 @@ This is in addition to the primary selection.") | |||
| 677 | resolved-name xlfd-fields) | 677 | resolved-name xlfd-fields) |
| 678 | (if (and font | 678 | (if (and font |
| 679 | (not (query-fontset font)) | 679 | (not (query-fontset font)) |
| 680 | (setq resolved-name (or (x-resolve-font-name font) font)) | 680 | (setq resolved-name (x-resolve-font-name font)) |
| 681 | (setq xlfd-fields (x-decompose-font-name resolved-name))) | 681 | (setq xlfd-fields (x-decompose-font-name resolved-name))) |
| 682 | (if (string= "fontset" | 682 | (if (string= "fontset" |
| 683 | (aref xlfd-fields xlfd-regexp-registry-subnum)) | 683 | (aref xlfd-fields xlfd-regexp-registry-subnum)) |
| 684 | (new-fontset font (x-complement-fontset-spec xlfd-fields nil)) | 684 | (new-fontset font (x-complement-fontset-spec xlfd-fields nil)) |
| 685 | (let (fontset fontset-spec) | 685 | ;; Create a fontset from FONT. The fontset name is |
| 686 | ;; Create a fontset from FONT. The name is also | 686 | ;; generated from FONT. Create style variants of the |
| 687 | ;; generated from FONT. | 687 | ;; fontset too. Font names in the variants are |
| 688 | ;; generated automatially unless X resources | ||
| 689 | ;; XXX.attribyteFont explicitly specify them. | ||
| 690 | (let ((styles (mapcar 'car x-style-funcs-alist)) | ||
| 691 | (faces '(bold italic bold-italic)) | ||
| 692 | face face-font fontset fontset-spec) | ||
| 693 | (while faces | ||
| 694 | (setq face (car faces)) | ||
| 695 | (setq face-font (x-get-resource (concat (symbol-name face) | ||
| 696 | ".attributeFont") | ||
| 697 | "Face.AttributeFont")) | ||
| 698 | (if face-font | ||
| 699 | (setq styles (cons (cons face face-font) | ||
| 700 | (delq face styles)))) | ||
| 701 | (setq faces (cdr faces))) | ||
| 688 | (aset xlfd-fields xlfd-regexp-foundry-subnum nil) | 702 | (aset xlfd-fields xlfd-regexp-foundry-subnum nil) |
| 689 | (aset xlfd-fields xlfd-regexp-family-subnum nil) | 703 | (aset xlfd-fields xlfd-regexp-family-subnum nil) |
| 690 | (aset xlfd-fields xlfd-regexp-adstyle-subnum nil) | ||
| 691 | (aset xlfd-fields xlfd-regexp-avgwidth-subnum nil) | ||
| 692 | (aset xlfd-fields xlfd-regexp-registry-subnum "fontset") | 704 | (aset xlfd-fields xlfd-regexp-registry-subnum "fontset") |
| 693 | (aset xlfd-fields xlfd-regexp-encoding-subnum "startup") | 705 | (aset xlfd-fields xlfd-regexp-encoding-subnum "startup") |
| 694 | (setq fontset (x-compose-font-name xlfd-fields)) | 706 | (setq fontset (x-compose-font-name xlfd-fields)) |
| 695 | (setq fontset-spec (concat fontset ", ascii:" resolved-name)) | 707 | (create-fontset-from-fontset-spec |
| 696 | (create-fontset-from-fontset-spec fontset-spec t) | 708 | (concat fontset ", ascii:" font) styles) |
| 697 | (setq fontset-alias-alist | 709 | )))))) |
| 698 | (cons (cons fontset font) fontset-alias-alist))) | ||
| 699 | ))))) | ||
| 700 | 710 | ||
| 701 | ;; Sun expects the menu bar cut and paste commands to use the clipboard. | 711 | ;; Sun expects the menu bar cut and paste commands to use the clipboard. |
| 702 | ;; This has ,? to match both on Sunos and on Solaris. | 712 | ;; This has ,? to match both on Sunos and on Solaris. |