From 23a53e34ec5000b9501fd58c7c0fa777faf73e8f Mon Sep 17 00:00:00 2001 From: Akira Kakuto Date: Sat, 18 Aug 2018 08:21:26 +0000 Subject: All glyphs including component glyphs and dummy glyphs except for .notdef are now listed in CIDSet (S. Hirata). git-svn-id: svn://tug.org/texlive/trunk@48427 c570f23f-e606-0410-a88d-b1316a301751 --- Build/source/texk/dvipdfm-x/ChangeLog | 6 ++++++ Build/source/texk/dvipdfm-x/cidtype2.c | 36 ++++++++++++++++++++-------------- 2 files changed, 27 insertions(+), 15 deletions(-) (limited to 'Build/source/texk/dvipdfm-x') diff --git a/Build/source/texk/dvipdfm-x/ChangeLog b/Build/source/texk/dvipdfm-x/ChangeLog index bed3e492eb4..dc4009a4652 100644 --- a/Build/source/texk/dvipdfm-x/ChangeLog +++ b/Build/source/texk/dvipdfm-x/ChangeLog @@ -1,3 +1,9 @@ +2018-08-18 Shunsaku Hirata + + * cidtype2.c: Workaround for CIDSet issue. All glyphs + including component glyphs and dummy glyphs except .notdef + should be listed in CIDSet. + 2018-08-17 Shunsaku Hirata * cmap_write.c, tt_cmap.[ch], type0.c: Fixed a bug that diff --git a/Build/source/texk/dvipdfm-x/cidtype2.c b/Build/source/texk/dvipdfm-x/cidtype2.c index 63f7e045be0..0c53848ddd7 100644 --- a/Build/source/texk/dvipdfm-x/cidtype2.c +++ b/Build/source/texk/dvipdfm-x/cidtype2.c @@ -1,6 +1,6 @@ /* This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks. - Copyright (C) 2002-2016 by Jin-Hwan Cho and Shunsaku Hirata, + Copyright (C) 2002-2018 by Jin-Hwan Cho and Shunsaku Hirata, the dvipdfmx project team. This program is free software; you can redistribute it and/or modify @@ -856,6 +856,26 @@ CIDFont_type2_dofont (CIDFont *font) add_TTCIDVMetrics(font->fontdict, glyphs, used_chars, last_cid); } + /* CIDSet + * NOTE: All glyphs including component glyph and dummy glyph must be + * listed in CIDSet. However, .notdef glyph should be ommitted. + */ + { + pdf_obj *cidset; + char *cidset_data; + + cidset_data = NEW(glyphs->last_gid/8 + 1, char); + memset(cidset_data, 0, glyphs->last_gid/8 + 1); + for (i = 1; i <= glyphs->last_gid; i++) + cidset_data[i/8] |= (1 << (7 - i % 8)); + cidset = pdf_new_stream(STREAM_COMPRESS); + pdf_add_stream(cidset, cidset_data, glyphs->last_gid/8 + 1); + RELEASE(cidset_data); + pdf_add_dict(font->descriptor, + pdf_new_name("CIDSet"), pdf_ref_obj(cidset)); + pdf_release_obj(cidset); + } + tt_build_finish(glyphs); /* Finish here if not embedded. */ @@ -899,20 +919,6 @@ CIDFont_type2_dofont (CIDFont *font) pdf_ref_obj (fontfile)); pdf_release_obj(fontfile); - /* - * CIDSet - */ - { - pdf_obj *cidset; - - cidset = pdf_new_stream(STREAM_COMPRESS); - pdf_add_stream(cidset, used_chars, last_cid/8 + 1); - pdf_add_dict(font->descriptor, - pdf_new_name("CIDSet"), - pdf_ref_obj(cidset)); - pdf_release_obj(cidset); - } - /* * CIDToGIDMap * Adobe's PDF Reference had been describing it as "optional" and -- cgit v1.2.3