3 This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks.
5 Copyright (C) 2002-2012 by Jin-Hwan Cho and Shunsaku Hirata,
6 the dvipdfmx project team.
8 This program is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 2 of the License, or
11 (at your option) any later version.
13 This program is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with this program; if not, write to the Free Software
20 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
28 /* Mapping types, MAP_IS_NAME is not supported. */
29 #define MAP_IS_CID (1 << 0)
30 #define MAP_IS_NAME (1 << 1)
31 #define MAP_IS_CODE (1 << 2)
32 #define MAP_IS_NOTDEF (1 << 3)
34 #define MAP_IS_UNDEF 0
35 #define MAP_TYPE_MASK 0x00f
37 #define MAP_DEFINED(e) (((e) & MAP_TYPE_MASK) != MAP_IS_UNDEF ? 1 : 0)
38 #define MAP_TYPE(e) ((e) & MAP_TYPE_MASK)
41 #define MAP_LOOKUP_END 0
42 #define MAP_LOOKUP_CONTINUE (1 << 4)
43 #define LOOKUP_CONTINUE(f) ((f) & MAP_LOOKUP_CONTINUE)
44 #define LOOKUP_END(f) (!LOOKUP_CONTINUE((f)))
47 #define CMAP_DEBUG_STR "CMap"
51 typedef struct rangeDef {
52 int dim; /* Dimension of this codespacerange */
53 unsigned char *codeLo; /* Lower bounds of valid input code */
54 unsigned char *codeHi; /* Upper bounds of valid input code */
57 typedef struct mapDef {
59 int len; /* 2 for CID, variable for Code.. */
60 unsigned char *code; /* CID (as 16-bit BE), Code ... */
61 struct mapDef *next; /* Next Subtbl for LOOKUP_CONTINUE */
64 #define MEM_ALLOC_SIZE 4096
65 typedef struct mapData {
66 long pos; /* Position of next free data segment */
67 unsigned char *data; /* CID, Code... MEM_ALLOC_SIZE bytes */
68 struct mapData *prev; /* Previous mapData data segment */
73 int type; /* CMapType: 1 for usual CMaps,
74 * 2 for ToUnicode CMaps,
75 * 0 for IDENTITY is also defined for convenience.
77 int wmode; /* WMode: 0 for Horizontal, 1 for Vertical. */
78 CIDSysInfo *CSI; /* CIDSystemInfo */
88 mapDef *mapTbl; /* First 256 segment of mapping table */
89 mapData *mapData; /* Storage for actual CMap data */
91 /* Additional data used by cmap.c, etc. */
93 int flags; /* Decoder flags Not used yet. */
104 #endif /* _CMAP_P_H_ */