ftfont.c (get_adstyle_property): If the font is not BDF nor PCF, return Qnil (Bug...
authorKenichi Handa <handa@m17n.org>
Mon, 5 Dec 2011 07:48:29 +0000 (16:48 +0900)
committerKenichi Handa <handa@m17n.org>
Mon, 5 Dec 2011 07:48:29 +0000 (16:48 +0900)
src/ChangeLog
src/ftfont.c

index 69e3eda..d897fad 100644 (file)
@@ -1,3 +1,8 @@
+2011-12-05  Kenichi Handa  <handa@m17n.org>
+
+       * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF,
+       return Qnil (Bug#8046, Bug#10193).
+
 2011-12-05  Kenichi Handa  <handa@m17n.org>
 
        * coding.c (encode_designation_at_bol): New args charbuf_end and
index c48346b..ec1a4ca 100644 (file)
@@ -164,6 +164,13 @@ get_adstyle_property (FcPattern *p)
   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;