Re: pango_layout_get_pixel_extents crash on Win32



On Fri, 2007-09-07 at 00:48 +0200, David Nečas (Yeti) wrote:
> On Thu, Sep 06, 2007 at 05:12:05PM -0400, Owen Taylor wrote:
> > 
> >  - Your code assumes that the fonts for the Pango backend used on GTK+
> > are the same as those for the FT2 backend ... true on X11, where both
> > are using fontconfig. False on windows, where GTK+ uses the native
> > font catalog and font system. Now, of course, using a font description
> > that doesn't point to a known font shouldn't *crash*,
> 
> Should't I get either the requested font or a replacement
> (possibly being awarded with a Pango warning)?

Can you at least give us a backtrace or something?

> > but it's quite
> > possible that your users have *no fonts at all* configured for the FT2
> > backend, and at that point, it's more likely that there might be a
> > crash.
> > 
> >  - Using FT2 on Windows is generally a poor idea.
> 
> Hm, I thought Gimp had been using FT2 so it could not be so
> bad -- but maybe I was mistaken.

That's still the case I guess.

> Anyway, if it's possible
> that there are no fonts at all configured for FT2 then
> obviously I cannot use it, at least not on Win32.
> 
> >  To render to an
> > offscreen in-memory image, use cairo. With pango/cairo, you can render
> > to offscreen images using the exact same font catalog that GTK+ is
> > using, rather than dragging in an nonnative, innappropriate
> > dependencies (FreeType/fontconfig).
> 
> I see.  The trouble is my application has still Gtk+ 2.6 as
> the lowest supported version (and changing requirements in
> a minor stable version is a bit unfortunate).
> 
> Does any safe off-screen text rendering method exist that
> does not require Cairo?  I do not need much features, simple
> strings with some default font would be sufficient.
> 
> Since I need off-screen text rendering only in a few places
> I could also branch the code according to the platform, but
> I'd rather avoid this too if there is another way...
>
> Yeti

-- 
behdad
http://behdad.org/

"Those who would give up Essential Liberty to purchase a little
 Temporary Safety, deserve neither Liberty nor Safety."
        -- Benjamin Franklin, 1759






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