Bringing apdf from vendor into main branch.
[AROS-Contrib.git] / apdf / freetype2 / include / freetype / internal / ftdriver.h
blob875d0909d2f1c1e66e2479edd47ebeb0a99d63dd
1 /***************************************************************************/
2 /* */
3 /* ftdriver.h */
4 /* */
5 /* FreeType font driver interface (specification). */
6 /* */
7 /* Copyright 1996-2001, 2002 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 /***************************************************************************/
19 #ifndef __FTDRIVER_H__
20 #define __FTDRIVER_H__
23 #include <ft2build.h>
24 #include FT_MODULE_H
27 FT_BEGIN_HEADER
30 typedef FT_Error
31 (*FT_Face_InitFunc)( FT_Stream stream,
32 FT_Face face,
33 FT_Int typeface_index,
34 FT_Int num_params,
35 FT_Parameter* parameters );
37 typedef void
38 (*FT_Face_DoneFunc)( FT_Face face );
41 typedef FT_Error
42 (*FT_Size_InitFunc)( FT_Size size );
44 typedef void
45 (*FT_Size_DoneFunc)( FT_Size size );
48 typedef FT_Error
49 (*FT_Slot_InitFunc)( FT_GlyphSlot slot );
51 typedef void
52 (*FT_Slot_DoneFunc)( FT_GlyphSlot slot );
55 typedef FT_Error
56 (*FT_Size_ResetPointsFunc)( FT_Size size,
57 FT_F26Dot6 char_width,
58 FT_F26Dot6 char_height,
59 FT_UInt horz_resolution,
60 FT_UInt vert_resolution );
62 typedef FT_Error
63 (*FT_Size_ResetPixelsFunc)( FT_Size size,
64 FT_UInt pixel_width,
65 FT_UInt pixel_height );
67 typedef FT_Error
68 (*FT_Slot_LoadFunc)( FT_GlyphSlot slot,
69 FT_Size size,
70 FT_UInt glyph_index,
71 FT_Int load_flags );
74 typedef FT_UInt
75 (*FT_CharMap_CharIndexFunc)( FT_CharMap charmap,
76 FT_Long charcode );
78 typedef FT_Long
79 (*FT_CharMap_CharNextFunc)( FT_CharMap charmap,
80 FT_Long charcode );
82 typedef FT_Error
83 (*FT_Face_GetKerningFunc)( FT_Face face,
84 FT_UInt left_glyph,
85 FT_UInt right_glyph,
86 FT_Vector* kerning );
89 typedef FT_Error
90 (*FT_Face_AttachFunc)( FT_Face face,
91 FT_Stream stream );
94 typedef FT_Error
95 (*FT_Face_GetAdvancesFunc)( FT_Face face,
96 FT_UInt first,
97 FT_UInt count,
98 FT_Bool vertical,
99 FT_UShort* advances );
102 /*************************************************************************/
103 /* */
104 /* <Struct> */
105 /* FT_Driver_ClassRec */
106 /* */
107 /* <Description> */
108 /* The font driver class. This structure mostly contains pointers to */
109 /* driver methods. */
110 /* */
111 /* <Fields> */
112 /* root :: The parent module. */
113 /* */
114 /* face_object_size :: The size of a face object in bytes. */
115 /* */
116 /* size_object_size :: The size of a size object in bytes. */
117 /* */
118 /* slot_object_size :: The size of a glyph object in bytes. */
119 /* */
120 /* init_face :: The format-specific face constructor. */
121 /* */
122 /* done_face :: The format-specific face destructor. */
123 /* */
124 /* init_size :: The format-specific size constructor. */
125 /* */
126 /* done_size :: The format-specific size destructor. */
127 /* */
128 /* init_slot :: The format-specific slot constructor. */
129 /* */
130 /* done_slot :: The format-specific slot destructor. */
131 /* */
132 /* set_char_sizes :: A handle to a function used to set the new */
133 /* character size in points + resolution. Can be */
134 /* set to 0 to indicate default behaviour. */
135 /* */
136 /* set_pixel_sizes :: A handle to a function used to set the new */
137 /* character size in pixels. Can be set to 0 to */
138 /* indicate default behaviour. */
139 /* */
140 /* load_glyph :: A function handle to load a given glyph image */
141 /* in a slot. This field is mandatory! */
142 /* */
143 /* get_char_index :: A function handle to return the glyph index of */
144 /* a given character for a given charmap. This */
145 /* field is mandatory! */
146 /* */
147 /* get_kerning :: A function handle to return the unscaled */
148 /* kerning for a given pair of glyphs. Can be */
149 /* set to 0 if the format doesn't support */
150 /* kerning. */
151 /* */
152 /* attach_file :: This function handle is used to read */
153 /* additional data for a face from another */
154 /* file/stream. For example, this can be used to */
155 /* add data from AFM or PFM files on a Type 1 */
156 /* face, or a CIDMap on a CID-keyed face. */
157 /* */
158 /* get_advances :: A function handle used to return the advances */
159 /* of 'count' glyphs, starting at `index'. the */
160 /* `vertical' flags must be set when vertical */
161 /* advances are queried. The advances buffer is */
162 /* caller-allocated. */
163 /* */
164 /* <Note> */
165 /* Most function pointers, with the exception of `load_glyph' and */
166 /* `get_char_index' can be set to 0 to indicate a default behaviour. */
167 /* */
168 typedef struct FT_Driver_ClassRec_
170 FT_Module_Class root;
172 FT_Int face_object_size;
173 FT_Int size_object_size;
174 FT_Int slot_object_size;
176 FT_Face_InitFunc init_face;
177 FT_Face_DoneFunc done_face;
179 FT_Size_InitFunc init_size;
180 FT_Size_DoneFunc done_size;
182 FT_Slot_InitFunc init_slot;
183 FT_Slot_DoneFunc done_slot;
185 FT_Size_ResetPointsFunc set_char_sizes;
186 FT_Size_ResetPixelsFunc set_pixel_sizes;
188 FT_Slot_LoadFunc load_glyph;
189 FT_CharMap_CharIndexFunc get_char_index;
191 FT_Face_GetKerningFunc get_kerning;
192 FT_Face_AttachFunc attach_file;
193 FT_Face_GetAdvancesFunc get_advances;
194 FT_CharMap_CharNextFunc get_next_char;
196 } FT_Driver_ClassRec, *FT_Driver_Class;
199 FT_END_HEADER
201 #endif /* __FTDRIVER_H__ */
204 /* END */