|
1 /***************************************************************************/ |
|
2 /* */ |
|
3 /* svpscmap.h */ |
|
4 /* */ |
|
5 /* The FreeType PostScript charmap service (specification). */ |
|
6 /* */ |
|
7 /* Copyright 2003, 2006 by */ |
|
8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */ |
|
9 /* */ |
|
10 /* This file is part of the FreeType project, and may only be used, */ |
|
11 /* modified, and distributed under the terms of the FreeType project */ |
|
12 /* license, FTL.TXT. By continuing to use, modify, or distribute */ |
|
13 /* this file you indicate that you have read the license and */ |
|
14 /* understand and accept it fully. */ |
|
15 /* */ |
|
16 /***************************************************************************/ |
|
17 |
|
18 |
|
19 #ifndef __SVPSCMAP_H__ |
|
20 #define __SVPSCMAP_H__ |
|
21 |
|
22 #include FT_INTERNAL_OBJECTS_H |
|
23 |
|
24 |
|
25 FT_BEGIN_HEADER |
|
26 |
|
27 |
|
28 #define FT_SERVICE_ID_POSTSCRIPT_CMAPS "postscript-cmaps" |
|
29 |
|
30 |
|
31 /* |
|
32 * Adobe glyph name to unicode value. |
|
33 */ |
|
34 typedef FT_UInt32 |
|
35 (*PS_Unicode_ValueFunc)( const char* glyph_name ); |
|
36 |
|
37 /* |
|
38 * Macintosh name id to glyph name. NULL if invalid index. |
|
39 */ |
|
40 typedef const char* |
|
41 (*PS_Macintosh_NameFunc)( FT_UInt name_index ); |
|
42 |
|
43 /* |
|
44 * Adobe standard string ID to glyph name. NULL if invalid index. |
|
45 */ |
|
46 typedef const char* |
|
47 (*PS_Adobe_Std_StringsFunc)( FT_UInt string_index ); |
|
48 |
|
49 |
|
50 /* |
|
51 * Simple unicode -> glyph index charmap built from font glyph names |
|
52 * table. |
|
53 */ |
|
54 typedef struct PS_UniMap_ |
|
55 { |
|
56 FT_UInt32 unicode; /* bit 31 set: is glyph variant */ |
|
57 FT_UInt glyph_index; |
|
58 |
|
59 } PS_UniMap; |
|
60 |
|
61 |
|
62 typedef struct PS_UnicodesRec_* PS_Unicodes; |
|
63 |
|
64 typedef struct PS_UnicodesRec_ |
|
65 { |
|
66 FT_CMapRec cmap; |
|
67 FT_UInt num_maps; |
|
68 PS_UniMap* maps; |
|
69 |
|
70 } PS_UnicodesRec; |
|
71 |
|
72 |
|
73 /* |
|
74 * A function which returns a glyph name for a given index. Returns |
|
75 * NULL if invalid index. |
|
76 */ |
|
77 typedef const char* |
|
78 (*PS_Glyph_NameFunc)( FT_Pointer data, |
|
79 FT_UInt string_index ); |
|
80 |
|
81 typedef FT_Error |
|
82 (*PS_Unicodes_InitFunc)( FT_Memory memory, |
|
83 PS_Unicodes unicodes, |
|
84 FT_UInt num_glyphs, |
|
85 PS_Glyph_NameFunc get_glyph_name, |
|
86 FT_Pointer glyph_data ); |
|
87 |
|
88 typedef FT_UInt |
|
89 (*PS_Unicodes_CharIndexFunc)( PS_Unicodes unicodes, |
|
90 FT_UInt32 unicode ); |
|
91 |
|
92 typedef FT_ULong |
|
93 (*PS_Unicodes_CharNextFunc)( PS_Unicodes unicodes, |
|
94 FT_UInt32 *unicode ); |
|
95 |
|
96 |
|
97 FT_DEFINE_SERVICE( PsCMaps ) |
|
98 { |
|
99 PS_Unicode_ValueFunc unicode_value; |
|
100 |
|
101 PS_Unicodes_InitFunc unicodes_init; |
|
102 PS_Unicodes_CharIndexFunc unicodes_char_index; |
|
103 PS_Unicodes_CharNextFunc unicodes_char_next; |
|
104 |
|
105 PS_Macintosh_NameFunc macintosh_name; |
|
106 PS_Adobe_Std_StringsFunc adobe_std_strings; |
|
107 const unsigned short* adobe_std_encoding; |
|
108 const unsigned short* adobe_expert_encoding; |
|
109 }; |
|
110 |
|
111 /* */ |
|
112 |
|
113 |
|
114 FT_END_HEADER |
|
115 |
|
116 |
|
117 #endif /* __SVPSCMAP_H__ */ |
|
118 |
|
119 |
|
120 /* END */ |