This commit was manufactured by cvs2svn to create branch 'captive'.
[reactos.git] / subsys / win32k / freetype / include / freetype / internal / psnames.h
1 /***************************************************************************/
2 /*                                                                         */
3 /*  psnames.h                                                              */
4 /*                                                                         */
5 /*    High-level interface for the `PSNames' module (in charge of          */
6 /*    various functions related to Postscript glyph names conversion).     */
7 /*                                                                         */
8 /*  Copyright 1996-2000 by                                                 */
9 /*  David Turner, Robert Wilhelm, and Werner Lemberg.                      */
10 /*                                                                         */
11 /*  This file is part of the FreeType project, and may only be used,       */
12 /*  modified, and distributed under the terms of the FreeType project      */
13 /*  license, LICENSE.TXT.  By continuing to use, modify, or distribute     */
14 /*  this file you indicate that you have read the license and              */
15 /*  understand and accept it fully.                                        */
16 /*                                                                         */
17 /***************************************************************************/
18
19
20 #ifndef PSNAMES_H
21 #define PSNAMES_H
22
23
24 #include <freetype/freetype.h>
25
26
27   /*************************************************************************/
28   /*                                                                       */
29   /* <FuncType>                                                            */
30   /*    PS_Unicode_Value_Func                                              */
31   /*                                                                       */
32   /* <Description>                                                         */
33   /*    A function used to return the Unicode index corresponding to a     */
34   /*    given glyph name.                                                  */
35   /*                                                                       */
36   /* <Input>                                                               */
37   /*    glyph_name :: The glyph name.                                      */
38   /*                                                                       */
39   /* <Return>                                                              */
40   /*    The Unicode character index resp. the non-Unicode value 0xFFFF if  */
41   /*    the glyph name has no known Unicode meaning.                       */
42   /*                                                                       */
43   /* <Note>                                                                */
44   /*    This function is able to map several different glyph names to the  */
45   /*    same Unicode value, according to the rules defined in the Adobe    */
46   /*    Glyph List table.                                                  */
47   /*                                                                       */
48   /*    This function will not be compiled if the configuration macro      */
49   /*    FT_CONFIG_OPTION_ADOBE_GLYPH_LIST is undefined.                    */
50   /*                                                                       */
51   typedef FT_ULong  (*PS_Unicode_Value_Func)( const char*  glyph_name );
52
53
54   /*************************************************************************/
55   /*                                                                       */
56   /* <FuncType>                                                            */
57   /*    PS_Unicode_Index_Func                                              */
58   /*                                                                       */
59   /* <Description>                                                         */
60   /*    A function used to return the glyph index corresponding to a given */
61   /*    Unicode value.                                                     */
62   /*                                                                       */
63   /* <Input>                                                               */
64   /*    num_glyphs  :: The number of glyphs in the face.                   */
65   /*                                                                       */
66   /*    glyph_names :: An array of glyph name pointers.                    */
67   /*                                                                       */
68   /*    unicode     :: The Unicode value.                                  */
69   /*                                                                       */
70   /* <Return>                                                              */
71   /*    The glyph index resp. 0xFFFF if no glyph corresponds to this       */
72   /*    Unicode value.                                                     */
73   /*                                                                       */
74   /* <Note>                                                                */
75   /*    This function is able to recognize several glyph names per Unicode */
76   /*    value, according to the Adobe Glyph List.                          */
77   /*                                                                       */
78   /*    This function will not be compiled if the configuration macro      */
79   /*    FT_CONFIG_OPTION_ADOBE_GLYPH_LIST is undefined.                    */
80   /*                                                                       */
81   typedef FT_UInt  (*PS_Unicode_Index_Func)( FT_UInt       num_glyphs,
82                                              const char**  glyph_names,
83                                              FT_ULong      unicode );
84
85
86   /*************************************************************************/
87   /*                                                                       */
88   /* <FuncType>                                                            */
89   /*    PS_Macintosh_Name_Func                                             */
90   /*                                                                       */
91   /* <Description>                                                         */
92   /*    A function used to return the glyph name corresponding to an Apple */
93   /*    glyph name index.                                                  */
94   /*                                                                       */
95   /* <Input>                                                               */
96   /*    name_index :: The index of the Mac name.                           */
97   /*                                                                       */
98   /* <Return>                                                              */
99   /*    The glyph name, or 0 if the index is invalid.                      */
100   /*                                                                       */
101   /* <Note>                                                                */
102   /*    This function will not be compiled if the configuration macro      */
103   /*    FT_CONFIG_OPTION_POSTSCRIPT_NAMES is undefined.                    */ 
104   /*                                                                       */
105   typedef const char*  (*PS_Macintosh_Name_Func)( FT_UInt  name_index );
106
107
108   typedef const char*  (*PS_Adobe_Std_Strings_Func)( FT_UInt  string_index );
109
110
111   typedef struct  PS_UniMap_
112   {
113     FT_UInt  unicode;
114     FT_UInt  glyph_index;
115
116   } PS_UniMap;
117
118
119   /*************************************************************************/
120   /*                                                                       */
121   /* <Struct>                                                              */
122   /*    PS_Unicodes                                                        */
123   /*                                                                       */
124   /* <Description>                                                         */
125   /*    A simple table used to map Unicode values to glyph indices.  It is */
126   /*    built by the PS_Build_Unicodes table according to the glyphs       */
127   /*    present in a font file.                                            */
128   /*                                                                       */
129   /* <Fields>                                                              */
130   /*    num_codes :: The number of glyphs in the font that match a given   */
131   /*                 Unicode value.                                        */
132   /*                                                                       */
133   /*    unicodes  :: An array of unicode values, sorted in increasing      */
134   /*                 order.                                                */
135   /*                                                                       */
136   /*    gindex    :: An array of glyph indices, corresponding to each      */
137   /*                 Unicode value.                                        */
138   /*                                                                       */
139   /* <Note>                                                                */
140   /*    Use the function PS_Lookup_Unicode() to retrieve the glyph index   */
141   /*    corresponding to a given Unicode character code.                   */
142   /*                                                                       */
143   typedef struct  PS_Unicodes_
144   {
145     FT_UInt     num_maps;
146     PS_UniMap*  maps;
147
148   } PS_Unicodes;
149
150
151   typedef FT_Error  (*PS_Build_Unicodes_Func)( FT_Memory     memory,
152                                                FT_UInt       num_glyphs,
153                                                const char**  glyph_names,
154                                                PS_Unicodes*  unicodes );
155
156   typedef FT_UInt  (*PS_Lookup_Unicode_Func)( PS_Unicodes*  unicodes,
157                                               FT_UInt       unicode );
158
159
160   /*************************************************************************/
161   /*                                                                       */
162   /* <Struct>                                                              */
163   /*    PSNames_Interface                                                  */
164   /*                                                                       */
165   /* <Description>                                                         */
166   /*    This structure defines the PSNames interface.                      */
167   /*                                                                       */
168   /* <Fields>                                                              */
169   /*    unicode_value         :: A function used to convert a glyph name   */
170   /*                             into a Unicode character code.            */
171   /*                                                                       */
172   /*    build_unicodes        :: A function which builds up the Unicode    */
173   /*                             mapping table.                            */
174   /*                                                                       */
175   /*    lookup_unicode        :: A function used to return the glyph index */
176   /*                             corresponding to a given Unicode          */
177   /*                             character.                                */
178   /*                                                                       */
179   /*    macintosh_name        :: A function used to return the standard    */
180   /*                             Apple glyph Postscript name corresponding */
181   /*                             to a given string index (used by the      */
182   /*                             TrueType `post' table).                   */
183   /*                                                                       */
184   /*    adobe_std_strings     :: A function that returns a pointer to a    */
185   /*                             Adobe Standard String for a given SID.    */
186   /*                                                                       */
187   /*    adobe_std_encoding    :: A table of 256 unsigned shorts that maps  */
188   /*                             character codes in the Adobe Standard     */
189   /*                             Encoding to SIDs.                         */
190   /*                                                                       */
191   /*    adobe_expert_encoding :: A table of 256 unsigned shorts that maps  */
192   /*                             character codes in the Adobe Expert       */
193   /*                             Encoding to SIDs.                         */
194   /*                                                                       */
195   /* <Note>                                                                */
196   /*    `unicode_value' and `unicode_index' will be set to 0 if the        */
197   /*    configuration macro FT_CONFIG_OPTION_ADOBE_GLYPH_LIST is           */
198   /*    undefined.                                                         */
199   /*                                                                       */
200   /*    `macintosh_name' will be set to 0 if the configuration macro       */
201   /*    FT_CONFIG_OPTION_POSTSCRIPT_NAMES is undefined.                    */
202   /*                                                                       */
203   typedef struct  PSNames_Interface_
204   {
205     PS_Unicode_Value_Func      unicode_value;
206     PS_Build_Unicodes_Func     build_unicodes;
207     PS_Lookup_Unicode_Func     lookup_unicode;
208     PS_Macintosh_Name_Func     macintosh_name;
209
210     PS_Adobe_Std_Strings_Func  adobe_std_strings;
211     const unsigned short*      adobe_std_encoding;
212     const unsigned short*      adobe_expert_encoding;
213
214   } PSNames_Interface;
215
216
217 #endif /* PSNAMES_H */
218
219
220 /* END */