GNU bug report logs - #12823
Invalid font name

Previous Next

Package: emacs;

Reported by: Stefan Monnier <monnier <at> iro.umontreal.ca>

Date: Wed, 7 Nov 2012 15:16:01 UTC

Severity: normal

Found in version 24.3.50

Done: Stefan Monnier <monnier <at> IRO.UMontreal.CA>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 12823 <at> debbugs.gnu.org (full text, mbox):

From: Kenichi Handa <handa <at> gnu.org>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 12823 <at> debbugs.gnu.org
Subject: Re: bug#12823: Invalid font name
Date: Fri, 09 Nov 2012 23:07:44 +0900
In article <jwvpq3p78ch.fsf <at> iro.umontreal.ca>, Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

> 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?

Yes.  The first elements in those table should match the
face attribute values for :weight, :width, and :slant (see
set-face-attribute).  I should have wrote that in the
comment.

Could you please try this patch instead?

---
Kenichi Handa
handa <at> gnu.org


=== modified file 'src/font.c'
--- src/font.c	2012-11-03 05:11:34 +0000
+++ src/font.c	2012-11-09 14:05:15 +0000
@@ -1234,8 +1234,19 @@
 	f[j] = "*";
       else
 	{
+	  int c, k, l;
+
 	  val = SYMBOL_NAME (val);
-	  f[j] = SSDATA (val);
+	  len = SBYTES (val);
+	  f[j] = alloca (len + 1);
+	  /* Copy the name while excluding '-', '?', ',', and '"'.  */
+	  for (k = l = 0; k < len; k++)
+	    {
+	      c = SREF (val, k);
+	      if (c != '-' && c != '?' && c != ',' && c != '"')
+		f[l++] = c;
+	    }
+	  f[l] = '\0';
 	}
     }
 





This bug report was last modified 10 years and 161 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.