]> granicus.if.org Git - graphviz/commitdiff
centos5 doesn't have pango_layout_get_baseline()
authorellson <devnull@localhost>
Sun, 13 Feb 2011 14:44:58 +0000 (14:44 +0000)
committerellson <devnull@localhost>
Sun, 13 Feb 2011 14:44:58 +0000 (14:44 +0000)
plugin/pango/gvtextlayout_pango.c

index b5a16030b290a3d940e128986dd4a3c2a4186746..9327aad2c8425cac83df1dd3203eeba94573f802 100644 (file)
@@ -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;