From 6777e1886b1c1efe32d6a94e6a510ef80de11fb0 Mon Sep 17 00:00:00 2001 From: Jjgod Jiang Date: Sun, 26 Apr 2015 13:54:20 +0000 Subject: 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 --- Build/source/texk/dvipdfm-x/cidtype0.c | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) (limited to 'Build/source/texk/dvipdfm-x/cidtype0.c') 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)?"); } -- cgit v1.2.3