From: ellson Date: Tue, 29 Jan 2008 16:34:12 +0000 (+0000) Subject: back out previous change to hak in support for FreeSans.ttf X-Git-Tag: LAST_LIBGRAPH~32^2~4807 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c44d8097249cd643ab9b2c8073c0330f2a59180e;p=graphviz back out previous change to hak in support for FreeSans.ttf - it didn't work, and it was ugly --- diff --git a/plugin/pango/gvtextlayout_pango.c b/plugin/pango/gvtextlayout_pango.c index a1575825a..899aa1902 100644 --- a/plugin/pango/gvtextlayout_pango.c +++ b/plugin/pango/gvtextlayout_pango.c @@ -58,7 +58,7 @@ static boolean pango_textlayout(textpara_t * para, char **fontpath) PangoAttrList *attrs; GError *error = NULL; #endif - char *text, *tfnt, *pos; + char *text; double textlayout_scale; if (!context) { @@ -84,12 +84,7 @@ static boolean pango_textlayout(textpara_t * para, char **fontpath) else fnt = fontname; - /* suppress any extents - like in FreeSans.ttf (doxygen backwards compat) */ - tfnt = strdup(fnt); - if ((pos = strrchr(tfnt, '.'))) - *pos = '\0'; - - desc = pango_font_description_from_string(tfnt); + desc = pango_font_description_from_string(fnt); if (fontpath) { /* -v support */ #ifdef HAVE_FONTCONFIG @@ -97,12 +92,10 @@ static boolean pango_textlayout(textpara_t * para, char **fontpath) FcFontSet *fs; FcResult result; - if (! FcInit()) { - free(tfnt); + if (! FcInit()) return FALSE; - } - pat = FcNameParse((FcChar8 *) tfnt); + pat = FcNameParse((FcChar8 *) fnt); FcConfigSubstitute (0, pat, FcMatchPattern); FcDefaultSubstitute (pat); fs = FcFontSetCreate(); @@ -133,7 +126,6 @@ static boolean pango_textlayout(textpara_t * para, char **fontpath) *fontpath = fnt; #endif } - free(tfnt); } /* all text layout is done at a scale of 96ppi */ pango_font_description_set_size (desc, (gint)(para->fontsize * PANGO_SCALE));