From: ellson Date: Sun, 13 Feb 2011 14:44:58 +0000 (+0000) Subject: centos5 doesn't have pango_layout_get_baseline() X-Git-Tag: LAST_LIBGRAPH~32^2~1036 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=61162202a8727d7a6bb3b53647f77d679d2b3b4f;p=graphviz centos5 doesn't have pango_layout_get_baseline() --- diff --git a/plugin/pango/gvtextlayout_pango.c b/plugin/pango/gvtextlayout_pango.c index b5a16030b..9327aad2c 100644 --- a/plugin/pango/gvtextlayout_pango.c +++ b/plugin/pango/gvtextlayout_pango.c @@ -230,7 +230,15 @@ static boolean pango_textlayout(textpara_t * para, char **fontpath) para->height = (int)(para->fontsize * 1.1 + .5); /* The y offset from baseline to 0,0 of the bitmap representation */ +#if defined PANGO_VERSION_MAJOR && (PANGO_VERSION_MAJOR >= 1) para->yoffset_layout = pango_layout_get_baseline (layout) * textlayout_scale; +#else + { + /* do it the hard way on rhel5/centos5 */ + PangoLayoutIter *iter = pango_layout_get_iter (layout); + para->yoffset_layout = pango_layout_iter_get_baseline (iter) * textlayout_scale; + } +#endif /* The distance below midline for y centering of text strings */ para->yoffset_centerline = 0.2 * para->fontsize;