1 /***************************************************************************/
5 /* FreeType font driver interface (specification). */
7 /* Copyright 1996-2001, 2002 by */
8 /* David Turner, Robert Wilhelm, and Werner Lemberg. */
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. */
16 /***************************************************************************/
19 #ifndef __FTDRIVER_H__
20 #define __FTDRIVER_H__
31 (*FT_Face_InitFunc
)( FT_Stream stream
,
33 FT_Int typeface_index
,
35 FT_Parameter
* parameters
);
38 (*FT_Face_DoneFunc
)( FT_Face face
);
42 (*FT_Size_InitFunc
)( FT_Size size
);
45 (*FT_Size_DoneFunc
)( FT_Size size
);
49 (*FT_Slot_InitFunc
)( FT_GlyphSlot slot
);
52 (*FT_Slot_DoneFunc
)( FT_GlyphSlot slot
);
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
);
63 (*FT_Size_ResetPixelsFunc
)( FT_Size size
,
65 FT_UInt pixel_height
);
68 (*FT_Slot_LoadFunc
)( FT_GlyphSlot slot
,
75 (*FT_CharMap_CharIndexFunc
)( FT_CharMap charmap
,
79 (*FT_CharMap_CharNextFunc
)( FT_CharMap charmap
,
83 (*FT_Face_GetKerningFunc
)( FT_Face face
,
90 (*FT_Face_AttachFunc
)( FT_Face face
,
95 (*FT_Face_GetAdvancesFunc
)( FT_Face face
,
99 FT_UShort
* advances
);
102 /*************************************************************************/
105 /* FT_Driver_ClassRec */
108 /* The font driver class. This structure mostly contains pointers to */
109 /* driver methods. */
112 /* root :: The parent module. */
114 /* face_object_size :: The size of a face object in bytes. */
116 /* size_object_size :: The size of a size object in bytes. */
118 /* slot_object_size :: The size of a glyph object in bytes. */
120 /* init_face :: The format-specific face constructor. */
122 /* done_face :: The format-specific face destructor. */
124 /* init_size :: The format-specific size constructor. */
126 /* done_size :: The format-specific size destructor. */
128 /* init_slot :: The format-specific slot constructor. */
130 /* done_slot :: The format-specific slot destructor. */
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. */
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. */
140 /* load_glyph :: A function handle to load a given glyph image */
141 /* in a slot. This field is mandatory! */
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! */
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 */
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. */
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. */
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. */
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
;
201 #endif /* __FTDRIVER_H__ */