summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvipdfm-x/type0.c
diff options
context:
space:
mode:
Diffstat (limited to 'Build/source/texk/dvipdfm-x/type0.c')
-rw-r--r--Build/source/texk/dvipdfm-x/type0.c23
1 files changed, 15 insertions, 8 deletions
diff --git a/Build/source/texk/dvipdfm-x/type0.c b/Build/source/texk/dvipdfm-x/type0.c
index 09d161df6ae..afb4bbbc1bc 100644
--- a/Build/source/texk/dvipdfm-x/type0.c
+++ b/Build/source/texk/dvipdfm-x/type0.c
@@ -111,13 +111,19 @@ Type0Font_attach_ToUnicode_stream (pdf_font *font)
tounicode = NULL;
csi = &cidfont->cid.csi;
- fontname = cidfont->fontname;
+ if (cidfont->cid.options.embed) {
+ fontname = NEW(strlen(cidfont->fontname)+8, char);
+ sprintf(fontname, "%s+%s", cidfont->uniqueID, cidfont->fontname);
+ } else {
+ fontname = NEW(strlen(cidfont->fontname)+1, char);
+ strcpy(fontname, cidfont->fontname);
+ }
switch (cidfont->subtype) {
case PDF_FONT_FONTTYPE_CIDTYPE2:
if (!strcmp(csi->registry, "Adobe") && !strcmp(csi->ordering, "Identity")) {
tounicode = otf_create_ToUnicode_stream(cidfont->ident, cidfont->index,
- cidfont->fontname, font->usedchars);
+ fontname, font->usedchars);
} else {
char *cmap_base = NEW(strlen(csi->registry) + strlen(csi->ordering) + 2, char);
sprintf(cmap_base, "%s-%s", csi->registry, csi->ordering);
@@ -129,26 +135,27 @@ Type0Font_attach_ToUnicode_stream (pdf_font *font)
default:
if (cidfont->flags & CIDFONT_FLAG_TYPE1C) {
tounicode = otf_create_ToUnicode_stream(cidfont->ident, cidfont->index,
- cidfont->fontname, font->usedchars);
+ fontname, font->usedchars);
} else if (cidfont->flags & CIDFONT_FLAG_TYPE1) {
- tounicode = CIDFont_type0_t1create_ToUnicode_stream(cidfont->ident, cidfont->fontname, font->usedchars);
+ tounicode = CIDFont_type0_t1create_ToUnicode_stream(cidfont->ident, fontname, font->usedchars);
} else {
- tounicode = try_load_ToUnicode_file(fontname);
+ tounicode = try_load_ToUnicode_file(cidfont->fontname);
if (!tounicode) {
tounicode = otf_create_ToUnicode_stream(cidfont->ident, cidfont->index,
- cidfont->fontname, font->usedchars);
+ fontname, font->usedchars);
}
}
}
+ RELEASE(fontname);
if (tounicode) {
pdf_add_dict(font->resource, pdf_new_name("ToUnicode"), tounicode);
} else {
#if defined(LIBDPX)
if (dpx_conf.verbose_level > 0)
- WARN("Failed to load ToUnicode CMap for font \"%s\"", fontname);
+ WARN("Failed to load ToUnicode CMap for font \"%s\"", cidfont->fontname);
#else
- WARN("Failed to load ToUnicode CMap for font \"%s\"", fontname);
+ WARN("Failed to load ToUnicode CMap for font \"%s\"", cidfont->filename);
#endif /* LIBDPX */
}