GNOME Bugzilla – Bug 314675
problem with get_type functions in pangocairo
Last modified: 2006-01-16 10:28:39 UTC
I notice that in pango/pangocairo-fc.h that pango_cairo_fc_font_map_get type() is defined, and that in pango/pangocairo-fcfont.c pango_cairo_fc_font_get_type is defined as an interface, yet these two functions don't seem to be defined anywhere in pango. This causes problems linking with the pangocairo.so library when linking it with GTK+. Should the PANGO_TYPE_XFT_FONT_MAP and the PANGO_TYPE_XFT_FONT be redefined to use a G_TYPE_CHECK_INSTANCE_CAST macro like the other _TYPE_ macros used in pango and these two functions removed? If so, I can provide a patch.
Another issue I notice with the configure script in pango is that it uses "AC_CHECK_LIB(cairo, cairo_ft_scaled_font_lock_face, have_cairo_freetype=true , :)" to identify if cairo has cairo_freetype. AC_CHECK_LIB macros don't work if you are using cairo's uninstalled.pc file to build since the cairo library isn't actually installed when the test runs and the uninstalled.pc file puts the "-L${pc_top_builddir}/${pcfiledir}/src/libcair.la" into the link statement, which confuses the linker since libtool isn't used by AC_CHECK_LIB. Not sure if there is a way to check for this feature without needing AC_CHECK_LIB. If not, I can hack the configure.in script locally to work around this problem. Perhaps a --enable-pangocairo configure argument could be passed to tell it to default to true instead of checking? If this is acceptable, I'll provide a patch.
G_DEFINE_TYPE_WITH_CODE (PangoCairoFcFontMap, pango_cairo_fc_font_map, PANGO_TYPE_FC_FONT_MAP, { G_IMPLEMENT_INTERFACE (PANGO_TYPE_CAIRO_FONT_MAP, cairo_font_map_iface_init) }); G_DEFINE_TYPE_WITH_CODE (PangoCairoFcFont, pango_cairo_fc_font, PANGO_TYPE_FC_FONT, { G_IMPLEMENT_INTERFACE (PANGO_TYPE_CAIRO_FONT, cairo_font_iface_init) }); I think you'll find them in the library if you use nm. I'm not sure how the Xft macros are involved at all... In terms of the uninstalled stuff, there are some examples in GTK+'s configure.in of handling bypassing tests. You probably can just assume cairo-freetype is there if building with -uninstalled; when the first person wants to use -uninstalled files on Windows we can deal with it then.
Created attachment 51894 [details] [review] fix uninstalled-pc file
Created attachment 51895 [details] [review] patch to fix configure when using uninstalled cairo
2006-01-16 Behdad Esfahbod <behdad@gnome.org> Fixes bug #314675, Brian Cameron. * configure.in: Handle uninstalled cairo. * pangocairo-uninstalled.pc.in: Fix typo: libpangoxft->libpangocairo.