unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* Bug in frame's font parameter
@ 2004-03-16 11:33 Bertrand Petit
  0 siblings, 0 replies; only message in thread
From: Bertrand Petit @ 2004-03-16 11:33 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 358 bytes --]


	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

[-- Attachment #2: font-parameter-demo.el --]
[-- Type: text/plain, Size: 2182 bytes --]

;; 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

[-- Attachment #3: Type: text/plain, Size: 148 bytes --]

_______________________________________________
Bug-gnu-emacs mailing list
Bug-gnu-emacs@gnu.org
http://mail.gnu.org/mailman/listinfo/bug-gnu-emacs

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2004-03-16 11:33 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-16 11:33 Bug in frame's font parameter Bertrand Petit

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).