all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Alexis <flexibeast@gmail.com>
Cc: emacs-devel@gnu.org
Subject: Re: Ping! Re: `font-spec` unable to retrieve :name of font
Date: Thu, 22 Oct 2015 17:59:00 +0300	[thread overview]
Message-ID: <83k2qft0ej.fsf@gnu.org> (raw)
In-Reply-To: <87r3kngugm.fsf@gmail.com>

> From: Alexis <flexibeast@gmail.com>
> 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.



  reply	other threads:[~2015-10-22 14:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-13  2:13 `font-spec` unable to retrieve :name of font Alexis
2015-10-22  8:48 ` Ping! " Alexis
2015-10-22 14:59   ` Eli Zaretskii [this message]
2015-10-23  9:55     ` Alexis
2015-10-24 17:45       ` Nix
2015-10-24 17:57         ` Eli Zaretskii
2015-10-24 18:04         ` Drew Adams
2015-10-26 14:10           ` Nix
2015-10-27  2:32             ` Stephen J. Turnbull

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83k2qft0ej.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=flexibeast@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.