#31 text rendering fails with lots of Pango-WARNINGs

closed-accepted
5
2012-08-20
2012-08-19
No

On opening xchm, almost all text was missing, including in the main menu, and so the program was totally unusable. There were a lot of warning messages from pango in the terminal output:

(xchm:11101): Pango-CRITICAL **: pango_font_description_set_size: assertion `size >= 0' failed

(xchm:11101): Pango-WARNING **: failed to create cairo scaled font, expect ugly output. the offending font is 'DejaVu Sans'

(xchm:11101): Pango-WARNING **: font_face status is: out of memory

(xchm:11101): Pango-WARNING **: scaled_font status is: out of memory

(xchm:11101): Pango-WARNING **: shaping failure, expect ugly output. shape-engine='BasicEngineFc', font='DejaVu Sans', text='H'

(xchm:11101): Pango-CRITICAL **: pango_font_description_set_size: assertion `size >= 0' failed

(xchm:11101): Pango-WARNING **: failed to create cairo scaled font, expect ugly output. the offending font is 'DejaVu Sans Bold'

(xchm:11101): Pango-WARNING **: font_face status is: out of memory

(xchm:11101): Pango-WARNING **: scaled_font status is: out of memory

(xchm:11101): Pango-WARNING **: shaping failure, expect ugly output. shape-engine='BasicEngineFc', font='DejaVu Sans Bold', text='xCHM'

(xchm:11101): Pango-CRITICAL **: pango_font_description_set_size: assertion `size >= 0' failed

(xchm:11101): Pango-WARNING **: failed to create cairo scaled font, expect ugly output. the offending font is 'DejaVu Sans Mono'

(xchm:11101): Pango-WARNING **: font_face status is: out of memory

(xchm:11101): Pango-WARNING **: scaled_font status is: out of memory

(xchm:11101): Pango-WARNING **: shaping failure, expect ugly output. shape-engine='BasicEngineFc', font='DejaVu Sans Mono', text='GPL'

(xchm:11101): Pango-CRITICAL **: pango_font_description_set_absolute_size: assertion `size >= 0' failed

I will attach the backtrace with G_DEBUG=fatal-warnings set.

Discussion

  • Edward Sheldrake

    backtrace from first warning

     
  • Edward Sheldrake

    I've uploaded a patch which fixes the problem - the problem was the CHMHtmlNotebook constructor eventually leading to SetFonts being called before _fonts_normal_face, _fonts_fixed_face and _fonts_sizes had been set.

     
  • Razvan Cojocaru

    Razvan Cojocaru - 2012-08-19

    If anything, it's a wxWidgets problem. Can't fix it from the xCHM source code, sorry.
    Try reporting it on the wxWidgets bug tracker.

     
  • Razvan Cojocaru

    Razvan Cojocaru - 2012-08-19
    • assigned_to: nobody --> thewhiterabbit
    • status: open --> closed-rejected
     
  • Edward Sheldrake

    What about the patch I posted? I thought the problem was xchm calling htmlwin->SetFonts from the before the font sizes array had been filled out, so it must have been an array of zeroes.

    I admit previous versions of pango / cairo didn't complain. The wxGTK version installed hasn't changed recently, still 2.8.12. The htmlhelp examples from the wxGTK 2.8.12 source work properly on my system (Fedora 17).

     
  • Razvan Cojocaru

    Razvan Cojocaru - 2012-08-20
    • labels: --> Interface (example)
    • status: closed-rejected --> closed-accepted
     
  • Razvan Cojocaru

    Razvan Cojocaru - 2012-08-20

    You're right, sorry. I've had a very similar bug report that turned out to be nothing I could fix.

    The general idea of your patch is correct, however it's not the C++ way (no object should be only partly functional after it's constructor is done). I can kind of excuse myself by saying that that particular piece of code was a contribution from somebody else, but then I should have read it more carefully.

    I'll commit a fix and release 1.21 soon. Nice work, thank you.