From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Ping! Re: `font-spec` unable to retrieve :name of font Date: Thu, 22 Oct 2015 17:59:00 +0300 Message-ID: <83k2qft0ej.fsf@gnu.org> References: <87bnc3plb9.fsf@gmail.com> <87r3kngugm.fsf@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1445525979 31998 80.91.229.3 (22 Oct 2015 14:59:39 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 22 Oct 2015 14:59:39 +0000 (UTC) Cc: emacs-devel@gnu.org To: Alexis Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Oct 22 16:59:28 2015 Return-path: Envelope-to: ged-emacs-devel@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 1ZpHKq-0006vY-38 for ged-emacs-devel@m.gmane.org; Thu, 22 Oct 2015 16:59:20 +0200 Original-Received: from localhost ([::1]:60501 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpHKp-0006Zu-Kr for ged-emacs-devel@m.gmane.org; Thu, 22 Oct 2015 10:59:19 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58026) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpHKe-0006Zi-Bg for emacs-devel@gnu.org; Thu, 22 Oct 2015 10:59:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZpHKZ-0004VD-7d for emacs-devel@gnu.org; Thu, 22 Oct 2015 10:59:08 -0400 Original-Received: from mtaout25.012.net.il ([80.179.55.181]:40130) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZpHKY-0004V5-Vp for emacs-devel@gnu.org; Thu, 22 Oct 2015 10:59:03 -0400 Original-Received: from conversion-daemon.mtaout25.012.net.il by mtaout25.012.net.il (HyperSendmail v2007.08) id <0NWM00C00MSFKC00@mtaout25.012.net.il> for emacs-devel@gnu.org; Thu, 22 Oct 2015 17:56:42 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([84.94.185.246]) by mtaout25.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NWM002M7MUH4DA0@mtaout25.012.net.il>; Thu, 22 Oct 2015 17:56:42 +0300 (IDT) In-reply-to: <87r3kngugm.fsf@gmail.com> X-012-Sender: halo1@inter.net.il X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Received-From: 80.179.55.181 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:192394 Archived-At: > From: Alexis > Date: Thu, 22 Oct 2015 19:48:09 +1100 > > Ping! Does anyone have any thoughts on the below? TIA! Sorry for not responding earlier. > Having tried various alternatives, i now use Inconsolata-g as my preferred general Emacs font: > > http://leonardo-m.livejournal.com/77079.html > > using Xft as my Emacs font backend. Using such fonts is unwise, see below. > In trying to use the `company-quickhelp` package, however, i discovered that it wasn't working due to a call to `pos-tip-show`, which in turn essentially calls: > > (font-spec :name (frame-parameter (window-frame (selected-window)) 'font)) > > This call results in: > (error "Invalid font name: -unknown-Inconsolata-g-normal-normal-normal-*-13-*-*-*-m-0-iso10646-1") > > which is, of course, due to the dash in the font name; the X Logical Font Description Conventions: > > http://www.x.org/releases/X11R7.6/doc/xorg-docs/specs/XLFD/xlfd.html#fontname_syntax > > exclude the dash/hyphen as a valid in-field character. > > What, if anything, can be done about this? Should this be considered a bug, or "working as intended"? Emacs's font handling is deeply entrenched in the XLFD spec. That is true even on platforms that don't support XLFD, such as MS-Windows. So this is not a bug, it's the intended behavior, the code is working as designed. That said, I had a similar problem with fonts named like Foobar-12, see commit 7d5a7a4 which solved that. (The original problem is described in the discussion that started in http://lists.gnu.org/archive/html/help-emacs-windows/2015-06/msg00001.html.) That problem could be solved because the part after the dash was a number, and a font's family cannot be a number. I don't know if we can do the same with this case. Which "family" names are we allowed to reject, exactly? Don't forget that the weight field of the XLFD spec, which follows the family, uses single-letter codes (although AFAIK "g" is not one of them); we ought not to trick ourselves into accidentally treating weight as part of the font name. I guess we need advice from some expert on fonts, but I don't know if we have such a person on board.