The BIG graph update
[rrdtool.git] / libraries / freetype-2.0.5 / include / freetype / internal / ftdriver.h
1 /***************************************************************************/
2 /*                                                                         */
3 /*  ftdriver.h                                                             */
4 /*                                                                         */
5 /*    FreeType font driver interface (specification).                      */
6 /*                                                                         */
7 /*  Copyright 1996-2001 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, LICENSE.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 __FTDRIVER_H__
20 #define __FTDRIVER_H__
21
22
23 #include <ft2build.h>
24 #include FT_MODULE_H
25
26
27 FT_BEGIN_HEADER
28
29
30   typedef FT_Error
31   (*FTDriver_initFace)( FT_Stream      stream,
32                         FT_Face        face,
33                         FT_Int         typeface_index,
34                         FT_Int         num_params,
35                         FT_Parameter*  parameters );
36
37   typedef void
38   (*FTDriver_doneFace)( FT_Face  face );
39
40
41   typedef FT_Error
42   (*FTDriver_initSize)( FT_Size  size );
43
44   typedef void
45   (*FTDriver_doneSize)( FT_Size  size );
46
47
48   typedef FT_Error
49   (*FTDriver_initGlyphSlot)( FT_GlyphSlot  slot );
50
51   typedef void
52   (*FTDriver_doneGlyphSlot)( FT_GlyphSlot  slot );
53
54
55   typedef FT_Error
56   (*FTDriver_setCharSizes)( FT_Size     size,
57                             FT_F26Dot6  char_width,
58                             FT_F26Dot6  char_height,
59                             FT_UInt     horz_resolution,
60                             FT_UInt     vert_resolution );
61
62   typedef FT_Error
63   (*FTDriver_setPixelSizes)( FT_Size  size,
64                              FT_UInt  pixel_width,
65                              FT_UInt  pixel_height );
66
67   typedef FT_Error
68   (*FTDriver_loadGlyph)( FT_GlyphSlot  slot,
69                          FT_Size       size,
70                          FT_UInt       glyph_index,
71                          FT_Int        load_flags );
72
73
74   typedef FT_UInt
75   (*FTDriver_getCharIndex)( FT_CharMap  charmap,
76                             FT_Long     charcode );
77
78   typedef FT_Error
79   (*FTDriver_getKerning)( FT_Face      face,
80                           FT_UInt      left_glyph,
81                           FT_UInt      right_glyph,
82                           FT_Vector*   kerning );
83
84
85   typedef FT_Error
86   (*FTDriver_attachFile)( FT_Face    face,
87                           FT_Stream  stream );
88
89
90   typedef FT_Error
91   (*FTDriver_getAdvances)( FT_Face     face,
92                            FT_UInt     first,
93                            FT_UInt     count,
94                            FT_Bool     vertical,
95                            FT_UShort*  advances );
96
97
98   /*************************************************************************/
99   /*                                                                       */
100   /* <Struct>                                                              */
101   /*    FT_Driver_Class                                                    */
102   /*                                                                       */
103   /* <Description>                                                         */
104   /*    The font driver class.  This structure mostly contains pointers to */
105   /*    driver methods.                                                    */
106   /*                                                                       */
107   /* <Fields>                                                              */
108   /*    root             :: The parent module.                             */
109   /*                                                                       */
110   /*    face_object_size :: The size of a face object in bytes.            */
111   /*                                                                       */
112   /*    size_object_size :: The size of a size object in bytes.            */
113   /*                                                                       */
114   /*    slot_object_size :: The size of a glyph object in bytes.           */
115   /*                                                                       */
116   /*    init_face        :: The format-specific face constructor.          */
117   /*                                                                       */
118   /*    done_face        :: The format-specific face destructor.           */
119   /*                                                                       */
120   /*    init_size        :: The format-specific size constructor.          */
121   /*                                                                       */
122   /*    done_size        :: The format-specific size destructor.           */
123   /*                                                                       */
124   /*    init_slot        :: The format-specific slot constructor.          */
125   /*                                                                       */
126   /*    done_slot        :: The format-specific slot destructor.           */
127   /*                                                                       */
128   /*    set_char_sizes   :: A handle to a function used to set the new     */
129   /*                        character size in points + resolution.  Can be */
130   /*                        set to 0 to indicate default behaviour.        */
131   /*                                                                       */
132   /*    set_pixel_sizes  :: A handle to a function used to set the new     */
133   /*                        character size in pixels.  Can be set to 0 to  */
134   /*                        indicate default behaviour.                    */
135   /*                                                                       */
136   /*    load_glyph       :: A function handle to load a given glyph image  */
137   /*                        in a slot.  This field is mandatory!           */
138   /*                                                                       */
139   /*    get_char_index   :: A function handle to return the glyph index of */
140   /*                        a given character for a given charmap.  This   */
141   /*                        field is mandatory!                            */
142   /*                                                                       */
143   /*    get_kerning      :: A function handle to return the unscaled       */
144   /*                        kerning for a given pair of glyphs.  Can be    */
145   /*                        set to 0 if the format doesn't support         */
146   /*                        kerning.                                       */
147   /*                                                                       */
148   /*    attach_file      :: This function handle is used to read           */
149   /*                        additional data for a face from another        */
150   /*                        file/stream.  For example, this can be used to */
151   /*                        add data from AFM or PFM files on a Type 1     */
152   /*                        face, or a CIDMap on a CID-keyed face.         */
153   /*                                                                       */
154   /*    get_advances     :: A function handle used to return the advances  */
155   /*                        of 'count' glyphs, starting at `index'.  the   */
156   /*                        `vertical' flags must be set when vertical     */
157   /*                        advances are queried.  The advances buffer is  */
158   /*                        caller-allocated.                              */
159   /*                                                                       */
160   /* <Note>                                                                */
161   /*    Most function pointers, with the exception of `load_glyph' and     */
162   /*    `get_char_index' can be set to 0 to indicate a default behaviour.  */
163   /*                                                                       */
164   typedef struct  FT_Driver_Class_
165   {
166     FT_Module_Class         root;
167
168     FT_Int                  face_object_size;
169     FT_Int                  size_object_size;
170     FT_Int                  slot_object_size;
171
172     FTDriver_initFace       init_face;
173     FTDriver_doneFace       done_face;
174
175     FTDriver_initSize       init_size;
176     FTDriver_doneSize       done_size;
177
178     FTDriver_initGlyphSlot  init_slot;
179     FTDriver_doneGlyphSlot  done_slot;
180
181     FTDriver_setCharSizes   set_char_sizes;
182     FTDriver_setPixelSizes  set_pixel_sizes;
183
184     FTDriver_loadGlyph      load_glyph;
185     FTDriver_getCharIndex   get_char_index;
186
187     FTDriver_getKerning     get_kerning;
188     FTDriver_attachFile     attach_file;
189
190     FTDriver_getAdvances    get_advances;
191
192   } FT_Driver_Class;
193
194
195 FT_END_HEADER
196
197 #endif /* __FTDRIVER_H__ */
198
199
200 /* END */