misc fixes to get rrdtool working without included libraries.
[rrdtool.git] / libraries / freetype-2.0.5 / 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-2001 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 <ft2build.h>
25 #include FT_FREETYPE_H
26
27
28 FT_BEGIN_HEADER
29
30
31   /*************************************************************************/
32   /*                                                                       */
33   /* <FuncType>                                                            */
34   /*    PS_Unicode_Value_Func                                              */
35   /*                                                                       */
36   /* <Description>                                                         */
37   /*    A function used to return the Unicode index corresponding to a     */
38   /*    given glyph name.                                                  */
39   /*                                                                       */
40   /* <Input>                                                               */
41   /*    glyph_name :: The glyph name.                                      */
42   /*                                                                       */
43   /* <Return>                                                              */
44   /*    The Unicode character index resp. the non-Unicode value 0xFFFF if  */
45   /*    the glyph name has no known Unicode meaning.                       */
46   /*                                                                       */
47   /* <Note>                                                                */
48   /*    This function is able to map several different glyph names to the  */
49   /*    same Unicode value, according to the rules defined in the Adobe    */
50   /*    Glyph List table.                                                  */
51   /*                                                                       */
52   /*    This function will not be compiled if the configuration macro      */
53   /*    FT_CONFIG_OPTION_ADOBE_GLYPH_LIST is undefined.                    */
54   /*                                                                       */
55   typedef FT_ULong
56   (*PS_Unicode_Value_Func)( const char*  glyph_name );
57
58
59   /*************************************************************************/
60   /*                                                                       */
61   /* <FuncType>                                                            */
62   /*    PS_Unicode_Index_Func                                              */
63   /*                                                                       */
64   /* <Description>                                                         */
65   /*    A function used to return the glyph index corresponding to a given */
66   /*    Unicode value.                                                     */
67   /*                                                                       */
68   /* <Input>                                                               */
69   /*    num_glyphs  :: The number of glyphs in the face.                   */
70   /*                                                                       */
71   /*    glyph_names :: An array of glyph name pointers.                    */
72   /*                                                                       */
73   /*    unicode     :: The Unicode value.                                  */
74   /*                                                                       */
75   /* <Return>                                                              */
76   /*    The glyph index resp. 0xFFFF if no glyph corresponds to this       */
77   /*    Unicode value.                                                     */
78   /*                                                                       */
79   /* <Note>                                                                */
80   /*    This function is able to recognize several glyph names per Unicode */
81   /*    value, according to the Adobe Glyph List.                          */
82   /*                                                                       */
83   /*    This function will not be compiled if the configuration macro      */
84   /*    FT_CONFIG_OPTION_ADOBE_GLYPH_LIST is undefined.                    */
85   /*                                                                       */
86   typedef FT_UInt
87   (*PS_Unicode_Index_Func)( FT_UInt       num_glyphs,
88                             const char**  glyph_names,
89                             FT_ULong      unicode );
90
91
92   /*************************************************************************/
93   /*                                                                       */
94   /* <FuncType>                                                            */
95   /*    PS_Macintosh_Name_Func                                             */
96   /*                                                                       */
97   /* <Description>                                                         */
98   /*    A function used to return the glyph name corresponding to an Apple */
99   /*    glyph name index.                                                  */
100   /*                                                                       */
101   /* <Input>                                                               */
102   /*    name_index :: The index of the Mac name.                           */
103   /*                                                                       */
104   /* <Return>                                                              */
105   /*    The glyph name, or 0 if the index is invalid.                      */
106   /*                                                                       */
107   /* <Note>                                                                */
108   /*    This function will not be compiled if the configuration macro      */
109   /*    FT_CONFIG_OPTION_POSTSCRIPT_NAMES is undefined.                    */
110   /*                                                                       */
111   typedef const char*
112   (*PS_Macintosh_Name_Func)( FT_UInt  name_index );
113
114
115   typedef const char*
116   (*PS_Adobe_Std_Strings_Func)( FT_UInt  string_index );
117
118
119   typedef struct  PS_UniMap_
120   {
121     FT_UInt  unicode;
122     FT_UInt  glyph_index;
123
124   } PS_UniMap;
125
126
127   /*************************************************************************/
128   /*                                                                       */
129   /* <Struct>                                                              */
130   /*    PS_Unicodes                                                        */
131   /*                                                                       */
132   /* <Description>                                                         */
133   /*    A simple table used to map Unicode values to glyph indices.  It is */
134   /*    built by the PS_Build_Unicodes table according to the glyphs       */
135   /*    present in a font file.                                            */
136   /*                                                                       */
137   /* <Fields>                                                              */
138   /*    num_codes :: The number of glyphs in the font that match a given   */
139   /*                 Unicode value.                                        */
140   /*                                                                       */
141   /*    unicodes  :: An array of unicode values, sorted in increasing      */
142   /*                 order.                                                */
143   /*                                                                       */
144   /*    gindex    :: An array of glyph indices, corresponding to each      */
145   /*                 Unicode value.                                        */
146   /*                                                                       */
147   /* <Note>                                                                */
148   /*    Use the function PS_Lookup_Unicode() to retrieve the glyph index   */
149   /*    corresponding to a given Unicode character code.                   */
150   /*                                                                       */
151   typedef struct  PS_Unicodes_
152   {
153     FT_UInt     num_maps;
154     PS_UniMap*  maps;
155
156   } PS_Unicodes;
157
158
159   typedef FT_Error
160   (*PS_Build_Unicodes_Func)( FT_Memory     memory,
161                              FT_UInt       num_glyphs,
162                              const char**  glyph_names,
163                              PS_Unicodes*  unicodes );
164
165   typedef FT_UInt
166   (*PS_Lookup_Unicode_Func)( PS_Unicodes*  unicodes,
167                              FT_UInt       unicode );
168
169
170   /*************************************************************************/
171   /*                                                                       */
172   /* <Struct>                                                              */
173   /*    PSNames_Interface                                                  */
174   /*                                                                       */
175   /* <Description>                                                         */
176   /*    This structure defines the PSNames interface.                      */
177   /*                                                                       */
178   /* <Fields>                                                              */
179   /*    unicode_value         :: A function used to convert a glyph name   */
180   /*                             into a Unicode character code.            */
181   /*                                                                       */
182   /*    build_unicodes        :: A function which builds up the Unicode    */
183   /*                             mapping table.                            */
184   /*                                                                       */
185   /*    lookup_unicode        :: A function used to return the glyph index */
186   /*                             corresponding to a given Unicode          */
187   /*                             character.                                */
188   /*                                                                       */
189   /*    macintosh_name        :: A function used to return the standard    */
190   /*                             Apple glyph Postscript name corresponding */
191   /*                             to a given string index (used by the      */
192   /*                             TrueType `post' table).                   */
193   /*                                                                       */
194   /*    adobe_std_strings     :: A function that returns a pointer to a    */
195   /*                             Adobe Standard String for a given SID.    */
196   /*                                                                       */
197   /*    adobe_std_encoding    :: A table of 256 unsigned shorts that maps  */
198   /*                             character codes in the Adobe Standard     */
199   /*                             Encoding to SIDs.                         */
200   /*                                                                       */
201   /*    adobe_expert_encoding :: A table of 256 unsigned shorts that maps  */
202   /*                             character codes in the Adobe Expert       */
203   /*                             Encoding to SIDs.                         */
204   /*                                                                       */
205   /* <Note>                                                                */
206   /*    `unicode_value' and `unicode_index' will be set to 0 if the        */
207   /*    configuration macro FT_CONFIG_OPTION_ADOBE_GLYPH_LIST is           */
208   /*    undefined.                                                         */
209   /*                                                                       */
210   /*    `macintosh_name' will be set to 0 if the configuration macro       */
211   /*    FT_CONFIG_OPTION_POSTSCRIPT_NAMES is undefined.                    */
212   /*                                                                       */
213   typedef struct  PSNames_Interface_
214   {
215     PS_Unicode_Value_Func      unicode_value;
216     PS_Build_Unicodes_Func     build_unicodes;
217     PS_Lookup_Unicode_Func     lookup_unicode;
218     PS_Macintosh_Name_Func     macintosh_name;
219
220     PS_Adobe_Std_Strings_Func  adobe_std_strings;
221     const unsigned short*      adobe_std_encoding;
222     const unsigned short*      adobe_expert_encoding;
223
224   } PSNames_Interface;
225
226
227 FT_END_HEADER
228
229 #endif /* __PSNAMES_H__ */
230
231
232 /* END */