summaryrefslogtreecommitdiff
path: root/gs/src/zfcid.c
diff options
context:
space:
mode:
authorL Peter Deutsch <lpd@ghostscript.com>2000-03-21 07:43:42 +0000
committerL Peter Deutsch <lpd@ghostscript.com>2000-03-21 07:43:42 +0000
commit47e9aba105f8e57ce5f0c7d338cb096b2f54bdaa (patch)
treee97924dc96135e69191870c85dfb873db24c272e /gs/src/zfcid.c
parent7e7ab9adc2d7ecef913611131cb07df9fdeb285c (diff)
downloadghostpdl-47e9aba105f8e57ce5f0c7d338cb096b2f54bdaa.tar.gz
Extends the C support for CIDFontType 0 fonts to include those with FontType
2 subfonts in the FDArray (an Adobe 3011 addition, specifically for CFF fonts). git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@183 a1074d23-0009-0410-80fe-cf8c14f379e6
Diffstat (limited to 'gs/src/zfcid.c')
-rw-r--r--gs/src/zfcid.c45
1 files changed, 34 insertions, 11 deletions
diff --git a/gs/src/zfcid.c b/gs/src/zfcid.c
index 013fb5976..7dcac6e6d 100644
--- a/gs/src/zfcid.c
+++ b/gs/src/zfcid.c
@@ -31,6 +31,7 @@
#include "idict.h"
#include "idparam.h"
#include "ifont1.h"
+#include "ifont2.h"
#include "ifont42.h"
#include "store.h"
@@ -81,23 +82,45 @@ fd_array_element(i_ctx_t *i_ctx_p, gs_font_type1 **ppfont, /*const*/ ref *prfd)
build_proc_refs build;
gs_font_base *pbfont;
gs_font_type1 *pfont;
+ /*
+ * Standard CIDFontType 0 fonts have Type 1 fonts in the FDArray, but
+ * CFF CIDFontType 0 fonts have Type 2 fonts there.
+ */
+ int fonttype = 1; /* default */
int code = charstring_font_get_refs(prfd, &refs);
- if (code < 0)
+ if (code < 0 ||
+ (code = dict_int_param(prfd, "FontType", 1, 2, 1, &fonttype)) < 0
+ )
return code;
/****** HANDLE ALTERNATE SUBR REPRESENTATION ******/
- data1.interpret = gs_type1_interpret;
- data1.subroutineNumberBias = 0;
- data1.lenIV = DEFAULT_LENIV_1;
- code = charstring_font_params(prfd, &refs, &data1);
- if (code < 0)
- return code;
- /****** CHANGE THIS FOR 3011 TO HANDLE FontType 2 ******/
- code = build_proc_name_refs(&build,
- "%Type1BuildChar", "%Type1BuildGlyph");
+ switch (fonttype) {
+ case 1:
+ data1.interpret = gs_type1_interpret;
+ data1.subroutineNumberBias = 0;
+ data1.lenIV = DEFAULT_LENIV_1;
+ code = charstring_font_params(prfd, &refs, &data1);
+ if (code < 0)
+ return code;
+ code = build_proc_name_refs(&build,
+ "%Type1BuildChar", "%Type1BuildGlyph");
+ break;
+ case 2:
+ code = type2_font_params(prfd, &refs, &data1);
+ if (code < 0)
+ return code;
+ code = charstring_font_params(prfd, &refs, &data1);
+ if (code < 0)
+ return code;
+ code = build_proc_name_refs(&build,
+ "%Type2BuildChar", "%Type2BuildGlyph");
+ break;
+ default: /* can't happen */
+ return_error(e_Fatal);
+ }
if (code < 0)
return code;
- code = build_gs_FDArray_font(i_ctx_p, prfd, &pbfont, ft_encrypted,
+ code = build_gs_FDArray_font(i_ctx_p, prfd, &pbfont, fonttype,
&st_gs_font_type1, &build);
if (code < 0)
return code;