Re: Pango error with Gaim



On Mon, 2005-11-21 at 09:31 -0500, Owen Taylor wrote:
> On Thu, 2005-11-17 at 01:07 -0500, Karim Zaki wrote:
> > Dear all,
> > 
> > I'm compiling Gaim for my Mac OS X. I reached the stage of having
> > compiled, made and installed Gaim along with all its dependencies,
> > including Pango and Cairo. Now when I come to start Gaim, I get the
> > following:
> > 
> > $ /usr/local/bin/gaim
> > 
> > Pango-ERROR **: Unable create Cairo font
> > aborting...
> > Abort trap
> 
> This error usually means that the fontconfig database is pointing
> to a font that doesn't exist on your system. You might want to examine
> the output of 'fc-list - family style file', though it may be hard
> to figure out what font it's trying to load if you have a lot on
> your system.
> 
> I've had some problems with bugs in the recent devel snapshots of
> fontconfig ... if you grabbed one of those, make sure you have
> run fc-cache on your font directories explicitly ... the
> implicit cache file in ~/.fonts.cache-2 doesn't really work.
> 
> Regards,
> 					Owen
> 
> P.S. - I don't like at all that Pango is vulnerable to this problem.
> There would be two ways to try to make things better:
> 
>   1. If cairo_scaled_font_create(), create a "dummy font" that 
>      sizes and returns characters as if it was all boxes. This is
>      going to be pretty hard because the shapers expect to be
>      able to get a FT_Face for a font.
> 
>      Or, a variant of this, have such a font distributed with Pango
>      (perhaps even built into the binary) and use that for the
>      result of pango_fc_font_lock_face().
> 
>  2. Try to catch the problem earlier when we can do something about
>     it... unfortunately, it hurts a lot to actually load a font
>     off disk that we aren't using. Maybe in 
>     
>      pango-context.c:get_shaper_and_font_foreach()
> 
>     There could be a call to a pango_font_validate() or something
>     before a font is chosen for a character. The simplest validation
>     would just be a stat() on the filename from the FT_Pattern.
>     Or you could go further and actually call
>     cairo_scaled_font_create() at that point the first time you
>     use a particular filename - that would catch permission problems - 
>     right now I think making a font under /usr/share/fonts not
>     readable to users is an easy way to get Pango to assert as
>     above.
> 

Btw, Owen. I was unsuccessful in reproducing your problem ~/.fonts
problem. I moved the vera ttf from /usr/share/fonts to ~/.fonts,
recreated the font caches, and everything still worked.

You are right about making fonts unreadable. That yields a segfault
somewhere deep in pango, which is pretty bad.

Matthias




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]