summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Johnson <ajohnson@redneon.com>2015-09-07 22:20:08 +0930
committerAdrian Johnson <ajohnson@redneon.com>2015-09-07 22:20:08 +0930
commitb353d1f1b167615f8ba718b3843926860e94be77 (patch)
tree03abd7bf9468459b6fe5a928314ea014b198b9c8
parentf6c46d9473e40d4a3363c96e1fc7fffc81ed12e7 (diff)
cff: opentype fonts always use gid to lookup glyph
Bug 91902
-rw-r--r--src/cairo-cff-subset.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/cairo-cff-subset.c b/src/cairo-cff-subset.c
index 3ffe6f663..775ca61be 100644
--- a/src/cairo-cff-subset.c
+++ b/src/cairo-cff-subset.c
@@ -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))
@@ -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];