comparison lisp/menu-bar.el @ 102312:473a26ad93a9

(menu-set-font): Fix last fix.
author Chong Yidong <cyd@stupidchicken.com>
date Fri, 27 Feb 2009 15:13:07 +0000
parents c507d7b836ba
children 55ec3560f75e
comparison
equal deleted inserted replaced
102311:d54a31f60e54 102312:473a26ad93a9
635 (let ((font (if (fboundp 'x-select-font) 635 (let ((font (if (fboundp 'x-select-font)
636 (x-select-font) 636 (x-select-font)
637 (mouse-select-font))) 637 (mouse-select-font)))
638 spec) 638 spec)
639 (when font 639 (when font
640 ;; We used to call set-face-attribute with a nil argument here, 640 ;; Be careful here: when set-face-attribute is called for the
641 ;; but this does the wrong thing (Bug#2476). The reason is 641 ;; :font attribute, Emacs tries to guess the best matching font
642 ;; subtle: when Emacs looks for a font matching the `font' 642 ;; by examining the other face attributes (Bug#2476).
643 ;; argument, it tries to guess the best matching font by 643 (set-face-attribute 'default (selected-frame)
644 ;; examining the other face attributes. The attributes for 644 :width 'normal
645 ;; future frames are generally unspecified, so this matching 645 :weight 'normal
646 ;; process works poorly. What we do instead is assign `font' to 646 :slant 'normal
647 ;; the selected frame, then use that font object and assign it 647 :font font)
648 ;; to all other frames (and to future frames).
649 (set-face-attribute 'default (selected-frame) :font font)
650 (let ((font-object (face-attribute 'default :font))) 648 (let ((font-object (face-attribute 'default :font)))
651 (dolist (f (frame-list)) 649 (dolist (f (frame-list))
652 (and (not (eq f (selected-frame))) 650 (and (not (eq f (selected-frame)))
653 (display-graphic-p f) 651 (display-graphic-p f)
654 (set-face-attribute 'default f :font font-object))) 652 (set-face-attribute 'default f :font font-object)))