1 /***************************************************************************/
5 /* FreeType font driver interface (specification). */
7 /* Copyright 1996-2000 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 /***************************************************************************/
23 #include <freetype/ftmodule.h>
24 #include <freetype/config/ftconfig.h>
27 typedef FT_Error (*FTDriver_initFace)( FT_Stream stream,
29 FT_Int typeface_index,
31 FT_Parameter* parameters );
33 typedef void (*FTDriver_doneFace)( FT_Face face );
36 typedef FT_Error (*FTDriver_initSize)( FT_Size size );
38 typedef void (*FTDriver_doneSize)( FT_Size size );
41 typedef FT_Error (*FTDriver_initGlyphSlot)( FT_GlyphSlot slot );
43 typedef void (*FTDriver_doneGlyphSlot)( FT_GlyphSlot slot );
46 typedef FT_Error (*FTDriver_setCharSizes)( FT_Size size,
47 FT_F26Dot6 char_width,
48 FT_F26Dot6 char_height,
49 FT_UInt horz_resolution,
50 FT_UInt vert_resolution );
52 typedef FT_Error (*FTDriver_setPixelSizes)( FT_Size size,
54 FT_UInt pixel_height );
56 typedef FT_Error (*FTDriver_loadGlyph)( FT_GlyphSlot slot,
62 typedef FT_UInt (*FTDriver_getCharIndex)( FT_CharMap charmap,
65 typedef FT_Error (*FTDriver_getKerning)( FT_Face face,
71 typedef FT_Error (*FTDriver_attachFile)( FT_Face face,
75 typedef FT_Error (*FTDriver_getAdvances)( FT_Face face,
79 FT_UShort* advances );
82 /*************************************************************************/
88 /* The font driver class. This structure mostly contains pointers to */
92 /* root :: The parent module. */
94 /* face_object_size :: The size of a face object in bytes. */
96 /* size_object_size :: The size of a size object in bytes. */
98 /* slot_object_size :: The size of a glyph object in bytes. */
100 /* init_face :: The format-specific face constructor. */
102 /* done_face :: The format-specific face destructor. */
104 /* init_size :: The format-specific size constructor. */
106 /* done_size :: The format-specific size destructor. */
108 /* init_slot :: The format-specific slot constructor. */
110 /* done_slot :: The format-specific slot destructor. */
112 /* set_char_sizes :: A handle to a function used to set the new */
113 /* character size in points + resolution. Can be */
114 /* set to 0 to indicate default behaviour. */
116 /* set_pixel_sizes :: A handle to a function used to set the new */
117 /* character size in pixels. Can be set to 0 to */
118 /* indicate default behaviour. */
120 /* load_glyph :: A function handle to load a given glyph image */
121 /* in a slot. This field is mandatory! */
123 /* get_char_index :: A function handle to return the glyph index of */
124 /* a given character for a given charmap. This */
125 /* field is mandatory! */
127 /* get_kerning :: A function handle to return the unscaled */
128 /* kerning for a given pair of glyphs. Can be */
129 /* set to 0 if the format doesn't support */
132 /* attach_file :: This function handle is used to read */
133 /* additional data for a face from another */
134 /* file/stream. For example, this can be used to */
135 /* add data from AFM or PFM files on a Type 1 */
136 /* face, or a CIDMap on a CID-keyed face. */
138 /* get_advances :: A function handle used to return the advances */
139 /* of 'count' glyphs, starting at `index'. the */
140 /* `vertical' flags must be set when vertical */
141 /* advances are queried. The advances buffer is */
142 /* caller-allocated. */
145 /* Most function pointers, with the exception of `load_glyph' and */
146 /* `get_char_index' can be set to 0 to indicate a default behaviour. */
148 typedef struct FT_Driver_Class_
150 FT_Module_Class root;
152 FT_Int face_object_size;
153 FT_Int size_object_size;
154 FT_Int slot_object_size;
156 FTDriver_initFace init_face;
157 FTDriver_doneFace done_face;
159 FTDriver_initSize init_size;
160 FTDriver_doneSize done_size;
162 FTDriver_initGlyphSlot init_slot;
163 FTDriver_doneGlyphSlot done_slot;
165 FTDriver_setCharSizes set_char_sizes;
166 FTDriver_setPixelSizes set_pixel_sizes;
168 FTDriver_loadGlyph load_glyph;
169 FTDriver_getCharIndex get_char_index;
171 FTDriver_getKerning get_kerning;
172 FTDriver_attachFile attach_file;
174 FTDriver_getAdvances get_advances;
179 #endif /* FTDRIVER_H */