]> granicus.if.org Git - graphviz/commitdiff
Code changes to support selection of pango PS font from equivalent installed fonts
authordperry <devnull@localhost>
Tue, 22 Feb 2011 05:28:39 +0000 (05:28 +0000)
committerdperry <devnull@localhost>
Tue, 22 Feb 2011 05:28:39 +0000 (05:28 +0000)
plugin/pango/Makefile.am
plugin/pango/gvtextlayout_pango.c

index 4cde683872746d462ddf1831ec9f9f8832357014..2899d53b4f6dc5ed709c6d82ce394d462a67ca08 100644 (file)
@@ -30,6 +30,7 @@ endif
 libgvplugin_pango_C_la_SOURCES = \
        gvplugin_pango.c \
        gvrender_pango.c \
+       gvgetfontlist_pango.c \
        gvtextlayout_pango.c \
        gvloadimage_pango.c
 
index 9327aad2c8425cac83df1dd3203eeba94573f802..618029df1a71995ba64e41598f94fdc4a164a62d 100644 (file)
@@ -21,6 +21,7 @@
 
 #ifdef HAVE_PANGOCAIRO
 #include <pango/pangocairo.h>
+#include "gvgetfontlist.h"
 #ifdef HAVE_PANGO_FC_FONT_LOCK_FACE
 #include <pango/pangofc-font.h>
 #endif
@@ -67,6 +68,7 @@ static boolean pango_textlayout(textpara_t * para, char **fontpath)
     static PangoFontDescription *desc;
     static char *fontname;
     static double fontsize;
+    static gv_font_map gv_fmap[MAX_GV_PS_FONTS];
     char *fnt, *psfnt = NULL;
     PangoLayout *layout;
     PangoRectangle logical_rect;
@@ -82,6 +84,7 @@ static boolean pango_textlayout(textpara_t * para, char **fontpath)
 
     if (!context) {
        fontmap = pango_cairo_font_map_new();
+       get_font_mapping(fontmap,gv_fmap);
        context = pango_cairo_font_map_create_context (PANGO_CAIRO_FONT_MAP(fontmap));
        options=cairo_font_options_create();
        cairo_font_options_set_antialias(options,CAIRO_ANTIALIAS_GRAY);
@@ -100,7 +103,9 @@ static boolean pango_textlayout(textpara_t * para, char **fontpath)
        pango_font_description_free (desc);
 
        if (para->postscript_alias) {
-           psfnt = fnt = pango_psfontResolve (para->postscript_alias);
+           psfnt = fnt = gv_fmap[para->postscript_alias->xfig_code].gv_font;
+           if(psfnt == NULL)
+               psfnt = fnt = pango_psfontResolve (para->postscript_alias);
        }
        else
            fnt = fontname;