Skip to content

Commit

Permalink
cff: opentype fonts always use gid to lookup glyph
Browse files Browse the repository at this point in the history
Bug 91902
  • Loading branch information
Adrian Johnson committed Sep 7, 2015
1 parent f6c46d9 commit b353d1f
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/cairo-cff-subset.c
Original file line number Diff line number Diff line change
Expand Up @@ -1780,7 +1780,7 @@ cairo_cff_font_subset_charstrings_and_subroutines (cairo_cff_font_t *font)

font->subset_subroutines = TRUE;
for (i = 0; i < font->scaled_font_subset->num_glyphs; i++) {
if (font->is_cid) {
if (font->is_cid && !font->is_opentype) {
cid = font->scaled_font_subset->glyphs[i];
status = cairo_cff_font_get_gid_for_cid (font, cid, &glyph);
if (unlikely (status))
Expand Down Expand Up @@ -1847,11 +1847,15 @@ cairo_cff_font_subset_fontdict (cairo_cff_font_t *font)

font->num_subset_fontdicts = 0;
for (i = 0; i < font->scaled_font_subset->num_glyphs; i++) {
cid = font->scaled_font_subset->glyphs[i];
status = cairo_cff_font_get_gid_for_cid (font, cid, &gid);
if (unlikely (status)) {
free (reverse_map);
return status;
if (font->is_opentype) {
gid = font->scaled_font_subset->glyphs[i];
} else {
cid = font->scaled_font_subset->glyphs[i];
status = cairo_cff_font_get_gid_for_cid (font, cid, &gid);
if (unlikely (status)) {
free (reverse_map);
return status;
}
}

fd = font->fdselect[gid];
Expand Down

0 comments on commit b353d1f

Please sign in to comment.