Re: pango_layout_get_pixel_extents crash on Win32



On 9/6/07, David Nečas (Yeti) <yeti physics muni cz> wrote:
>
> Hello,
>
> I have a problem with pango_layout_get_pixel_extents()
> crashing on Win32 with a layout created from FT2 context.
>
> I cannot reproduce the problem myself which complicates
> debugging a bit...  However, I extracted the problem into
> a relatively minimal program that my users confirm crashing
> the same way as the application -- it's attached at the end.
>
> The program works flawlessly on Unix/X11.

I can't really guess exactly why it is crashing, but a couple of notes:

 - pango_layout_get_pixel_extents() is a bit of a red herring - it's
just the first time that it is actually laying out the text. What you
are saying is that "laying out the text of a layout is crashing". A
much more general complaint.

 - 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*, 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. 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).

- Owen


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