From: ellson Date: Fri, 23 May 2008 02:06:00 +0000 (+0000) Subject: check class of font before assuming that it is from fontconfig X-Git-Tag: LAST_LIBGRAPH~32^2~4011 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0809b0ecefdc2121b84d82fa9053726c1a4db376;p=graphviz check class of font before assuming that it is from fontconfig --- diff --git a/plugin/pango/gvtextlayout_pango.c b/plugin/pango/gvtextlayout_pango.c index d9d54bd62..812aec5f2 100644 --- a/plugin/pango/gvtextlayout_pango.c +++ b/plugin/pango/gvtextlayout_pango.c @@ -87,13 +87,19 @@ static boolean pango_textlayout(textpara_t * para, char **fontpath) if (fontpath) { /* -v support */ PangoFont *font; + const char *fontclass; font = pango_font_map_load_font(fontmap, context, desc); + fontclass = G_OBJECT_CLASS_NAME(G_OBJECT_GET_CLASS(font)); buf[0] = '\0'; if (psfnt) strcat(buf, "(ps) "); #ifdef HAVE_PANGO_FC_FONT_LOCK_FACE + if (strcmp(fontclass, "PangoCairoFcFont") == 0) +#else + if (false) +#endif { FT_Face face; PangoFcFont *fcfont; @@ -125,8 +131,7 @@ static boolean pango_textlayout(textpara_t * para, char **fontpath) else strcat(buf, "*not using fontconfig*"); } -#else - { + else { PangoFontDescription *tdesc; char *tfont; @@ -137,7 +142,6 @@ static boolean pango_textlayout(textpara_t * para, char **fontpath) strcat(buf, "\" "); g_free(tfont); } -#endif *fontpath = buf; } }