diff options
Diffstat (limited to 'psi/zfapi.c')
-rw-r--r-- | psi/zfapi.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/psi/zfapi.c b/psi/zfapi.c index 6927e60e..aa7369a1 100644 --- a/psi/zfapi.c +++ b/psi/zfapi.c @@ -2024,7 +2024,7 @@ FAPI_FF_get_glyph(gs_fapi_font *ff, gs_glyph char_code, byte *buf, int buf_lengt glyph_length = get_type1_data(ff, &glyph, buf, buf_length); } else { - ref *CharStrings, char_name, *glyph; + ref *CharStrings, *CFFCharStrings, char_name, *glyph; if (ff->char_data != NULL) { /* @@ -2069,6 +2069,20 @@ FAPI_FF_get_glyph(gs_fapi_font *ff, gs_glyph char_code, byte *buf, int buf_lengt } if (r_has_type(glyph, t_array) || r_has_type(glyph, t_mixedarray)) return gs_fapi_glyph_invalid_format; + + if (r_has_type(glyph, t_integer) + && dict_find_string(pdr, "CFFCharStrings", &CFFCharStrings) > 0) { + ref *g2; + if (dict_find(CFFCharStrings, glyph, &g2) <= 0) { + ref nd; + make_int(&nd, 0); + if (dict_find(CFFCharStrings, &nd, &g2) <= 0) { + return gs_fapi_glyph_invalid_format; + } + } + glyph = g2; + } + if (!r_has_type(glyph, t_string)) return 0; glyph_length = get_type1_data(ff, glyph, buf, buf_length); @@ -2255,6 +2269,7 @@ static const gs_fapi_font ps_ff_stub = { FAPI_FF_get_raw_subr, FAPI_FF_get_glyph, FAPI_FF_serialize_tt_font, + NULL, /* retrieve_tt_font */ FAPI_FF_get_charstring, FAPI_FF_get_charstring_name, ps_get_GlyphDirectory_data_ptr, |