inkscape-0.48.4 uses pangoft2 but does not explicitly link it in

Bug #1158787 reported by Michael Weiser on 2013-03-22
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
High
Michael Weiser

Bug Description

src/libnrtype/FontFactory.cpp uses pangoft2 (and fontconfig). However, configure does not check for the corresponding pkg-config module and does not add its libraries for linking. This is not normally a problem because libpangoft2-1.0 is pulled in by libgtk-x11-2.0:

linux:~# pkg-config --libs gtk+-2.0
-lgtk-x11-2.0 -lgdk-x11-2.0 -latk-1.0 -lgio-2.0 -lpangoft2-1.0 -lpangocairo-1.0 -lgdk_pixbuf-2.0 -lcairo -lpango-1.0 -lfreetype -lfontconfig -lgobject-2.0 -lglib-2.0

If GTK is running with another backend, it might not use pangoft2 or fontconfig and therefore not link against them:

macosx108:~ # pkg-config --libs gtk+-2.0
-framework Carbon -lgtk-quartz-2.0 -lgdk-quartz-2.0 -lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo -lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lintl

(-lpangoft2-1.0 and -lfontconfig are missing)

With my Gentoo prefix portage setup on Mac OS X 10.8 with GTK compiled with Quartz backend this results in link errors such as this:

Undefined symbols for architecture x86_64:
  "_pango_fc_font_get_type", referenced from:
      Inkscape::Extension::Internal::CairoRenderContext::renderGlyphtext(_PangoFont*, Geom::Matrix const*, std::vector<Inkscape::Extension::Internal::CairoGlyphInfo, std::allocator<Inkscape::Extension::Internal::CairoGlyphInfo> > const&, SPStyle const*)in libinkscape.a(cairo-render-context.o)
  "_FcPatternGetDouble", referenced from:
      Inkscape::Extension::Internal::CairoRenderContext::renderGlyphtext(_PangoFont*, Geom::Matrix const*, std::vector<Inkscape::Extension::Internal::CairoGlyphInfo, std::allocator<Inkscape::Extension::Internal::CairoGlyphInfo> > const&, SPStyle const*)in libinkscape.a(cairo-render-context.o)
  "_FcPatternAddBool", referenced from:
      FactorySubstituteFunc(_FcPattern*, void*) in libinkscape.a(FontFactory.o)
  "_pango_ft2_font_map_new", referenced from:
      font_factory::font_factory()in libinkscape.a(FontFactory.o)
  "_pango_ft2_font_map_set_resolution", referenced from:
      font_factory::font_factory()in libinkscape.a(FontFactory.o)
  "_pango_ft2_font_map_create_context", referenced from:
      font_factory::font_factory()in libinkscape.a(FontFactory.o)
  "_pango_ft2_font_map_set_default_substitute", referenced from:
      font_factory::font_factory()in libinkscape.a(FontFactory.o)
  "_pango_ft2_font_get_face", referenced from:
      font_instance::MapUnicodeChar(unsigned int)in libinkscape.a(FontInstance.o)
      font_instance::InitTheFace() in libinkscape.a(FontInstance.o)
ld: symbol(s) not found for architecture x86_64

The attached patch fixes this for me by explicitly pulling in the pangoft2 libs via pkg-config --libs in configure. This also takes care of fontconfig:

macosx108:~ # pkg-config --libs pangoft2
-lpangoft2-1.0 -lpango-1.0 -lgobject-2.0 -lglib-2.0 -lintl -lfreetype -lfontconfig

The whole issue might indicate that it would be better not to use pangtoft2 on Mac OS X with Quartz as GTK backend at all but I lack the knowledge to tell for sure or even provide an alternative.

Related branches

Michael Weiser (michael-weiser) wrote :
Alex Valavanis (valavanisalex) wrote :

Note that this issue was fixed in trunk in lp:inkscape r12098. Backport needed

Changed in inkscape:
importance: Undecided → High
status: New → Fix Committed
milestone: none → 0.49
tags: added: backport-proposed build
Alex Valavanis (valavanisalex) wrote :

Backported fix to lp:inkscape/0.48.x r9946. Thanks for the patch!

Changed in inkscape:
assignee: nobody → Michael Weiser (michael-weiser)
milestone: 0.49 → 0.48.5
Kris (kris-degussem) on 2013-12-11
tags: removed: backport-proposed
Changed in inkscape:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers