From c3c9e25e5d2c222d9f79a503c714b48c06078c08 Mon Sep 17 00:00:00 2001 From: Kenichi Handa Date: Mon, 5 Dec 2011 16:48:29 +0900 Subject: [PATCH] ftfont.c (get_adstyle_property): If the font is not BDF nor PCF, return Qnil (Bug#8046, Bug#10193). --- src/ChangeLog | 5 +++++ src/ftfont.c | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/src/ChangeLog b/src/ChangeLog index 69e3eda2630..d897fadd292 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2011-12-05 Kenichi Handa + + * ftfont.c (get_adstyle_property): If the font is not BDF nor PCF, + return Qnil (Bug#8046, Bug#10193). + 2011-12-05 Kenichi Handa * coding.c (encode_designation_at_bol): New args charbuf_end and diff --git a/src/ftfont.c b/src/ftfont.c index c48346b0147..ec1a4ca6a78 100644 --- a/src/ftfont.c +++ b/src/ftfont.c @@ -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; -- 2.39.2