summaryrefslogtreecommitdiff
path: root/gs/src/zfcid1.c
diff options
context:
space:
mode:
authorL Peter Deutsch <lpd@ghostscript.com>2002-04-08 21:02:44 +0000
committerL Peter Deutsch <lpd@ghostscript.com>2002-04-08 21:02:44 +0000
commitab5fc0107e96fa00266efd45dad1424ec056c81d (patch)
tree8ff956e2d529b84c34fd5e9d9a1f86610f9c69cf /gs/src/zfcid1.c
parentfb6a93f8a0821f3a4dde24b561b59f11c5c2e5ca (diff)
Changes gs_cmap_t (internal representation of CMaps) to an abstract
superclass with multiple implementations: standard Adobe CMapType 1, TrueType 16-bit cmap (Platform 3, Encoding 1, Format 4), and one-for-one. Adds the ability to designate a CMap as Unicode-based. Enhances pdfwrite so that composite fonts (including those based on TrueType Unicode fonts) with Unicode-based CMaps are embedded in the PDF file with the original text preserved and with an appropriate ToUnicode CMap, making the text searchable in Acrobat. git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@2444 a1074d23-0009-0410-80fe-cf8c14f379e6
Diffstat (limited to 'gs/src/zfcid1.c')
-rw-r--r--gs/src/zfcid1.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/gs/src/zfcid1.c b/gs/src/zfcid1.c
index 2c93aac05..c7285783d 100644
--- a/gs/src/zfcid1.c
+++ b/gs/src/zfcid1.c
@@ -239,11 +239,24 @@ ztype11mapcid(i_ctx_t *i_ctx_p)
if (code < 0)
return code;
- if (pfont->FontType != ft_CID_TrueType)
- return_error(e_invalidfont);
check_type(*op, t_integer);
- code = z11_CIDMap_proc((gs_font_cid2 *)pfont,
- (gs_glyph)(gs_min_cid_glyph + op->value.intval));
+#if defined(TEST)
+ /* Allow a Type 42 font here, for testing .wrapfont. */
+ if (pfont->FontType == ft_TrueType) {
+ /* Use the CID as the glyph index. */
+ if (op->value.intval < 0 ||
+ op->value.intval >= ((gs_font_type42 *)pfont)->data.numGlyphs
+ )
+ return_error(e_rangecheck);
+ code = (int)op->value.intval;
+ } else
+#endif
+ {
+ if (pfont->FontType != ft_CID_TrueType)
+ return_error(e_invalidfont);
+ code = z11_CIDMap_proc((gs_font_cid2 *)pfont,
+ (gs_glyph)(gs_min_cid_glyph + op->value.intval));
+ }
if (code < 0)
return code;
make_int(op - 1, code);