bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Bug in frame's font parameter


From: Bertrand Petit
Subject: Bug in frame's font parameter
Date: Tue, 16 Mar 2004 12:33:37 +0100
User-agent: Mutt/1.4.2i

        See the comments in the joined elisp file for details.

-- 
%!PS
297.6 420.9 translate 90 rotate 0 setgray gsave 0 1 1{pop 0 180 moveto 100
180 170 100 170 -10 curveto 180 -9 180 -9 190 -10 curveto 190 100 100 180
0 180 curveto fill 180 rotate}for grestore/Bookman-LightItalic findfont
240 scalefont setfont -151.536392 -63.7998886 moveto (bp)show showpage
;; Frame's font parameter demonstration.

;; The trouble reside in a frame's font parameter when a font is
;; specified in the default-frame-alist using wildcards. For the first
;; frame created by emacs, the font parameter is the same as the
;; specifications (ie wildcarded), while for subsequent frames the
;; parameter is the real XLFD of the used font. This behavior diverges
;; from emacs 20 and is unexpected.

;; Test it using "emacs -q -no-site-file -l font-parameter-demo.el"

;; Following is the output I got:
;; (emacs-version)
;; ==> "GNU Emacs 21.3.1 (i386-unknown-freebsd4.5, X toolkit)
;;  of 2004-02-25 on memo.frmug.org"
;; (assoc (quote font) default-frame-alist)
;; ==> (font . "-b&h-luxi mono-medium-r-normal-*-*-130-*-*-m-*-iso8859-1")
;; (frame-parameter (selected-frame) (quote font))
;; ==> "-b&h-luxi mono-medium-r-normal-*-*-130-*-*-m-*-iso8859-1"
;; (face-attribute (quote default) :font)
;; ==> "-b&h-luxi mono-medium-r-normal--14-130-75-75-m-80-iso8859-1"
;; *** Again on a new frame
;; (frame-parameter (selected-frame) (quote font))
;; ==> "-b&h-luxi mono-medium-r-normal--14-130-75-75-m-80-iso8859-1"
;; (face-attribute (quote default) :font)
;; ==> "-b&h-luxi mono-medium-r-normal--14-130-75-75-m-80-iso8859-1"

(setq default-frame-alist
      '((font . "-b&h-luxi mono-medium-r-normal-*-*-130-*-*-m-*-iso8859-1")))
(setq initial-frame-alist default-frame-alist)

(setq the-first-frame (selected-frame))

(defmacro eval-print (expr)
  `(progn
     (prin1 (quote ,expr))
     (terpri)
     (princ "==> ")
     (prin1 ,expr)
     (terpri)))

(defun bug-case ()
  (interactive)
  
  (setq standard-output (get-buffer-create "*test-output*"))
  (switch-to-buffer standard-output)

  (if (eq (selected-frame) the-first-frame)
      (progn
        (eval-print (emacs-version))
        (eval-print (assoc 'font default-frame-alist))))
  (eval-print (frame-parameter (selected-frame) 'font))
  (eval-print (face-attribute 'default :font))

  (if (eq (selected-frame) the-first-frame)
      (progn
        (princ "*** Again on a new frame")
        (terpri)
        (select-frame (make-frame '((background-color . "bisque"))))
        (bug-case))))

(add-hook 'window-setup-hook 'bug-case t)

;; EOF

reply via email to

[Prev in Thread] Current Thread [Next in Thread]