diff options
author | Adrian Johnson <ajohnson@redneon.com> | 2008-04-06 01:08:31 +1030 |
---|---|---|
committer | Adrian Johnson <ajohnson@redneon.com> | 2008-04-06 01:08:31 +1030 |
commit | ae6fbe9e6e153a917f3ae8d733e88303e2816b2b (patch) | |
tree | e1f93ee16026a73a9eb89511e04d956205b13075 | |
parent | 0d5902b7167f8cb4bfc96fd813003cd220441151 (diff) |
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.
-rw-r--r-- | src/cairo-scaled-font-subsets.c | 20 |
1 files changed, 15 insertions, 5 deletions
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; |