Debian Codegraph @

texk/dvipdfm-x/cmap.h

raw
1 /* This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks.
2
3 Copyright (C) 2002-2020 by Jin-Hwan Cho and Shunsaku Hirata,
4 the dvipdfmx project team.
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program; if not, write to the Free Software
18 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
19 */
20
21 #ifndef _CMAP_H_
22 #define _CMAP_H_
23
24 #include "cid.h"
25
26 #include <sys/types.h>
27
28 typedef unsigned short CID;
29 typedef unsigned short UCV16;
30
31 /* Limits */
32 #define CID_MAX_CID 65535
33 #define CID_MAX CID_MAX_CID
34
35 #define CID_NOTDEF_CHAR "\0\0"
36 #define CID_NOTDEF 0
37
38 #define UCS_NOTDEF_CHAR "\377\375"
39 #define UCS_NOTDEF 0xfffd
40
41 /*
42 * TYPE_IDENTITY and TYPE_CID_TO_CODE is not defined in the CMap spec.
43 */
44 #define CMAP_TYPE_IDENTITY 0
45 #define CMAP_TYPE_CODE_TO_CID 1
46 #define CMAP_TYPE_TO_UNICODE 2
47 #define CMAP_TYPE_CID_TO_CODE 3
48
49 #define CMAP_PROF_TYPE_INBYTES_MIN 0
50 #define CMAP_PROF_TYPE_INBYTES_MAX 1
51 #define CMAP_PROF_TYPE_OUTBYTES_MIN 2
52 #define CMAP_PROF_TYPE_OUTBYTES_MAX 3
53
54 typedef struct CMap CMap;
55
56
57 /************************** CMAP_MAIN **************************/
58
59 extern void CMap_set_silent (int value);
60
61 extern CMap *CMap_new (void);
62 extern void CMap_release (CMap *cmap);
63
64 extern int CMap_is_valid (CMap *cmap);
65 extern int CMap_is_Identity (CMap *cmap);
66 extern int CMap_get_profile (CMap *cmap, int type);
67
68 extern char *CMap_get_name (CMap *cmap);
69 extern int CMap_get_type (CMap *cmap);
70 extern int CMap_get_wmode(CMap *cmap);
71 extern CIDSysInfo *CMap_get_CIDSysInfo(CMap *cmap);
72
73 extern void CMap_set_name (CMap *cmap, const char *name);
74 extern void CMap_set_type (CMap *cmap, int type);
75 extern void CMap_set_wmode (CMap *cmap, int wmode);
76 extern void CMap_set_usecmap(CMap *cmap, CMap *ucmap);
77 extern void CMap_set_CIDSysInfo (CMap *cmap, const CIDSysInfo *csi);
78
79 /* charName not supported */
80 extern int CMap_add_bfchar (CMap *cmap,
81 const unsigned char *src, int srcdim,
82 const unsigned char *dest, int destdim);
83 extern int CMap_add_cidchar (CMap *cmap,
84 const unsigned char *src, int srcdim, CID dest);
85 extern int CMap_add_bfrange (CMap *cmap,
86 const unsigned char *srclo, const unsigned char *srchi, int srcdim,
87 const unsigned char *dest, int destdim);
88 extern int CMap_add_cidrange(CMap *cmap,
89 const unsigned char *srclo, const unsigned char *hi, int srcdim,
90 CID base);
91
92 extern int CMap_add_notdefchar (CMap *cmap, const unsigned char *src, int srcdim, CID dst);
93 extern int CMap_add_notdefrange (CMap *cmap,
94 const unsigned char *srclo, const unsigned char *srchi, int srcdim,
95 CID dst);
96
97 extern int CMap_add_codespacerange (CMap *cmap,
98 const unsigned char *codelo, const unsigned char *codehi, int dim);
99
100 extern void CMap_decode_char (CMap *cmap,
101 const unsigned char **inbuf, int *inbytesleft,
102 unsigned char **outbuf, int *outbytesleft);
103
104 extern int CMap_decode (CMap *cmap,
105 const unsigned char **inbuf, int *inbytesleft,
106 unsigned char **outbuf, int *outbytesleft);
107
108 extern void CMap_cache_init (void);
109 extern CMap *CMap_cache_get (int id);
110 extern int CMap_cache_find (const char *cmap_name);
111 extern void CMap_cache_close (void);
112 extern int CMap_cache_add (CMap *cmap);
113
114 #endif /* _CMAP_H_ */