[gnome-characters] Fix build failure due to missing symbols from pangoft2
- From: Daiki Ueno <dueno src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-characters] Fix build failure due to missing symbols from pangoft2
- Date: Sat, 9 May 2015 00:28:12 +0000 (UTC)
commit b0961775ab569efa58d277d983599586e6e4772b
Author: Tim Lunn <tim feathertop org>
Date: Sun Apr 19 09:36:07 2015 +1000
Fix build failure due to missing symbols from pangoft2
https://bugzilla.gnome.org/show_bug.cgi?id=748124
configure.ac | 13 +++++++++++++
lib/Makefile.am | 3 ++-
lib/gc.c | 44 ++++++++++++++++++++++----------------------
3 files changed, 37 insertions(+), 23 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index d35ae08..727c2b7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -83,6 +83,19 @@ AC_SUBST(GLIB_COMPILE_RESOURCES)
PKG_CHECK_MODULES([LIBGC], [gio-2.0 gtk+-3.0 pango])
+AC_ARG_ENABLE(pangoft2,
+ AS_HELP_STRING([--disable-pangoft2], [disable pangoft2 support]),,
+ enable_pangoft2=auto
+)
+
+AS_IF([test "$enable_pangoft2" = "yes"], [have_pangoft2=yes],
+ [test "$enable_pangoft2" = "auto"], PKG_CHECK_EXISTS([pangoft2], [have_pangoft2=yes]))
+
+AS_IF([test "$have_pangoft2" = "yes"], [
+ PKG_CHECK_MODULES([PANGOFT2], [pangoft2])
+ AC_DEFINE([HAVE_PANGOFT2],[1],[Define if you want to enable pangoft2 support])
+])
+
AC_CONFIG_FILES([
Makefile
data/Makefile
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 13e2f74..b8cbed8 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -7,11 +7,12 @@ AM_CPPFLAGS = \
-DG_LOG_DOMAIN=\"libgc\" \
-DG_DISABLE_DEPRECATED \
$(LIBGC_CFLAGS) \
+ $(PANGOFT2_CFLAGS) \
$(NULL)
pkglib_LTLIBRARIES = libgc.la
-libgc_la_LIBADD = $(LIBGC_LIBS) $(LTLIBICONV) $(LTLIBUNISTRING) $(builddir)/../gllib/libgnu.la
+libgc_la_LIBADD = $(LIBGC_LIBS) $(LTLIBICONV) $(LTLIBUNISTRING) $(PANGOFT2_LIBS)
$(builddir)/../gllib/libgnu.la
libgc_la_LDFLAGS = -avoid-version
libgc_la_sources = gc.h gc.c
libgc_la_SOURCES = $(libgc_la_sources) confusables.h
diff --git a/lib/gc.c b/lib/gc.c
index b0ad00c..b883e12 100644
--- a/lib/gc.c
+++ b/lib/gc.c
@@ -805,36 +805,36 @@ gc_pango_context_font_has_glyph (PangoContext *context,
PangoFont *font,
gunichar uc)
{
+#ifdef HAVE_PANGOFT2
if (PANGO_IS_FC_FONT (font))
/* Fast path when the font is loaded as PangoFcFont. */
{
PangoFcFont *fcfont = PANGO_FC_FONT (font);
return pango_fc_font_has_char (fcfont, uc);
}
- else
- /* Slow path performing actual rendering. */
+#endif
+
+ /* Slow path performing actual rendering. */
+ PangoLayout *layout;
+ GError *error;
+ gchar *utf8;
+ glong items_written;
+ int retval;
+
+ utf8 = g_ucs4_to_utf8 (&uc, 1, NULL, &items_written, &error);
+ if (!utf8)
{
- PangoLayout *layout;
- GError *error;
- gchar *utf8;
- glong items_written;
- int retval;
-
- utf8 = g_ucs4_to_utf8 (&uc, 1, NULL, &items_written, &error);
- if (!utf8)
- {
- g_printerr ("error in decoding: %s\n", error->message);
- g_error_free (error);
- }
+ g_printerr ("error in decoding: %s\n", error->message);
+ g_error_free (error);
+ }
- layout = pango_layout_new (context);
- gc_pango_layout_disable_fallback (layout);
- pango_layout_set_text (layout, utf8, items_written);
- g_free (utf8);
+ layout = pango_layout_new (context);
+ gc_pango_layout_disable_fallback (layout);
+ pango_layout_set_text (layout, utf8, items_written);
+ g_free (utf8);
- retval = pango_layout_get_unknown_glyphs_count (layout);
- g_object_unref (layout);
+ retval = pango_layout_get_unknown_glyphs_count (layout);
+ g_object_unref (layout);
- return retval == 0;
- }
+ return retval == 0;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]