Debian Codegraph @

texk/xdvipsk/otflib/tt_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 _TT_CMAP_H_
25 #define _TT_CMAP_H_
26
27 #include "sfnt.h"
28 #include "cidsysinfo.h"
29
30 /* TrueType cmap table */
31 typedef struct
32 {
33 USHORT format;
34 USHORT platform;
35 USHORT encoding;
36 ULONG language; /* or version, only for Mac */
37 void *map;
38 } tt_cmap;
39
40 /* Paltform ID */
41 #define TT_MAC 1u
42 #define TT_WIN 3u
43
44 /* Platform-specific encoding ID */
45
46 /* Windows */
47 #define TT_WIN_SYMBOL 0u
48 #define TT_WIN_UNICODE 1u
49 #define TT_WIN_SJIS 2u
50 #define TT_WIN_RPC 3u
51 #define TT_WIN_BIG5 4u
52 #define TT_WIN_WANSUNG 5u
53 #define TT_WIN_JOHAB 6u
54 #define TT_WIN_UCS4 10u
55
56 /* Mac */
57 #define TT_MAC_ROMAN 0u
58 #define TT_MAC_JAPANESE 1u
59 #define TT_MAC_TRADITIONAL_CHINESE 2u
60 #define TT_MAC_KOREAN 3u
61 #define TT_MAC_SIMPLIFIED_CHINESE 25u
62
63 extern tt_cmap *tt_cmap_read (sfnt *sfont, USHORT platform, USHORT encoding);
64
65 extern USHORT tt_cmap_lookup (tt_cmap *cmap, long cc);
66 extern void tt_cmap_release (tt_cmap *cmap);
67 /* CMap ID */
68 extern CMap* otf_load_Unicode_CMap (const char *map_name, sfnt *sfont,
69 const char *otl_opts, int wmode);
70
71 extern CMap* ttf_load_Native_CMap (const char *map_name, sfnt *sfont);
72
73 /* Indirect reference */
74 extern int otf_create_ToUnicode_stream (sfnt *sfont,
75 const char *font_name,
76 CMap *code_to_cid_cmap,
77 CIDSysInfo *csi,
78 const UsedMapElem *used_chars,
79 const char *path,
80 const char *cmap_name,
81 const char *cmap_ext,
82 void *luamap);
83
84 #endif /* _TT_CMAP_H_ */