type1-subset: Don't try to rename non winansi glyphs

When the latin subset contains glyphs that use the seac operator to
combine two glyphs, additional non winansi glyphs are added to the
subset.  These extra glyphs do not have a winansi name so they can't
be renamed.

Based on a patch by Salvador Ortiz.

Bug 67324
This commit is contained in:
Adrian Johnson 2013-07-28 09:30:05 +09:30
parent 03c81d414d
commit 274863be08

View file

@ -1130,6 +1130,7 @@ write_used_glyphs (cairo_type1_font_subset_t *font,
int length;
int subset_id;
int ch;
const char *wa_name;
if (font->glyphs[glyph_number].subset_index < 0)
return CAIRO_STATUS_SUCCESS;
@ -1143,8 +1144,15 @@ write_used_glyphs (cairo_type1_font_subset_t *font,
subset_id = font->glyphs[glyph_number].subset_index;
if (subset_id > 0) {
ch = font->scaled_font_subset->to_latin_char[subset_id];
name = _cairo_winansi_to_glyphname (ch);
name_length = strlen(name);
wa_name = _cairo_winansi_to_glyphname (ch);
/* If this subset contains any seac glyphs, additional non
* winansi glyphs (wa_name = NULL) may be included in the
* subset. In this case the original name is used.
*/
if (wa_name) {
name = wa_name;
name_length = strlen(name);
}
}
}