Debian Codegraph @

texk/xdvipsk/otflib/cmap.h

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