Skip to content

Commit

Permalink
type1-subset: return unsupported on FT errors
Browse files Browse the repository at this point in the history
and let type1-fallback handle it. This fixes the bug reported by
Peter Weilbacher in
http://lists.cairographics.org/archives/cairo/2008-October/015569.html
  • Loading branch information
Adrian Johnson committed Nov 2, 2008
1 parent 710f7d3 commit 6434cdd
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions src/cairo-type1-subset.c
Original file line number Diff line number Diff line change
Expand Up @@ -553,18 +553,14 @@ cairo_type1_font_subset_get_glyph_names_and_widths (cairo_type1_font_subset_t *f
error = FT_Load_Glyph (font->face, i,
FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING |
FT_LOAD_NO_BITMAP | FT_LOAD_IGNORE_TRANSFORM);
if (error != 0) {
printf ("could not load glyph %d\n", i);
return _cairo_error (CAIRO_STATUS_NO_MEMORY);
}
if (error != 0)
return CAIRO_INT_STATUS_UNSUPPORTED;

font->glyphs[i].width = font->face->glyph->metrics.horiAdvance;

error = FT_Get_Glyph_Name(font->face, i, buffer, sizeof buffer);
if (error != 0) {
printf ("could not get glyph name for glyph %d\n", i);
return _cairo_error (CAIRO_STATUS_NO_MEMORY);
}
if (error != 0)
return CAIRO_INT_STATUS_UNSUPPORTED;

font->glyphs[i].name = strdup (buffer);
if (font->glyphs[i].name == NULL)
Expand Down

0 comments on commit 6434cdd

Please sign in to comment.