[cairo] Issues with Pango on OSX

Travis Griggs tgriggs at cincom.com
Fri Jul 9 00:00:48 PDT 2010


On Jul 8, 2010, at 11:04 PM, Alexander Shulgin wrote:

> On Thu, Jul 8, 2010 at 18:38, Travis Griggs <tgriggs at cincom.com>  
> wrote:
>>
>> The reason I think that, is that when I first starting making calls  
>> into it
>> from my program, I start seeing lots of errors on stderr of the  
>> nature:
>>
>> (process:82410): GLib-GObject-CRITICAL **: gtype.c:2711: You forgot  
>> to call
>> g_type_init()
>> (process:82410): GLib-GObject-WARNING **: invalid cast from  
>> `PangoModule' to
>> `<invalid>'
>> (process:82410): GLib-GObject-CRITICAL **: gtype.c:2766: You forgot  
>> to call
>> g_type_init()
>> (process:82410): GLib-GObject-CRITICAL **: g_object_new: assertion
>> `G_TYPE_IS_OBJECT (object_type)' failed
>> (process:82410): Pango-WARNING **: Failed to load Pango module
>> '/Users/travis/CairoPixmanBuild/lib/pango/1.6.0/modules/pango-basic- 
>> atsui.so'
>> for id 'BasicScriptEngineATSUI'
>> (process:82410): GLib-GObject-WARNING **: cannot register existing  
>> type
>> `PangoEngine'
>> (process:82410): GLib-GObject-CRITICAL **: g_type_register_static:  
>> assertion
>> `parent_type > 0' failed
>> (process:82410): GLib-GObject-CRITICAL **: gtype.c:2711: You forgot  
>> to call
>> g_type_init()
>> (process:82410): GLib-GObject-WARNING **: invalid cast from  
>> `PangoModule' to
>> `<invalid>'
>> (process:82410): GLib-GObject-CRITICAL **: gtype.c:2766: You forgot  
>> to call
>> g_type_init()
>> (process:82410): GLib-GObject-WARNING **: plugin '(unknown)' failed  
>> to
>> register type '(null)'
>>
>> None of that looks very good at all. In particular 5th one down,  
>> the one
>> where it can't load the atsui module. The file is indeed at that  
>> location.
>> Any idea what gives here? I do not build cairo with xlib or ft/fc,  
>> and when
>> Pango runs it's configure, it says the only backend it is building is
>> pangocairo.
>>
>> Thanks for any help you can give on why I'm seeing these errors.
>
> I have no clue about what's causing gtype errors, but with failing .so
> you might consider this:
>
> 1. On OS X it should be actually .dylib, not .so
>
> 2. You can use `otool -L <filename>.dylib' to inspect library
> dependencies.  Some of them missing, then this is causing your pango
> module load error.
>
> I've used install_name_tool on OS X to break cairo and some other libs
> (no pango among them) free of absolute path dependencies.  If you can
> show what commands you used, I think I'll be able to pinpoint the
> problem (if it is at that stage).

I was able to get this to work, apparently .so's actually work on OSX.  
The issue was that it was not finding pango.modules, and so not ending  
up with any .so's that matched the relocated libraries. I applied a  
patch that Owen Taylor was nice enough to point me at, which makes it  
so the resolution of pango.modules can be tuned by an environment  
variable. It can then be tuned, and the .so's can be adjusted using  
install_name_tool the same as the dylibs.

--
Travis Griggs
Objologist
"No other topic generates more heat and less light than code  
formatting" --Kent Beck



More information about the cairo mailing list