Debian Codegraph @

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