all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: "Jan Djärv" <jan.h.d@swipnet.se>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 12823@debbugs.gnu.org
Subject: bug#12823: Invalid font name
Date: Wed, 7 Nov 2012 17:52:41 +0100	[thread overview]
Message-ID: <2D6B98DD-F6EA-439D-A43F-0648171A3663@swipnet.se> (raw)
In-Reply-To: <jwvpq3p78ch.fsf@iro.umontreal.ca>

Hello.

From the XLFD-specification 1.5 (http://www.xfree86.org/current/xlfd.pdf):

"Field values are constructed as strings of ISO 8859-1 graphic characters, excluding the following:

	• ‘‘−’’ (HYPHEN), the XLFD font name delimiter character

	• ‘‘?’’ (QUESTION MARK) and ‘‘*’’ (ASTERISK), the X protocol font name wildcard characters

	• ‘‘,’’ (COMMA), used by Xlib to separate XLFD font names in a font set.

	• ‘‘"’’ (QUOTATION MARK), used by some commercial products to quote a font name.

Alphabetic case distinctions are allowed but are for human readability concerns only. Conforming X servers will perform matching on font name query or open requests independent of case. The entire font name string must have no more than 255 characters."

So the use of semi-condensed (for example) is invalid, so we should simply remove all entries with "-" in them.

	Jan D.

7 nov 2012 kl. 16:15 skrev Stefan Monnier <monnier@iro.umontreal.ca>:

> Package: Emacs
> Version: 24.3.50
> 
> After letting xft use bitmap fonts on my system, Emacs started to crash,
> which was tracked to an invalid font name that was used
> without checking.
> So I added
> 
> 	  if (NILP (spec))
> 	    signal_error ("Invalid font name", ascii_font);
> 
> to x_set_font in revno 110704, but this only prevents the crash,
> replacing it with an error.  Basically the error is that ascii_font is
> not a valid XLFD font name because one of its fields has a "-" in its
> name, and since fields are separated by "-", this leads to a misparse.
> 
> Now, this invalid name was built by Emacs, probably in
> font_unparse_xlfd.  The appended patch fixes my problem.
> 
> So now the question is: should we reorder all the entries in the
> width_table, slant_table, and weight_table so that the first entry of
> every line is a non-dashed name?  Or could this have undesirable effects?
> 
> 
>        Stefan
> 
> 
> === modified file 'src/font.c'
> --- src/font.c	2012-11-06 03:17:56 +0000
> +++ src/font.c	2012-11-07 15:04:24 +0000
> @@ -102,7 +102,7 @@
>   { 50, { "ultra-condensed", "ultracondensed" }},
>   { 63, { "extra-condensed", "extracondensed" }},
>   { 75, { "condensed", "compressed", "narrow" }},
> -  { 87, { "semi-condensed", "semicondensed", "demicondensed" }},
> +  { 87, { "semicondensed", "semi-condensed", "demicondensed" }},
>   { 100, { "normal", "medium", "regular", "unspecified" }},
>   { 113, { "semi-expanded", "semiexpanded", "demiexpanded" }},
>   { 125, { "expanded" }},
> 
> 
> 






  reply	other threads:[~2012-11-07 16:52 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-07 15:15 bug#12823: Invalid font name Stefan Monnier
2012-11-07 16:52 ` Jan Djärv [this message]
2012-11-09 14:07 ` Kenichi Handa
2012-11-13 11:55   ` Kenichi Handa
2012-11-13 19:25     ` Andreas Schwab
2012-11-15 13:30       ` Kenichi Handa
2012-11-27 14:26         ` Kenichi Handa
2012-11-27 15:10           ` Stefan Monnier
2012-11-28  9:20             ` Kenichi Handa
2012-11-28 14:57               ` Stefan Monnier
2012-12-03  9:21                 ` Kenichi Handa
2012-12-03 17:51                   ` Stefan Monnier

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=2D6B98DD-F6EA-439D-A43F-0648171A3663@swipnet.se \
    --to=jan.h.d@swipnet.se \
    --cc=12823@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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.