diff options
author | Jjgod Jiang <gzjjgod@gmail.com> | 2015-04-26 13:54:20 +0000 |
---|---|---|
committer | Jjgod Jiang <gzjjgod@gmail.com> | 2015-04-26 13:54:20 +0000 |
commit | 6777e1886b1c1efe32d6a94e6a510ef80de11fb0 (patch) | |
tree | 80fcbdeefeee37dd5bd9777d34a345f9563cce81 /Build | |
parent | 28d4c07de79a077327077a5faf2c462cafd56399 (diff) |
Support also CID-keyed type 0 font
...which means Hannotate and HanziPen are fixed.
git-svn-id: svn://tug.org/texlive/trunk@37054 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r-- | Build/source/texk/dvipdfm-x/cidtype0.c | 28 |
1 files changed, 20 insertions, 8 deletions
diff --git a/Build/source/texk/dvipdfm-x/cidtype0.c b/Build/source/texk/dvipdfm-x/cidtype0.c index c2cbdea13d2..9749a1fff2a 100644 --- a/Build/source/texk/dvipdfm-x/cidtype0.c +++ b/Build/source/texk/dvipdfm-x/cidtype0.c @@ -510,14 +510,20 @@ CIDFont_type0_dofont (CIDFont *font) ERROR("Unexpected error: Font not actually used???"); fp = DPXFOPEN(font->ident, DPX_RES_TYPE_OTFONT); - if (!fp) - ERROR("Could not open OpenType font file: %s", font->ident); + if (!fp) { + fp = DPXFOPEN(font->ident, DPX_RES_TYPE_TTFONT); + if (!fp) + ERROR("Could not open OpenType font file: %s", font->ident); + } sfont = sfnt_open(fp); if (!sfont) ERROR("Could not open OpenType font file: %s", font->ident); - if (sfnt_read_table_directory(sfont, 0) < 0 || - sfont->type != SFNT_TYPE_POSTSCRIPT) + if (sfont->type == SFNT_TYPE_TTC) + offset = ttc_read_offset(sfont, CIDFont_get_opt_index(font)); + + if ((sfont->type != SFNT_TYPE_TTC && sfont->type != SFNT_TYPE_POSTSCRIPT) || + sfnt_read_table_directory(sfont, offset) < 0) ERROR("Not a CFF/OpenType font (1)?"); offset = sfnt_find_table_pos(sfont, "CFF "); if (offset == 0) @@ -727,15 +733,21 @@ CIDFont_type0_open (CIDFont *font, const char *name, ASSERT(font); fp = DPXFOPEN(name, DPX_RES_TYPE_OTFONT); - if (!fp) - return -1; + if (!fp) { + fp = DPXFOPEN(name, DPX_RES_TYPE_TTFONT); + if (!fp) return -1; + } sfont = sfnt_open(fp); if (!sfont) { ERROR("Not a CFF/OpenType font (3)?"); } - if (sfont->type != SFNT_TYPE_POSTSCRIPT || - sfnt_read_table_directory(sfont, 0) < 0 || + + if (sfont->type == SFNT_TYPE_TTC) + offset = ttc_read_offset(sfont, opt->index); + + if ((sfont->type != SFNT_TYPE_TTC && sfont->type != SFNT_TYPE_POSTSCRIPT) || + sfnt_read_table_directory(sfont, offset) < 0 || (offset = sfnt_find_table_pos(sfont, "CFF ")) == 0) { ERROR("Not a CFF/OpenType font (4)?"); } |