1 /***************************************************************************/
5 /* FreeType font driver interface (specification). */
7 /* Copyright 1996-2001 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 (*FTDriver_initFace)( FT_Stream stream,
33 FT_Int typeface_index,
35 FT_Parameter* parameters );
38 (*FTDriver_doneFace)( FT_Face face );
42 (*FTDriver_initSize)( FT_Size size );
45 (*FTDriver_doneSize)( FT_Size size );
49 (*FTDriver_initGlyphSlot)( FT_GlyphSlot slot );
52 (*FTDriver_doneGlyphSlot)( FT_GlyphSlot slot );
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 );
63 (*FTDriver_setPixelSizes)( FT_Size size,
65 FT_UInt pixel_height );
68 (*FTDriver_loadGlyph)( FT_GlyphSlot slot,
75 (*FTDriver_getCharIndex)( FT_CharMap charmap,
79 (*FTDriver_getKerning)( FT_Face face,
86 (*FTDriver_attachFile)( FT_Face face,
91 (*FTDriver_getAdvances)( FT_Face face,
95 FT_UShort* advances );
98 /*************************************************************************/
101 /* FT_Driver_Class */
104 /* The font driver class. This structure mostly contains pointers to */
105 /* driver methods. */
108 /* root :: The parent module. */
110 /* face_object_size :: The size of a face object in bytes. */
112 /* size_object_size :: The size of a size object in bytes. */
114 /* slot_object_size :: The size of a glyph object in bytes. */
116 /* init_face :: The format-specific face constructor. */
118 /* done_face :: The format-specific face destructor. */
120 /* init_size :: The format-specific size constructor. */
122 /* done_size :: The format-specific size destructor. */
124 /* init_slot :: The format-specific slot constructor. */
126 /* done_slot :: The format-specific slot destructor. */
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. */
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. */
136 /* load_glyph :: A function handle to load a given glyph image */
137 /* in a slot. This field is mandatory! */
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! */
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 */
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. */
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. */
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. */
164 typedef struct FT_Driver_Class_
166 FT_Module_Class root;
168 FT_Int face_object_size;
169 FT_Int size_object_size;
170 FT_Int slot_object_size;
172 FTDriver_initFace init_face;
173 FTDriver_doneFace done_face;
175 FTDriver_initSize init_size;
176 FTDriver_doneSize done_size;
178 FTDriver_initGlyphSlot init_slot;
179 FTDriver_doneGlyphSlot done_slot;
181 FTDriver_setCharSizes set_char_sizes;
182 FTDriver_setPixelSizes set_pixel_sizes;
184 FTDriver_loadGlyph load_glyph;
185 FTDriver_getCharIndex get_char_index;
187 FTDriver_getKerning get_kerning;
188 FTDriver_attachFile attach_file;
190 FTDriver_getAdvances get_advances;
197 #endif /* __FTDRIVER_H__ */