[cairo-commit] src/cairo-cff-subset.c
Adrian Johnson
ajohnson at kemper.freedesktop.org
Mon Sep 7 05:52:40 PDT 2015
src/cairo-cff-subset.c | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
New commits:
commit b353d1f1b167615f8ba718b3843926860e94be77
Author: Adrian Johnson <ajohnson at redneon.com>
Date: Mon Sep 7 22:20:08 2015 +0930
cff: opentype fonts always use gid to lookup glyph
Bug 91902
diff --git a/src/cairo-cff-subset.c b/src/cairo-cff-subset.c
index 3ffe6f6..775ca61 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];
More information about the cairo-commit
mailing list