1 | /***************************************************************************/
|
---|
2 | /* */
|
---|
3 | /* ftdriver.h */
|
---|
4 | /* */
|
---|
5 | /* FreeType font driver interface (specification). */
|
---|
6 | /* */
|
---|
7 | /* Copyright 1996-2001, 2002, 2003 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 | (*FT_Face_InitFunc)( 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 | (*FT_Face_DoneFunc)( FT_Face face );
|
---|
39 |
|
---|
40 |
|
---|
41 | typedef FT_Error
|
---|
42 | (*FT_Size_InitFunc)( FT_Size size );
|
---|
43 |
|
---|
44 | typedef void
|
---|
45 | (*FT_Size_DoneFunc)( FT_Size size );
|
---|
46 |
|
---|
47 |
|
---|
48 | typedef FT_Error
|
---|
49 | (*FT_Slot_InitFunc)( FT_GlyphSlot slot );
|
---|
50 |
|
---|
51 | typedef void
|
---|
52 | (*FT_Slot_DoneFunc)( FT_GlyphSlot slot );
|
---|
53 |
|
---|
54 |
|
---|
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 );
|
---|
61 |
|
---|
62 | typedef FT_Error
|
---|
63 | (*FT_Size_ResetPixelsFunc)( FT_Size size,
|
---|
64 | FT_UInt pixel_width,
|
---|
65 | FT_UInt pixel_height );
|
---|
66 |
|
---|
67 | typedef FT_Error
|
---|
68 | (*FT_Slot_LoadFunc)( FT_GlyphSlot slot,
|
---|
69 | FT_Size size,
|
---|
70 | FT_UInt glyph_index,
|
---|
71 | FT_Int32 load_flags );
|
---|
72 |
|
---|
73 |
|
---|
74 | typedef FT_UInt
|
---|
75 | (*FT_CharMap_CharIndexFunc)( FT_CharMap charmap,
|
---|
76 | FT_Long charcode );
|
---|
77 |
|
---|
78 | typedef FT_Long
|
---|
79 | (*FT_CharMap_CharNextFunc)( FT_CharMap charmap,
|
---|
80 | FT_Long charcode );
|
---|
81 |
|
---|
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 );
|
---|
87 |
|
---|
88 |
|
---|
89 | typedef FT_Error
|
---|
90 | (*FT_Face_AttachFunc)( FT_Face face,
|
---|
91 | FT_Stream stream );
|
---|
92 |
|
---|
93 |
|
---|
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 );
|
---|
100 |
|
---|
101 |
|
---|
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 advance */
|
---|
159 | /* widths of 'count' glyphs (in font units), */
|
---|
160 | /* starting at `first'. The `vertical' flag must */
|
---|
161 | /* be set to get vertical advance heights. The */
|
---|
162 | /* `advances' buffer is caller-allocated. */
|
---|
163 | /* Currently not implemented. The idea of this */
|
---|
164 | /* function is to be able to perform */
|
---|
165 | /* device-independent text layout without loading */
|
---|
166 | /* a single glyph image. */
|
---|
167 | /* */
|
---|
168 | /* <Note> */
|
---|
169 | /* Most function pointers, with the exception of `load_glyph' and */
|
---|
170 | /* `get_char_index' can be set to 0 to indicate a default behaviour. */
|
---|
171 | /* */
|
---|
172 | typedef struct FT_Driver_ClassRec_
|
---|
173 | {
|
---|
174 | FT_Module_Class root;
|
---|
175 |
|
---|
176 | FT_Long face_object_size;
|
---|
177 | FT_Long size_object_size;
|
---|
178 | FT_Long slot_object_size;
|
---|
179 |
|
---|
180 | FT_Face_InitFunc init_face;
|
---|
181 | FT_Face_DoneFunc done_face;
|
---|
182 |
|
---|
183 | FT_Size_InitFunc init_size;
|
---|
184 | FT_Size_DoneFunc done_size;
|
---|
185 |
|
---|
186 | FT_Slot_InitFunc init_slot;
|
---|
187 | FT_Slot_DoneFunc done_slot;
|
---|
188 |
|
---|
189 | FT_Size_ResetPointsFunc set_char_sizes;
|
---|
190 | FT_Size_ResetPixelsFunc set_pixel_sizes;
|
---|
191 |
|
---|
192 | FT_Slot_LoadFunc load_glyph;
|
---|
193 |
|
---|
194 | FT_Face_GetKerningFunc get_kerning;
|
---|
195 | FT_Face_AttachFunc attach_file;
|
---|
196 | FT_Face_GetAdvancesFunc get_advances;
|
---|
197 |
|
---|
198 | } FT_Driver_ClassRec, *FT_Driver_Class;
|
---|
199 |
|
---|
200 |
|
---|
201 | FT_END_HEADER
|
---|
202 |
|
---|
203 | #endif /* __FTDRIVER_H__ */
|
---|
204 |
|
---|
205 |
|
---|
206 | /* END */
|
---|