michael@0: From: Jonathan Kew michael@0: bug 715798 pt 2 - fall back to show_text_glyphs even at huge sizes if scaled_font_glyph_path didn't work. r=jrmuizel michael@0: michael@0: diff --git a/gfx/cairo/cairo/src/cairo-gstate.c b/gfx/cairo/cairo/src/cairo-gstate.c michael@0: --- a/gfx/cairo/cairo/src/cairo-gstate.c michael@0: +++ b/gfx/cairo/cairo/src/cairo-gstate.c michael@0: @@ -2002,23 +2002,34 @@ cairo_status_t michael@0: cairo_path_fixed_t path; michael@0: michael@0: _cairo_path_fixed_init (&path); michael@0: michael@0: status = _cairo_scaled_font_glyph_path (gstate->scaled_font, michael@0: transformed_glyphs, num_glyphs, michael@0: &path); michael@0: michael@0: - if (status == CAIRO_STATUS_SUCCESS) { michael@0: + if (status == CAIRO_STATUS_SUCCESS && !_cairo_path_fixed_fill_is_empty (&path)) { michael@0: status = _cairo_surface_fill (gstate->target, op, pattern, michael@0: &path, michael@0: CAIRO_FILL_RULE_WINDING, michael@0: gstate->tolerance, michael@0: gstate->scaled_font->options.antialias, michael@0: _gstate_get_clip (gstate, &clip)); michael@0: + } else { michael@0: + /* if _cairo_scaled_font_glyph_path() failed, maybe the font doesn't support michael@0: + * returning paths, so try the _cairo_surface_show_text_glyphs() option michael@0: + */ michael@0: + status = _cairo_surface_show_text_glyphs (gstate->target, op, pattern, michael@0: + utf8, utf8_len, michael@0: + transformed_glyphs, num_glyphs, michael@0: + transformed_clusters, num_clusters, michael@0: + cluster_flags, michael@0: + gstate->scaled_font, michael@0: + _gstate_get_clip (gstate, &clip)); michael@0: } michael@0: michael@0: _cairo_path_fixed_fini (&path); michael@0: } michael@0: michael@0: _cairo_clip_fini (&clip); michael@0: michael@0: CLEANUP_GLYPHS: