[cairo-commit] src/cairo-scaled-font-subsets.c
Adrian Johnson
ajohnson at kemper.freedesktop.org
Sat Apr 5 07:46:18 PDT 2008
src/cairo-scaled-font-subsets.c | 20 +++++++++++++++-----
1 file changed, 15 insertions(+), 5 deletions(-)
New commits:
commit ae6fbe9e6e153a917f3ae8d733e88303e2816b2b
Author: Adrian Johnson <ajohnson at redneon.com>
Date: Sun Apr 6 01:08:31 2008 +1030
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.
diff --git a/src/cairo-scaled-font-subsets.c b/src/cairo-scaled-font-subsets.c
index 7d89abc..ee29f89 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;
More information about the cairo-commit
mailing list