Comment 22 for bug 1282968

Revision history for this message
poju (popjussi) wrote :

The space differed from #3 to #4 was caused by this kind of code.

                                if ((new_glyph.width == 0) && (para.pango_items[unbroken_span.pango_item_index].font))
                                    new_glyph.width = new_span.font_size * para.pango_items[unbroken_span.pango_item_index].font->Advance(unbroken_span.glyph_string->glyphs[glyph_index].glyph, false);

with this comment

                                // for some reason pango returns zero width for invalid glyph characters (those empty boxes), so go to freetype for the info

I commented the part and got this attached result. I am not sure why it needs to look into freetype for this, but the advance_width will take it for a start hence it adds the extra space. Could someone explain why it needs to deal with invalid glyph characters rather fix the font for that? What kind of invalid glyph is this?