From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#17457: 24.4.50; REGRESSION: "Invalid font name: -outline-Lucida Console-normal-normal-normal-mono" Date: Sun, 11 May 2014 19:03:36 +0300 Message-ID: <83a9aouwtj.fsf@gnu.org> References: <83eh01udux.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1399824266 27289 80.91.229.3 (11 May 2014 16:04:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 11 May 2014 16:04:26 +0000 (UTC) Cc: 17457@debbugs.gnu.org To: Drew Adams Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun May 11 18:04:18 2014 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WjWEa-0004MQ-9g for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 May 2014 18:04:16 +0200 Original-Received: from localhost ([::1]:33410 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjWEZ-0004sf-To for geb-bug-gnu-emacs@m.gmane.org; Sun, 11 May 2014 12:04:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35143) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjWES-0004sS-9t for bug-gnu-emacs@gnu.org; Sun, 11 May 2014 12:04:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WjWEN-0001Gs-79 for bug-gnu-emacs@gnu.org; Sun, 11 May 2014 12:04:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:42081) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WjWEN-0001Gf-1x for bug-gnu-emacs@gnu.org; Sun, 11 May 2014 12:04:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1WjWEM-0006Rv-88 for bug-gnu-emacs@gnu.org; Sun, 11 May 2014 12:04:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 11 May 2014 16:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 17457 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 17457-submit@debbugs.gnu.org id=B17457.139982423924782 (code B ref 17457); Sun, 11 May 2014 16:04:02 +0000 Original-Received: (at 17457) by debbugs.gnu.org; 11 May 2014 16:03:59 +0000 Original-Received: from localhost ([127.0.0.1]:59432 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WjWEI-0006Rd-4K for submit@debbugs.gnu.org; Sun, 11 May 2014 12:03:58 -0400 Original-Received: from mtaout24.012.net.il ([80.179.55.180]:42451) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1WjWEF-0006RK-82 for 17457@debbugs.gnu.org; Sun, 11 May 2014 12:03:56 -0400 Original-Received: from conversion-daemon.mtaout24.012.net.il by mtaout24.012.net.il (HyperSendmail v2007.08) id <0N5F001002Q6NN00@mtaout24.012.net.il> for 17457@debbugs.gnu.org; Sun, 11 May 2014 19:01:08 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout24.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0N5F00JTV35V4I90@mtaout24.012.net.il>; Sun, 11 May 2014 19:01:08 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:88899 Archived-At: > Date: Sat, 10 May 2014 22:23:41 -0700 (PDT) > From: Drew Adams > Cc: 17457@debbugs.gnu.org > > > > Subject line says it all. No problem in Emacs 24 or prior releases: > > > > > > M-: (font-info "-outline-Lucida Console-normal-normal-normal-mono") > > > ["-outline-Arial-normal-normal-normal-sans-20-*-*-*-p-*-iso8859-1" > > > "Arial-12.0" 20 23 0 0 19] > > > > What do you get in prior releases, and why do you think that output is > > correct? > > In prior releases (Emacs 23 through 24.3) I get what I showed above > for prior releases. Why should I think it is not correct? Why > should Emacs suddenly start treating it as invalid? Because it indeed _is_ invalid, see below. > OK, yes, it seems weird that the font info returned seems to be for > a different font in this case! I'll grant you that perhaps there is > an Emacs bug there to be fixed. Yes, there was a bug, and it has been fixed in the current code. That's why you started to get that error. > But at least in previous versions Emacs did not claim the font was > invalid. I don't see why it would be invalid (either the Lucida > font or the Arial font that Emacs apparently used to think it was > looking at). There's nothing wrong with the fonts, it's just that you are using an invalid specification of a font. > Where did I get the value of the arg I pass to `font-info'? > >From here: (append fontset-lst (x-list-fonts "*")), where > FONTSET-LST is this; > > (let ((fontset-lst (fontset-list))) > (setq fontset-lst > (delete "-*-*-*-*-*-*-*-*-*-*-*-*-fontset-default" > fontset-lst)) > ...) But the above doesn't yield "-outline-Lucida Console-normal-normal-normal-mono", it yields this: "-outline-Lucida Console-normal-normal-normal-mono-*-*-*-*-c-*-iso10646-1" And if I use this longer string, there's no problem: M-: (font-info "-outline-Lucida Console-normal-normal-normal-mono-*-*-*-*-c-*-iso10646-1") RET => ["-outline-Lucida Console-normal-normal-normal-mono-16-*-*-*-c-*-iso10646-1" "Lucida Console-12.0" 16 16 0 0 13] Likewise with this more loose spec: "-outline-Lucida Console-normal-normal-normal-mono-*-*-*-*-*-*-*" > I map `font-info' over the above list composed of `fontset-list' > fonts and `x-list-fonts' fonts. I have been doing so for a > long time. There must be some other factor at work here, because I don't understand how you get your truncated spec. Font specifications that start with a dash "-" are XLFD specs, and they must be built according to certain rules to be valid. (See the node "Fonts" in the User manual for some details.) Your string starts with a dash, which means it's an XLFD spec, but it has too few components (the parts between dashes) for an XLFD spec, so Emacs rejects it as invalid. Previously, it didn't detect the problem, and would return information about some semi-random font, whose particulars depend on which fonts are installed on your system. E.g., on one of my systems I get Arial, like you, but on another I get this: ["-outline-STIX-normal-normal-normal-mono-16-*-*-*-p-*-iso8859-1" "STIX-12.0" 16 24 0 0 16] > I really hadn't noticed until now that for the Lucida font `font-info' > apparently returned information for a different font (Arial). But in > general it has worked well. The info I use from `font-info' is just this: > > (format > "pixelsize: %s, pixelheight: %s, offset: %s, compose: %s, ascent: %s" > (aref font-info iii) (aref font-info (+ iii 1)) > (aref font-info (+ iii 2)) (aref font-info (+ iii 3)) > (aref font-info (+ iii 4))) This info will be incorrect if you get it for the wrong font. The pixelsize and pixelheight parameters are different, for starters. > `font-info' is supposed to return either font info or nil if the > font is not yet loaded. I don't see a problem with a function that signals an error when passed invalid input, even though that fact is not stated in the documentation: we rarely state that in other cases. For example: M-: (string-width 1) RET => error