GNOME Bugzilla – Bug 149603
Example application fails with assertion (face != NULL)
Last modified: 2006-12-03 14:56:55 UTC
Call to Gnome::Print::Font::find_closest of the example distributed with gnomeprintmm 2.5.1 fails. Console output: (process:4679): GnomePrint-CRITICAL **: file gnome-font.c: line 291 (gnome_font_find_closest): assertion `face != NULL' failed Dependencies: libgnomeprintmm-2.5.so.2 => /usr/local/stow/libgnomeprintmm-2.5.1/lib/libgnomeprintmm-2.5.so.2 (0x40018000) libpangomm-1.4.so.1 => /usr/lib/libpangomm-1.4.so.1 (0x40037000) libglibmm-2.4.so.1 => /usr/lib/libglibmm-2.4.so.1 (0x4005a000) libsigc-2.0.so.0 => /usr/lib/libsigc-2.0.so.0 (0x4009f000) libgnomeprint-2-2.so.0 => /usr/lib/libgnomeprint-2-2.so.0 (0x400a5000) libfontconfig.so.1 => /usr/lib/libfontconfig.so.1 (0x404eb000) libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x40512000) libart_lgpl_2.so.2 => /usr/lib/libart_lgpl_2.so.2 (0x4057c000) libxml2.so.2 => /usr/lib/libxml2.so.2 (0x40593000) libpthread.so.0 => /lib/tls/i686/cmov/libpthread.so.0 (0x4068e000) libz.so.1 => /usr/lib/libz.so.1 (0x4069e000) libpango-1.0.so.0 => /usr/lib/libpango-1.0.so.0 (0x406af000) libgobject-2.0.so.0 => /usr/lib/libgobject-2.0.so.0 (0x406e4000) libgmodule-2.0.so.0 => /usr/lib/libgmodule-2.0.so.0 (0x4071e000) libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0x40723000) libglib-2.0.so.0 => /usr/lib/libglib-2.0.so.0 (0x40726000) libstdc++.so.5 => /usr/lib/libstdc++.so.5 (0x407a4000) libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0x4085e000) libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x40881000) libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0x4088a000) libexpat.so.1 => /usr/lib/libexpat.so.1 (0x409c5000) /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000) A direct call to the C-API function (gnome_font_find_closest) fails the same way. An initialization problem ? My desktop gnome apps print fine
It's probably a problem with the constructor. Maybe the equivalent C _new() function does more than just call g_object_new(). If so, we need to do the same thing in our constructor, or maybe call a _construct() function as well.
The example works for me. Could you attach a .ps document that reproduces the problem? Or maybe this was fixed in recent versions of libgnomeprint?
Original example doesn't print a ps file, because refFontLuxi doesn't have a valid reference: Glib::RefPtr<Gnome::Print::Font> refFontLuxi = Gnome::Print::Font::find_closest("Luxi Sans Bold"); if(!refFontLuxi) { std::cerr << "Font is null: Font not found." << std::endl; return 1; } Anyway, the problem seems to be related with my configuration. I have tried libgnomeprint "simple" example and got the same error. Any help ?
So the problem is that find_closest() fails. Maybe this is normal, or maybe it should find at least one sans font - I don't know. You might ask on the gnome-print mailing list.
Reassiginging to libgnomeprint, because you have the problem there too.
What version of libgnomeprint ?
2.6.2 The exact output from "simple" test is: (process:2709): GnomePrint-CRITICAL **: file gnome-font.c: line 291 (gnome_font_find_closest): assertion `face != NULL' failed (process:2709): GnomePrint-CRITICAL **: file gnome-print-stdapi.c: line 875 (gnome_print_setfont): assertion `font != NULL' failed Done...
victor, do you still face this issue nowadays or can this be closed as obsolete? if so, which version of libgnomeprint are you using?
I think we'll close it as obsolete. Please reopen if you can still reproduce this.