diff --git a/src/cairo-scaled-font-subsets.c b/src/cairo-scaled-font-subsets.c index 7d89abc02..ee29f89aa 100644 --- a/src/cairo-scaled-font-subsets.c +++ b/src/cairo-scaled-font-subsets.c @@ -545,11 +545,21 @@ _cairo_scaled_font_subsets_map_glyph (cairo_scaled_font_subsets_t *subsets, } /* Glyph not found. Determine whether the glyph is outline or - * bitmap and add to the appropriate subset */ - status = _cairo_scaled_glyph_lookup (scaled_font, - scaled_font_glyph_index, - CAIRO_SCALED_GLYPH_INFO_PATH, - &scaled_glyph); + * bitmap and add to the appropriate subset. + * + * glyph_index 0 (the .notdef glyph) is a special case. Some fonts + * will return CAIRO_INT_STATUS_UNSUPPORTED when doing a + * _scaled_glyph_lookup(_GLYPH_INFO_PATH). Type1-fallback creates + * empty glyphs in this case so we can put the glyph in a unscaled + * subset. */ + if (scaled_font_glyph_index == 0) { + status = CAIRO_STATUS_SUCCESS; + } else { + status = _cairo_scaled_glyph_lookup (scaled_font, + scaled_font_glyph_index, + CAIRO_SCALED_GLYPH_INFO_PATH, + &scaled_glyph); + } if (status && status != CAIRO_INT_STATUS_UNSUPPORTED) return status;