After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 575866 - Assertion fail (font finalize) pango win32
Assertion fail (font finalize) pango win32
Status: RESOLVED FIXED
Product: GIMP
Classification: Other
Component: Tools
git master
Other Windows
: Normal critical
: 2.8
Assigned To: GIMP Bugs
GIMP Bugs
: 572944 585302 593126 597901 603401 608192 (view as bug list)
Depends on:
Blocks:
 
 
Reported: 2009-03-18 18:56 UTC by Marcin eXine Merda
Modified: 2015-11-29 15:19 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Marcin eXine Merda 2009-03-18 18:56:51 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
Comment 1 Murray Cumming 2009-03-18 21:45:38 UTC
pangomm is not involved. Maybe pango. Reassigning.
Comment 2 Tor Lillqvist 2009-08-25 07:11:27 UTC
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".)
Comment 3 Michael Schumacher 2009-08-26 09:52:24 UTC
*** Bug 593126 has been marked as a duplicate of this bug. ***
Comment 4 Tor Lillqvist 2009-08-26 13:05:58 UTC
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.
Comment 5 Tor Lillqvist 2009-08-26 13:30:26 UTC
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.
Comment 6 Tor Lillqvist 2009-08-26 13:33:08 UTC
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.
Comment 7 Tor Lillqvist 2009-08-26 17:54:11 UTC
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
  • #0 g_log
    at gmessages.c line 525
  • #1 pango_font_map_real_load_fontset
    at pango-fontmap.c line 222
  • #2 pango_font_map_load_fontset
    at pango-fontmap.c line 136
  • #3 itemize_state_update_for_new_run
    at pango-context.c line 1349
  • #4 itemize_state_process_run
    at pango-context.c line 1388
  • #5 pango_itemize_with_base_dir
    at pango-context.c line 1527
  • #6 pango_layout_check_lines
    at pango-layout.c line 3830
  • #7 pango_layout_get_extents_internal
    at pango-layout.c line 2444
  • #8 pango_layout_get_extents
    at pango-layout.c line 2624
  • #9 pango_layout_get_pixel_extents
    at pango-layout.c line 2648
  • #10 gimp_font_get_new_preview
    at gimpfont.c line 293
  • #11 gimp_viewable_get_preview
    at gimpviewable.c line 708
  • #12 gimp_viewable_real_get_new_pixbuf
    at gimpviewable.c line 329
  • #13 gimp_viewable_get_pixbuf
    at gimpviewable.c line 874
  • #14 gimp_view_renderer_real_render
    at gimpviewrenderer.c line 754
  • #15 gimp_view_renderer_real_draw
    at gimpviewrenderer.c line 688
  • #16 gimp_view_renderer_draw
    at gimpviewrenderer.c line 609
  • #17 gimp_cell_renderer_viewable_render
    at gimpcellrendererviewable.c line 270
  • #18 gtk_cell_renderer_render
    at gtkcellrenderer.c line 578
  • #19 gtk_tree_view_column_cell_process_action
    at gtktreeviewcolumn.c line 2802

Comment 8 Tor Lillqvist 2009-08-26 18:04:31 UTC
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)
Comment 9 Tor Lillqvist 2009-08-26 21:14:21 UTC
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.
Comment 10 Tor Lillqvist 2009-08-26 22:04:43 UTC
Rebuilt cairo and pango win32 binaries now on ftp.gnome.org.
Comment 11 Michael Schumacher 2009-10-09 14:55:17 UTC
*** Bug 597901 has been marked as a duplicate of this bug. ***
Comment 12 Michael Schumacher 2009-12-01 17:51:13 UTC
*** Bug 603401 has been marked as a duplicate of this bug. ***
Comment 13 Michael Schumacher 2010-01-26 20:59:49 UTC
*** Bug 608192 has been marked as a duplicate of this bug. ***
Comment 14 Michael Schumacher 2010-01-26 21:01:28 UTC
*** Bug 585302 has been marked as a duplicate of this bug. ***
Comment 15 Michael Schumacher 2010-01-26 21:01:58 UTC
*** Bug 572944 has been marked as a duplicate of this bug. ***