1 /* This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks.
2 
3     Copyright (C) 2002-2014 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 _TT_CMAP_H_
22 #define _TT_CMAP_H_
23 
24 #include "sfnt.h"
25 
26 extern void otf_cmap_set_verbose (void);
27 
28 /* TrueType cmap table */
29 typedef struct
30 {
31   USHORT format;
32   USHORT platform;
33   USHORT encoding;
34   ULONG  language; /* or version, only for Mac */
35   void  *map;
36 } tt_cmap;
37 
38 /* Paltform ID */
39 #define TT_MAC 1u
40 #define TT_WIN 3u
41 
42 /* Platform-specific encoding ID */
43 
44 /* Windows */
45 #define TT_WIN_SYMBOL  0u
46 #define TT_WIN_UNICODE 1u
47 #define TT_WIN_SJIS    2u
48 #define TT_WIN_RPC     3u
49 #define TT_WIN_BIG5    4u
50 #define TT_WIN_WANSUNG 5u
51 #define TT_WIN_JOHAB   6u
52 #define TT_WIN_UCS4    10u
53 
54 /* Mac */
55 #define TT_MAC_ROMAN               0u
56 #define TT_MAC_JAPANESE            1u
57 #define TT_MAC_TRADITIONAL_CHINESE 2u
58 #define TT_MAC_KOREAN              3u
59 #define TT_MAC_SIMPLIFIED_CHINESE  25u
60 
61 extern tt_cmap *tt_cmap_read    (sfnt *sfont, USHORT platform, USHORT encoding);
62 
63 extern USHORT   tt_cmap_lookup  (tt_cmap *cmap, long cc);
64 extern void     tt_cmap_release (tt_cmap *cmap);
65 
66 #include "pdfobj.h"
67 
68 /* Indirect reference */
69 extern pdf_obj *otf_create_ToUnicode_stream (const char *map_name,
70                                              int ttc_index,
71                                              const char *used_chars,
72                                              int cmap_id);
73 /* CMap ID */
74 extern int      otf_load_Unicode_CMap       (const char *map_name,
75 					     int ttc_index,
76 					     const char *otl_opts, int wmode);
77 
78 #endif /* _TT_CMAP_H_ */
79