From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Kenichi Handa Newsgroups: gmane.emacs.bugs Subject: bug#3081: 23.0.92; x-list-fonts no longer gives correct result - substitutes * forfixed font size Date: Thu, 23 Apr 2009 20:26:21 +0900 Message-ID: References: <000b01c9c36c$460c3820$c2b22382@us.oracle.com> <003001c9c3d0$9a15bea0$0200a8c0@us.oracle.com> Reply-To: Kenichi Handa , 3081@emacsbugs.donarmstrong.com NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1240487057 3049 80.91.229.12 (23 Apr 2009 11:44:17 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 23 Apr 2009 11:44:17 +0000 (UTC) Cc: 3081@emacsbugs.donarmstrong.com To: "Drew Adams" Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Apr 23 13:45:36 2009 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LwxMy-0001c2-Gl for geb-bug-gnu-emacs@m.gmane.org; Thu, 23 Apr 2009 13:45:33 +0200 Original-Received: from localhost ([127.0.0.1]:40288 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LwxLZ-0002P7-7Y for geb-bug-gnu-emacs@m.gmane.org; Thu, 23 Apr 2009 07:44:05 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LwxLV-0002Ou-5C for bug-gnu-emacs@gnu.org; Thu, 23 Apr 2009 07:44:01 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LwxLQ-0002O5-7L for bug-gnu-emacs@gnu.org; Thu, 23 Apr 2009 07:44:00 -0400 Original-Received: from [199.232.76.173] (port=51505 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LwxLQ-0002Nv-0X for bug-gnu-emacs@gnu.org; Thu, 23 Apr 2009 07:43:56 -0400 Original-Received: from rzlab.ucr.edu ([138.23.92.77]:57916) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LwxLP-0001DY-7X for bug-gnu-emacs@gnu.org; Thu, 23 Apr 2009 07:43:55 -0400 Original-Received: from rzlab.ucr.edu (rzlab.ucr.edu [127.0.0.1]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n3NBhqKV028678; Thu, 23 Apr 2009 04:43:53 -0700 Original-Received: (from debbugs@localhost) by rzlab.ucr.edu (8.13.8/8.13.8/Submit) id n3NBZ2v2026299; Thu, 23 Apr 2009 04:35:02 -0700 X-Loop: owner@emacsbugs.donarmstrong.com Resent-From: Kenichi Handa Resent-To: bug-submit-list@donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Thu, 23 Apr 2009 11:35:02 +0000 Resent-Message-ID: Resent-Sender: owner@emacsbugs.donarmstrong.com X-Emacs-PR-Message: followup 3081 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Original-Received: via spool by 3081-submit@emacsbugs.donarmstrong.com id=B3081.124048596225044 (code B ref 3081); Thu, 23 Apr 2009 11:35:02 +0000 Original-Received: (at 3081) by emacsbugs.donarmstrong.com; 23 Apr 2009 11:26:02 +0000 X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. Original-Received: from mx1.aist.go.jp (mx1.aist.go.jp [150.29.246.133]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n3NBPwRB025038 for <3081@emacsbugs.donarmstrong.com>; Thu, 23 Apr 2009 04:26:00 -0700 Original-Received: from rqsmtp2.aist.go.jp (rqsmtp2.aist.go.jp [150.29.254.123]) by mx1.aist.go.jp with ESMTP id n3NBPvF3014907; Thu, 23 Apr 2009 20:25:57 +0900 (JST) env-from (handa@m17n.org) Original-Received: from smtp2.aist.go.jp by rqsmtp2.aist.go.jp with ESMTP id n3NBPubg019576; Thu, 23 Apr 2009 20:25:56 +0900 (JST) env-from (handa@m17n.org) Original-Received: by smtp2.aist.go.jp with ESMTP id n3NBPuJc020228; Thu, 23 Apr 2009 20:25:56 +0900 (JST) env-from (handa@m17n.org) Original-Received: from handa by etlken with local (Exim 4.69) (envelope-from ) id 1Lwx4P-0005v2-Sc; Thu, 23 Apr 2009 20:26:21 +0900 In-reply-to: <003001c9c3d0$9a15bea0$0200a8c0@us.oracle.com> (drew.adams@oracle.com) X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Resent-Date: Thu, 23 Apr 2009 07:44:00 -0400 X-BeenThere: bug-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:27414 Archived-At: In article <003001c9c3d0$9a15bea0$0200a8c0@us.oracle.com>, "Drew Adams" writes: > > > I have this defcustom, which I use to choose a small font: > > > (defcustom palette-font > > > (and window-system > > > (or (car (x-list-fonts > > > "-*-Courier-*-*-*-*-5-*-*-*-*-*-iso8859-1" nil nil 1)) ; 1 > > > (car (x-list-fonts > > "-*-fixed-*-*-*-*-5-*-*-*-*-*-iso8859-1" > > > nil nil 1)) ; 2 > > > (car (x-list-fonts > > > "-*-Terminal-*-*-*-*-5-*-*-*-*-*-iso8859-1" nil nil 1)) ; 3 > > > (car (x-list-fonts > > "-*-*-*-*-*-*-5-*-*-*-*-*-iso8859-1" nil > > > nil 1)))) ;4 > > > "...") > > [...] > > > In Emacs 23, these are the values: > > > > > 1. > > ("-outline-Courier-bold-normal-normal-mono-*-*-*-*-c-*-iso8859-1") > > > 2. nil > > > 3. nil > > > 4. ("-outline-Lucida Sans > > > Typewriter-bold-normal-normal-sans-*-*-*-*-c-*-iso8859-1") > > > > > The first difference to notice is #4: a completely different font > > > family is used. Why should this be? Anyway, I don't really have a > > > problem with this. > > > > If you don't specify a family, which family is selected is > > completely arbitrary. > I guess you're speaking about #2 and #3 - the nil values. That's OK. (And thanks > for the explanation.) No, I'm speaking about #4. In #2 and #3 you specify family name ("fixed" and "terminal" respectively). > > > The problem is that the font size is not correct: * instead > > > of a real font size. The whole point of this defcustom is to try to find a > > > default value for the option that provides a tiny font that the user > > > has available. It tries to match various fonts of size 5, until it > > > finds a match. > > > > I installed a fix. Please try again. > Thanks for the quick fix. > What do I need to pick up, to try it? Is this a Lisp fix (which library)? No, the change was in src/xfaces.c. 2009-04-23 Kenichi Handa * xfaces.c (Fx_list_fonts): If a font size is specified in PATTERN, set it in returned scalable fonts. Index: xfaces.c =================================================================== RCS file: /cvsroot/emacs/emacs/src/xfaces.c,v retrieving revision 1.432 retrieving revision 1.433 diff -u -r1.432 -r1.433 --- xfaces.c 16 Apr 2009 01:08:24 -0000 1.432 +++ xfaces.c 23 Apr 2009 01:33:33 -0000 1.433 @@ -1904,7 +1904,22 @@ } args[0] = Flist_fonts (font_spec, frame, maximum, font_spec); for (tail = args[0]; CONSP (tail); tail = XCDR (tail)) - XSETCAR (tail, Ffont_xlfd_name (XCAR (tail), Qnil)); + { + Lisp_Object font_entity; + + font_entity = XCAR (tail); + if ((NILP (AREF (font_entity, FONT_SIZE_INDEX)) + || XINT (AREF (font_entity, FONT_SIZE_INDEX)) == 0) + && ! NILP (AREF (font_spec, FONT_SIZE_INDEX))) + { + /* This is a scalable font. For backward compatibility, + we set the specified size. */ + font_entity = Fcopy_font_spec (font_entity); + ASET (font_entity, FONT_SIZE_INDEX, + AREF (font_spec, FONT_SIZE_INDEX)); + } + XSETCAR (tail, Ffont_xlfd_name (font_entity, Qnil)); + } if (NILP (frame)) /* We don't have to check fontsets. */ return args[0]; --- Kenichi Handa handa@m17n.org