scaled-font-subsets: Special case .notdef in a new subset

If the .notdef glyph is the first glyph in the subset to be mapped in
scaled font, we do not know if the subset will scaled or unscaled. We
can put it in the unscaled subset as Type1-fallback will embded an
empty glyph if it can not get the path.
This commit is contained in:
Adrian Johnson 2008-04-06 01:08:31 +10:30
parent 0d5902b716
commit ae6fbe9e6e

View file

@ -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;