2006-02-21 Behdad Esfahbod <behdad@gnome.org>
+ Bug 331723 – shapers should not crash on failures
+
+ * modules/*/*-fc.c: Return instead of g_return_if_fail when
+ face == NULL.
+
+ * pango/pango-engine.h (PangoEngineShape): Document that a shaper
+ should return an empty glyph string on failure.
+
+2006-02-21 Behdad Esfahbod <behdad@gnome.org>
+
* pango/fonts.c, pango/glyphstring.c, pango/pango-fontmap.c,
pango/pango-ot-buffer.c, pango/pangocairo-font.c, pango/pangoft2.c,
pango/pangoxft-font.c, pango/shape.c: Change g_critical to g_warning.
fc_font = PANGO_FC_FONT (font);
face = pango_fc_font_lock_face (fc_font);
- g_return_if_fail (face != NULL);
+ if (!face)
+ return;
ruleset = get_ruleset (face);
if (!ruleset)
fc_font = PANGO_FC_FONT (font);
face = pango_fc_font_lock_face (fc_font);
- g_return_if_fail (face != NULL);
+ if (!face)
+ return;
ruleset = get_ruleset (face);
if (!ruleset)
fc_font = PANGO_FC_FONT (font);
face = pango_fc_font_lock_face (fc_font);
- g_return_if_fail (face != NULL);
+ if (!face)
+ return;
ruleset = get_ruleset (face);
if (!ruleset)
fc_font = PANGO_FC_FONT (font);
face = pango_fc_font_lock_face (fc_font);
- g_return_if_fail (face != NULL);
+ if (!face)
+ return;
indic_shape_engine = (IndicEngineFc *) engine;
fc_font = PANGO_FC_FONT (font);
face = pango_fc_font_lock_face (fc_font);
- g_return_if_fail (face != NULL);
+ if (!face)
+ return;
buffer = pango_ot_buffer_new (fc_font);
fc_font = PANGO_FC_FONT (font);
face = pango_fc_font_lock_face (fc_font);
- g_return_if_fail (face != NULL);
+ if (!face)
+ return;
ruleset = get_ruleset (face);
if (!ruleset)
fc_font = PANGO_FC_FONT (font);
face = pango_fc_font_lock_face (fc_font);
- g_return_val_if_fail (face != NULL, NULL);
+ if (!face)
+ return NULL;
info = pango_ot_info_get (face);
if (info != NULL)
fc_font = PANGO_FC_FONT (font);
face = pango_fc_font_lock_face (fc_font);
- g_return_val_if_fail (face != NULL, NULL);
+ if (!face)
+ return NULL;
info = pango_ot_info_get (face);
if (info != NULL)
fc_font = PANGO_FC_FONT (font);
face = pango_fc_font_lock_face (fc_font);
- g_return_if_fail (face != NULL);
+ if (!face)
+ return;
buffer = pango_ot_buffer_new (fc_font);
* of the output logical clusters;
* if no rendering is desired for a character, this may involve
* inserting glyphs with the #PangoGlyph ID #PANGO_GLYPH_EMPTY, which
- * is guaranteed never to render.
+ * is guaranteed never to render. If the shaping fails for any reason,
+ * the shaper should return with an empty (zero-size) glyph string.
+ * If the shaper has not set the size on the glyph string yet, simply
+ * returning signals the failure too.
* @covers: Returns the characters that this engine can cover
* with a given font for a given language. If not overridden, the default
* implementation simply returns the coverage information for the