Subject: bug#10193: font problem with koi8-r encoding

From: Kenichi Handa <[email-masked]>
Date: Mon, 05 Dec 2011 16:51:24 +0900

In article <[email-masked]>, Werner LEMBERG <[email-masked]> writes:

>>> Starting with `emacs -Q' and loading a file encoded in koi8-r,
>>> Emacs uses an oblique style to display Russian characters on my
>>> GNU/Linux box.
> > 
> > bug#8046 ?

> Indeed.  Sorry for the duplicate.  Apparently, this bug report slipped
> under Ken'ichi-san's radar...

Yes, I'm sorry.  I've just installed the attached change.
Could you please check if it fixes the problem?

---
Kenichi Handa
[email-masked]

2011-12-05  Kenichi Handa  <[email-masked]>

	* ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
	return Qnil (Bug#8046, Bug#10193).

=== modified file 'src/ftfont.c'
--- src/ftfont.c	2011-11-30 16:33:05 +0000
+++ src/ftfont.c	2011-12-05 07:11:55 +0000
@@ -164,6 +164,13 @@
   char *str, *end;
   Lisp_Object adstyle;
 
+#ifdef FC_FONTFORMAT
+  if ((FcPatternGetString (p, FC_FONTFORMAT, 0, &fcstr) == FcResultMatch)
+      && (xstrcasecmp ((char *) fcstr, "bdf") != 0
+	  || xstrcasecmp ((char *) fcstr, "pcf") != 0))
+    /* Not a BDF nor PCF font.  */
+    return Qnil;
+#endif
   if (FcPatternGetString (p, FC_STYLE, 0, &fcstr) != FcResultMatch)
     return Qnil;
   str = (char *) fcstr;