GNOME Bugzilla – Bug 575866
Assertion fail (font finalize) pango win32
Last modified: 2015-11-29 15:19:41 UTC
Steps to reproduce: 1. Run GIMP 2.8 Windows build (i uses that version) 2. Select the text tool 3. Use the Segoe UI font 4. In GIMP output you may can see an pango error Stack trace: Sorry, but I doesn't know how to do that on Win32... I send the console output of this error: Pango:ERROR:pangowin32.c:838:pango_win32_font_finalize: assertion failed: (win32 font->fontmap != NULL) Other information: The Segoe UI font can be found on Vista, but I packed it with tar and bz2 and can be downloaded here: http://exine.rootnode.net/gimp/segoeui.tbz2
pangomm is not involved. Maybe pango. Reassigning.
Please don't redistribute fonts that you have no right to redistribute. I am sure people who are seriously interested in and capable of fixing this bug have access to a Vista machine. As for the actual problem, sorry, no information yet. But I wonder why you talk about GIMP 2.8 when the development branch of GIMP is only at 2.7.0 currrently? Where did you get this GIMP "2.8" from? Is it claimed to be stable and usable? What version of Pango does it come with? (Please note that the Severity field is mostly pointless in this bugzilla. You won't get any more attention by setting it to "critical".)
*** Bug 593126 has been marked as a duplicate of this bug. ***
I can reproduce this. The first and presumably thus most significant problem I see is that the PANGO_IS_FC_FONT() in gimp_font_get_sample_string() fails. The problem doesn't seem to be related to the Segoe UI font in particular. Could this problem be caused by GIMP somewhere assuming that the normal fonts GTK+ uses are from the fontconfig Pango backend and thus can be used with pango_fc_* functions? On Windows that is not true. It is just the fonts from the Freetype Pango backend that can be used with pango_fc_* functions.
Comparing the font that is returned from the call to pango_context_load_font() in gimp_font_get_sample_string() in GIMP 2.6 and master head, in 2.6 it is an object of type PangoFT2Font (which is as expected), while in master it is of type PangoCairoWin32Font which is wrong, and no wonder PANGO_IS_FC_FONT fails on it.
My suspicion is that this is a problem in GIMP, not Pango, as the text tool works fine in GIMP 2.6 with the same Pango, fontconfig and freetype binaries. But I can't be 100% sure yet.
mitch tells me on IRC that the warning message from gimp_font_get_sample_string() is probably not the real problem, that function is supposed to just return a "Aa" if PANGO_IS_FC_FONT() is not true. So I changed the g_return_val_if_fail() to a plain if statement, then the next warning is here: (gdb) bt 20
+ Trace 217157
Here are all the warnings before the crash: (Well, the actual fonts mentioned in the warnings of course depends on how one happens to scroll the font chooser). I guess this really is a bug in pangowin32 then. It doesn't behave as expected. Or something, sigh. (gimp-2.7.exe:4168): Pango-WARNING **: couldn't load font "Segoe Condensed, Bold Condensed Not-Rotated 16", falling back to "Sans Bold Condensed Not-Rotated 16", expect ugly output. (gimp-2.7.exe:4168): Pango-WARNING **: couldn't load font "Sans Bold Condensed Not-Rotated 16", falling back to "Sans Not-Rotated 16", expect ugly output. (gimp-2.7.exe:4168): Pango-WARNING **: couldn't load font "Segoe Condensed, Condensed Not-Rotated 16", falling back to "Sans Condensed Not-Rotated 16", expect ugly output. (gimp-2.7.exe:4168): Pango-WARNING **: couldn't load font "Sans Condensed Not-Rotated 16", falling back to "Sans Not-Rotated 16", expect ugly output. (gimp-2.7.exe:4168): Pango-WARNING **: couldn't load font "Rockwell Condensed, Bold Condensed Not-Rotated 16", falling back to "Sans Bold Condensed Not-Rotated 16", expect ugly output. (gimp-2.7.exe:4168): Pango-WARNING **: couldn't load font "Rockwell Condensed, Condensed Not-Rotated 16", falling back to "Sans Condensed Not-Rotated 16", expect ugly output. (gimp-2.7.exe:4168): Pango-WARNING **: couldn't load font "Ravie Semi-Expanded Not-Rotated 16", falling back to "Sans Semi-Expanded Not-Rotated 16", expect ugly output. (gimp-2.7.exe:4168): Pango-WARNING **: couldn't load font "Sans Semi-Expanded Not-Rotated 16", falling back to "Sans Not-Rotated 16", expect ugly output. (gimp-2.7.exe:4168): Pango-WARNING **: couldn't load font "Playbill Ultra-Condensed Not-Rotated 16", falling back to "Sans Ultra-Condensed Not-Rotated 16", expect ugly output. (gimp-2.7.exe:4168): Pango-WARNING **: couldn't load font "Sans Ultra-Condensed Not-Rotated 16", falling back to "Sans Not-Rotated 16", expect ugly output. (gimp-2.7.exe:4168): Pango-CRITICAL **: pango_win32_font_map_get_font_cache: assertion `font_map != NULL' failed ** Pango:ERROR:pangowin32.c:838:pango_win32_font_finalize: assertion failed: (win32font->fontmap != NULL)
The problem was easiest to fix by making GIMP explicitly ask for a font map for the freetype cairo font type in the text tool. For that to work one then needs a cairo that includes thee freetype backend, and also a Pango that is built against such a cairo. I will build the "official" Windows cairo and Pango binaries on ftp.gnome.org like that in the future. Fix committed and pushed to GIMP. No source code changes needed to Pango or cairo, just a rebuild.
Rebuilt cairo and pango win32 binaries now on ftp.gnome.org.
*** Bug 597901 has been marked as a duplicate of this bug. ***
*** Bug 603401 has been marked as a duplicate of this bug. ***
*** Bug 608192 has been marked as a duplicate of this bug. ***
*** Bug 585302 has been marked as a duplicate of this bug. ***
*** Bug 572944 has been marked as a duplicate of this bug. ***