summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam James <sam@gentoo.org>2022-09-21 14:18:08 +0100
committerSam James <sam@gentoo.org>2022-10-02 04:31:25 +0100
commita529111f77ff46f4836fe7312e70953bc16587cf (patch)
tree9dc3924cb1a6ef3ef853b7bb45f735365e0b4e6d /psi/zfont2.c
parentImport Ghostscript 9.56.1 (diff)
downloadghostscript-gpl-patches-ghostscript-10.tar.gz
ghostscript-gpl-patches-ghostscript-10.tar.bz2
ghostscript-gpl-patches-ghostscript-10.zip
Import Ghostscript 10.0ghostscript-10.0ghostscript-10
Signed-off-by: Sam James <sam@gentoo.org>
Diffstat (limited to 'psi/zfont2.c')
-rw-r--r--psi/zfont2.c18
1 files changed, 14 insertions, 4 deletions
diff --git a/psi/zfont2.c b/psi/zfont2.c
index 2be4279a..bc13fc04 100644
--- a/psi/zfont2.c
+++ b/psi/zfont2.c
@@ -2632,7 +2632,7 @@ parse_font(i_ctx_t *i_ctx_p, ref *topdict,
/* Simple font */
unsigned int i, gid, enc_format = 0;
int sid;
- ref name, cstr, charstrings_dict, encoding, notdef;
+ ref ccoderef, name, cstr, cffcharstrings_dict, charstrings_dict, encoding, notdef;
unsigned char gid2char[256];
unsigned supp_enc_offset = 0;
@@ -2642,9 +2642,16 @@ parse_font(i_ctx_t *i_ctx_p, ref *topdict,
return code;
if ((code = dict_create(charstrings_index.count + 1, &charstrings_dict)) < 0)
return code;
+ if ((code = dict_create(charstrings_index.count + 1, &cffcharstrings_dict)) < 0)
+ return code;
if ((code = idict_put_c_name(i_ctx_p, topdict, STR2MEM("CharStrings"), &charstrings_dict)) < 0)
return code;
- if ((code = idict_put(&charstrings_dict, &notdef, &cstr)) < 0)
+ if ((code = idict_put_c_name(i_ctx_p, topdict, STR2MEM("CFFCharStrings"), &cffcharstrings_dict)) < 0)
+ return code;
+ make_int(&ccoderef, 0);
+ if ((code = idict_put(&charstrings_dict, &notdef, &ccoderef)) < 0)
+ return code;
+ if ((code = idict_put(&cffcharstrings_dict, &ccoderef, &cstr)) < 0)
return code;
if (offsets.encoding_off <= 1) {
if ((code = ialloc_ref_array(&encoding, a_readonly, 256, "cff_parser.encoding")) < 0)
@@ -2710,7 +2717,10 @@ parse_font(i_ctx_t *i_ctx_p, ref *topdict,
if ((code = name_ref(imemory, (unsigned char *)buf, len, &name, 1)) < 0)
return code;
}
- if ((code = idict_put(&charstrings_dict, &name, &cstr)) < 0)
+ make_int(&ccoderef, gid);
+ if ((code = idict_put(&charstrings_dict, &name, &ccoderef)) < 0)
+ return code;
+ if ((code = idict_put(&cffcharstrings_dict, &ccoderef, &cstr)) < 0)
return code;
if (offsets.encoding_off > 1 && gid < 256) {
encoding.value.refs[gid2char[gid]] = name;
@@ -2859,7 +2869,7 @@ zparsecff(i_ctx_t *i_ctx_p)
if ((code = peek_index(&topdict_data, &topdict_len, &topdicts, &data, i_font)) < 0)
return code;
- if ((code = dict_create(20, &topdict)) < 0)
+ if ((code = dict_create(21, &topdict)) < 0)
return code;
if ((code = idict_put(&fontset, &name, &topdict)) < 0)