comparison lisp/term/x-win.el @ 22163:58a65bc4156a

Generate style variants fontset for standard-fontset-spec. Generate a fontset based on resolved font name of a font specified by X resource or -fn command line arg.
author Kenichi Handa <handa@m17n.org>
date Thu, 21 May 1998 01:47:32 +0000
parents fa3161c7360b
children 50b8918e3c60
comparison
equal deleted inserted replaced
22162:7b2a57ff032a 22163:58a65bc4156a
656 x-cut-buffer-max)) 656 x-cut-buffer-max))
657 657
658 (if (fboundp 'new-fontset) 658 (if (fboundp 'new-fontset)
659 (progn 659 (progn
660 ;; Create the standard fontset. 660 ;; Create the standard fontset.
661 (create-fontset-from-fontset-spec standard-fontset-spec) 661 (create-fontset-from-fontset-spec standard-fontset-spec t)
662 662
663 ;; Create fontset specified in X resources "Fontset-N" (N is 0, 1, ...). 663 ;; Create fontset specified in X resources "Fontset-N" (N is 0, 1, ...).
664 (create-fontset-from-x-resource) 664 (create-fontset-from-x-resource)
665 665
666 ;; Try to create a fontset from a font specification which comes 666 ;; Try to create a fontset from a font specification which comes
672 ;; yet handled here. 672 ;; yet handled here.
673 673
674 (let ((font (or (cdr (assq 'font initial-frame-alist)) 674 (let ((font (or (cdr (assq 'font initial-frame-alist))
675 (cdr (assq 'font default-frame-alist)) 675 (cdr (assq 'font default-frame-alist))
676 (x-get-resource "font" "Font"))) 676 (x-get-resource "font" "Font")))
677 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 xlfd-fields (x-decompose-font-name font))) 680 (setq resolved-name (or (x-resolve-font-name font) font))
681 (setq xlfd-fields (x-decompose-font-name resolved-name)))
681 (if (string= "fontset" 682 (if (string= "fontset"
682 (aref xlfd-fields xlfd-regexp-registry-subnum)) 683 (aref xlfd-fields xlfd-regexp-registry-subnum))
683 (new-fontset font (x-complement-fontset-spec xlfd-fields nil)) 684 (new-fontset font (x-complement-fontset-spec xlfd-fields nil))
684 (let (fontset fontset-spec) 685 (let (fontset fontset-spec)
685 ;; Create a fontset from FONT. The name is also 686 ;; Create a fontset from FONT. The name is also
689 (aset xlfd-fields xlfd-regexp-adstyle-subnum nil) 690 (aset xlfd-fields xlfd-regexp-adstyle-subnum nil)
690 (aset xlfd-fields xlfd-regexp-avgwidth-subnum nil) 691 (aset xlfd-fields xlfd-regexp-avgwidth-subnum nil)
691 (aset xlfd-fields xlfd-regexp-registry-subnum "fontset") 692 (aset xlfd-fields xlfd-regexp-registry-subnum "fontset")
692 (aset xlfd-fields xlfd-regexp-encoding-subnum "startup") 693 (aset xlfd-fields xlfd-regexp-encoding-subnum "startup")
693 (setq fontset (x-compose-font-name xlfd-fields)) 694 (setq fontset (x-compose-font-name xlfd-fields))
694 (setq fontset-spec (concat fontset ", ascii:" font)) 695 (setq fontset-spec (concat fontset ", ascii:" resolved-name))
695 (create-fontset-from-fontset-spec fontset-spec t) 696 (create-fontset-from-fontset-spec fontset-spec t)
696 (setq fontset-alias-alist 697 (setq fontset-alias-alist
697 (cons (cons fontset font) fontset-alias-alist))) 698 (cons (cons fontset font) fontset-alias-alist)))
698 ))))) 699 )))))
699 700