]> granicus.if.org Git - graphviz/commitdiff
back out previous change to hak in support for FreeSans.ttf
authorellson <devnull@localhost>
Tue, 29 Jan 2008 16:34:12 +0000 (16:34 +0000)
committerellson <devnull@localhost>
Tue, 29 Jan 2008 16:34:12 +0000 (16:34 +0000)
 - it didn't work, and it was ugly

plugin/pango/gvtextlayout_pango.c

index a1575825a757895038ecd2c1ac6e8b2f40f8916d..899aa1902a0c2139d29a588fbfd0032c9c169593 100644 (file)
@@ -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));