Imported Upstream version 2.4.9
[platform/upstream/freetype2.git] / docs / reference / ft2-module_management.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
3 <html>
4 <head>
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6 <title>FreeType-2.4.9 API Reference</title>
7 <style type="text/css">
8   body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
9          color: #000000;
10          background: #FFFFFF; }
11
12   p { text-align: justify; }
13   h1 { text-align: center; }
14   li { text-align: justify; }
15   td { padding: 0 0.5em 0 0.5em; }
16   td.left { padding: 0 0.5em 0 0.5em;
17             text-align: left; }
18
19   a:link { color: #0000EF; }
20   a:visited { color: #51188E; }
21   a:hover { color: #FF0000; }
22
23   span.keyword { font-family: monospace;
24                  text-align: left;
25                  white-space: pre;
26                  color: darkblue; }
27
28   pre.colored { color: blue; }
29
30   ul.empty { list-style-type: none; }
31 </style>
32 </head>
33 <body>
34
35 <table align=center><tr><td><font size=-1>[<a href="ft2-index.html">Index</a>]</font></td>
36 <td width="100%"></td>
37 <td><font size=-1>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
38 <center><h1>FreeType-2.4.9 API Reference</h1></center>
39
40 <center><h1>
41 Module Management
42 </h1></center>
43 <h2>Synopsis</h2>
44 <table align=center cellspacing=5 cellpadding=0 border=0>
45 <tr><td></td><td><a href="#FT_Module_Constructor">FT_Module_Constructor</a></td><td></td><td><a href="#FT_Get_Module">FT_Get_Module</a></td><td></td><td><a href="#FT_Set_Debug_Hook">FT_Set_Debug_Hook</a></td></tr>
46 <tr><td></td><td><a href="#FT_Module_Destructor">FT_Module_Destructor</a></td><td></td><td><a href="#FT_Remove_Module">FT_Remove_Module</a></td><td></td><td><a href="#FT_Add_Default_Modules">FT_Add_Default_Modules</a></td></tr>
47 <tr><td></td><td><a href="#FT_Module_Requester">FT_Module_Requester</a></td><td></td><td><a href="#FT_Reference_Library">FT_Reference_Library</a></td><td></td><td><a href="#FT_Renderer_Class">FT_Renderer_Class</a></td></tr>
48 <tr><td></td><td><a href="#FT_Module_Class">FT_Module_Class</a></td><td></td><td><a href="#FT_New_Library">FT_New_Library</a></td><td></td><td><a href="#FT_Get_Renderer">FT_Get_Renderer</a></td></tr>
49 <tr><td></td><td><a href="#FT_Add_Module">FT_Add_Module</a></td><td></td><td><a href="#FT_Done_Library">FT_Done_Library</a></td><td></td><td><a href="#FT_Set_Renderer">FT_Set_Renderer</a></td></tr>
50 </table><br><br>
51
52 <table align=center width="87%"><tr><td>
53 <p>The definitions below are used to manage modules within FreeType. Modules can be added, upgraded, and removed at runtime.</p>
54 </td></tr></table><br>
55 <table align=center width="75%"><tr><td>
56 <h4><a name="FT_Module_Constructor">FT_Module_Constructor</a></h4>
57 <table align=center width="87%"><tr><td>
58 Defined in FT_MODULE_H (freetype/ftmodapi.h).
59 </td></tr></table><br>
60 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
61
62   <span class="keyword">typedef</span> <a href="ft2-basic_types.html#FT_Error">FT_Error</a>
63   (*<b>FT_Module_Constructor</b>)( <a href="ft2-base_interface.html#FT_Module">FT_Module</a>  module );
64
65 </pre></table><br>
66 <table align=center width="87%"><tr><td>
67 <p>A function used to initialize (not create) a new module object.</p>
68 </td></tr></table><br>
69 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
70 <p></p>
71 <table cellpadding=3 border=0>
72 <tr valign=top><td><b>module</b></td><td>
73 <p>The module to initialize.</p>
74 </td></tr>
75 </table>
76 </td></tr></table>
77 </td></tr></table>
78 <hr width="75%">
79 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
80 <td width="100%"></td>
81 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
82
83 <table align=center width="75%"><tr><td>
84 <h4><a name="FT_Module_Destructor">FT_Module_Destructor</a></h4>
85 <table align=center width="87%"><tr><td>
86 Defined in FT_MODULE_H (freetype/ftmodapi.h).
87 </td></tr></table><br>
88 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
89
90   <span class="keyword">typedef</span> <span class="keyword">void</span>
91   (*<b>FT_Module_Destructor</b>)( <a href="ft2-base_interface.html#FT_Module">FT_Module</a>  module );
92
93 </pre></table><br>
94 <table align=center width="87%"><tr><td>
95 <p>A function used to finalize (not destroy) a given module object.</p>
96 </td></tr></table><br>
97 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
98 <p></p>
99 <table cellpadding=3 border=0>
100 <tr valign=top><td><b>module</b></td><td>
101 <p>The module to finalize.</p>
102 </td></tr>
103 </table>
104 </td></tr></table>
105 </td></tr></table>
106 <hr width="75%">
107 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
108 <td width="100%"></td>
109 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
110
111 <table align=center width="75%"><tr><td>
112 <h4><a name="FT_Module_Requester">FT_Module_Requester</a></h4>
113 <table align=center width="87%"><tr><td>
114 Defined in FT_MODULE_H (freetype/ftmodapi.h).
115 </td></tr></table><br>
116 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
117
118   <span class="keyword">typedef</span> FT_Module_Interface
119   (*<b>FT_Module_Requester</b>)( <a href="ft2-base_interface.html#FT_Module">FT_Module</a>    module,
120                           <span class="keyword">const</span> <span class="keyword">char</span>*  name );
121
122 </pre></table><br>
123 <table align=center width="87%"><tr><td>
124 <p>A function used to query a given module for a specific interface.</p>
125 </td></tr></table><br>
126 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
127 <p></p>
128 <table cellpadding=3 border=0>
129 <tr valign=top><td><b>module</b></td><td>
130 <p>The module to finalize.</p>
131 </td></tr>
132 <tr valign=top><td><b>name</b></td><td>
133 <p>The name of the interface in the module.</p>
134 </td></tr>
135 </table>
136 </td></tr></table>
137 </td></tr></table>
138 <hr width="75%">
139 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
140 <td width="100%"></td>
141 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
142
143 <table align=center width="75%"><tr><td>
144 <h4><a name="FT_Module_Class">FT_Module_Class</a></h4>
145 <table align=center width="87%"><tr><td>
146 Defined in FT_MODULE_H (freetype/ftmodapi.h).
147 </td></tr></table><br>
148 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
149
150   <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_Module_Class_
151   {
152     <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a>               module_flags;
153     <a href="ft2-basic_types.html#FT_Long">FT_Long</a>                module_size;
154     <span class="keyword">const</span> <a href="ft2-basic_types.html#FT_String">FT_String</a>*       module_name;
155     <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a>               module_version;
156     <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a>               module_requires;
157
158     <span class="keyword">const</span> <span class="keyword">void</span>*            module_interface;
159
160     <a href="ft2-module_management.html#FT_Module_Constructor">FT_Module_Constructor</a>  module_init;
161     <a href="ft2-module_management.html#FT_Module_Destructor">FT_Module_Destructor</a>   module_done;
162     <a href="ft2-module_management.html#FT_Module_Requester">FT_Module_Requester</a>    get_interface;
163
164   } <b>FT_Module_Class</b>;
165
166 </pre></table><br>
167 <table align=center width="87%"><tr><td>
168 <p>The module class descriptor.</p>
169 </td></tr></table><br>
170 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
171 <p></p>
172 <table cellpadding=3 border=0>
173 <tr valign=top><td><b>module_flags</b></td><td>
174 <p>Bit flags describing the module.</p>
175 </td></tr>
176 <tr valign=top><td><b>module_size</b></td><td>
177 <p>The size of one module object/instance in bytes.</p>
178 </td></tr>
179 <tr valign=top><td><b>module_name</b></td><td>
180 <p>The name of the module.</p>
181 </td></tr>
182 <tr valign=top><td><b>module_version</b></td><td>
183 <p>The version, as a 16.16 fixed number (major.minor).</p>
184 </td></tr>
185 <tr valign=top><td><b>module_requires</b></td><td>
186 <p>The version of FreeType this module requires, as a 16.16 fixed number (major.minor). Starts at version 2.0, i.e., 0x20000.</p>
187 </td></tr>
188 <tr valign=top><td><b>module_init</b></td><td>
189 <p>The initializing function.</p>
190 </td></tr>
191 <tr valign=top><td><b>module_done</b></td><td>
192 <p>The finalizing function.</p>
193 </td></tr>
194 <tr valign=top><td><b>get_interface</b></td><td>
195 <p>The interface requesting function.</p>
196 </td></tr>
197 </table>
198 </td></tr></table>
199 </td></tr></table>
200 <hr width="75%">
201 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
202 <td width="100%"></td>
203 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
204
205 <table align=center width="75%"><tr><td>
206 <h4><a name="FT_Add_Module">FT_Add_Module</a></h4>
207 <table align=center width="87%"><tr><td>
208 Defined in FT_MODULE_H (freetype/ftmodapi.h).
209 </td></tr></table><br>
210 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
211
212   FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
213   <b>FT_Add_Module</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a>              library,
214                  <span class="keyword">const</span> <a href="ft2-module_management.html#FT_Module_Class">FT_Module_Class</a>*  clazz );
215
216 </pre></table><br>
217 <table align=center width="87%"><tr><td>
218 <p>Add a new module to a given library instance.</p>
219 </td></tr></table><br>
220 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
221 <p></p>
222 <table cellpadding=3 border=0>
223 <tr valign=top><td><b>library</b></td><td>
224 <p>A handle to the library object.</p>
225 </td></tr>
226 </table>
227 </td></tr></table>
228 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
229 <p></p>
230 <table cellpadding=3 border=0>
231 <tr valign=top><td><b>clazz</b></td><td>
232 <p>A pointer to class descriptor for the module.</p>
233 </td></tr>
234 </table>
235 </td></tr></table>
236 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
237 <p>FreeType error code. 0&nbsp;means success.</p>
238 </td></tr></table>
239 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
240 <p>An error will be returned if a module already exists by that name, or if the module requires a version of FreeType that is too great.</p>
241 </td></tr></table>
242 </td></tr></table>
243 <hr width="75%">
244 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
245 <td width="100%"></td>
246 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
247
248 <table align=center width="75%"><tr><td>
249 <h4><a name="FT_Get_Module">FT_Get_Module</a></h4>
250 <table align=center width="87%"><tr><td>
251 Defined in FT_MODULE_H (freetype/ftmodapi.h).
252 </td></tr></table><br>
253 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
254
255   FT_EXPORT( <a href="ft2-base_interface.html#FT_Module">FT_Module</a> )
256   <b>FT_Get_Module</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a>   library,
257                  <span class="keyword">const</span> <span class="keyword">char</span>*  module_name );
258
259 </pre></table><br>
260 <table align=center width="87%"><tr><td>
261 <p>Find a module by its name.</p>
262 </td></tr></table><br>
263 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
264 <p></p>
265 <table cellpadding=3 border=0>
266 <tr valign=top><td><b>library</b></td><td>
267 <p>A handle to the library object.</p>
268 </td></tr>
269 <tr valign=top><td><b>module_name</b></td><td>
270 <p>The module's name (as an ASCII string).</p>
271 </td></tr>
272 </table>
273 </td></tr></table>
274 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
275 <p>A module handle. 0&nbsp;if none was found.</p>
276 </td></tr></table>
277 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
278 <p>FreeType's internal modules aren't documented very well, and you should look up the source code for details.</p>
279 </td></tr></table>
280 </td></tr></table>
281 <hr width="75%">
282 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
283 <td width="100%"></td>
284 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
285
286 <table align=center width="75%"><tr><td>
287 <h4><a name="FT_Remove_Module">FT_Remove_Module</a></h4>
288 <table align=center width="87%"><tr><td>
289 Defined in FT_MODULE_H (freetype/ftmodapi.h).
290 </td></tr></table><br>
291 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
292
293   FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
294   <b>FT_Remove_Module</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a>  library,
295                     <a href="ft2-base_interface.html#FT_Module">FT_Module</a>   module );
296
297 </pre></table><br>
298 <table align=center width="87%"><tr><td>
299 <p>Remove a given module from a library instance.</p>
300 </td></tr></table><br>
301 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
302 <p></p>
303 <table cellpadding=3 border=0>
304 <tr valign=top><td><b>library</b></td><td>
305 <p>A handle to a library object.</p>
306 </td></tr>
307 </table>
308 </td></tr></table>
309 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
310 <p></p>
311 <table cellpadding=3 border=0>
312 <tr valign=top><td><b>module</b></td><td>
313 <p>A handle to a module object.</p>
314 </td></tr>
315 </table>
316 </td></tr></table>
317 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
318 <p>FreeType error code. 0&nbsp;means success.</p>
319 </td></tr></table>
320 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
321 <p>The module object is destroyed by the function in case of success.</p>
322 </td></tr></table>
323 </td></tr></table>
324 <hr width="75%">
325 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
326 <td width="100%"></td>
327 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
328
329 <table align=center width="75%"><tr><td>
330 <h4><a name="FT_Reference_Library">FT_Reference_Library</a></h4>
331 <table align=center width="87%"><tr><td>
332 Defined in FT_MODULE_H (freetype/ftmodapi.h).
333 </td></tr></table><br>
334 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
335
336   FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
337   <b>FT_Reference_Library</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a>  library );
338
339 </pre></table><br>
340 <table align=center width="87%"><tr><td>
341 <p>A counter gets initialized to&nbsp;1 at the time an <a href="ft2-base_interface.html#FT_Library">FT_Library</a> structure is created. This function increments the counter. <a href="ft2-module_management.html#FT_Done_Library">FT_Done_Library</a> then only destroys a library if the counter is&nbsp;1, otherwise it simply decrements the counter.</p>
342 <p>This function helps in managing life-cycles of structures which reference <a href="ft2-base_interface.html#FT_Library">FT_Library</a> objects.</p>
343 </td></tr></table><br>
344 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
345 <p></p>
346 <table cellpadding=3 border=0>
347 <tr valign=top><td><b>library</b></td><td>
348 <p>A handle to a target library object.</p>
349 </td></tr>
350 </table>
351 </td></tr></table>
352 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
353 <p>FreeType error code. 0&nbsp;means success.</p>
354 </td></tr></table>
355 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>since</b></em></td></tr><tr><td>
356 <p>2.4.2</p>
357 </td></tr></table>
358 </td></tr></table>
359 <hr width="75%">
360 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
361 <td width="100%"></td>
362 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
363
364 <table align=center width="75%"><tr><td>
365 <h4><a name="FT_New_Library">FT_New_Library</a></h4>
366 <table align=center width="87%"><tr><td>
367 Defined in FT_MODULE_H (freetype/ftmodapi.h).
368 </td></tr></table><br>
369 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
370
371   FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
372   <b>FT_New_Library</b>( <a href="ft2-system_interface.html#FT_Memory">FT_Memory</a>    memory,
373                   <a href="ft2-base_interface.html#FT_Library">FT_Library</a>  *alibrary );
374
375 </pre></table><br>
376 <table align=center width="87%"><tr><td>
377 <p>This function is used to create a new FreeType library instance from a given memory object. It is thus possible to use libraries with distinct memory allocators within the same program.</p>
378 <p>Normally, you would call this function (followed by a call to <a href="ft2-module_management.html#FT_Add_Default_Modules">FT_Add_Default_Modules</a> or a series of calls to <a href="ft2-module_management.html#FT_Add_Module">FT_Add_Module</a>) instead of <a href="ft2-base_interface.html#FT_Init_FreeType">FT_Init_FreeType</a> to initialize the FreeType library.</p>
379 <p>Don't use <a href="ft2-base_interface.html#FT_Done_FreeType">FT_Done_FreeType</a> but <a href="ft2-module_management.html#FT_Done_Library">FT_Done_Library</a> to destroy a library instance.</p>
380 </td></tr></table><br>
381 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
382 <p></p>
383 <table cellpadding=3 border=0>
384 <tr valign=top><td><b>memory</b></td><td>
385 <p>A handle to the original memory object.</p>
386 </td></tr>
387 </table>
388 </td></tr></table>
389 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>output</b></em></td></tr><tr><td>
390 <p></p>
391 <table cellpadding=3 border=0>
392 <tr valign=top><td><b>alibrary</b></td><td>
393 <p>A pointer to handle of a new library object.</p>
394 </td></tr>
395 </table>
396 </td></tr></table>
397 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
398 <p>FreeType error code. 0&nbsp;means success.</p>
399 </td></tr></table>
400 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
401 <p>See the discussion of reference counters in the description of <a href="ft2-module_management.html#FT_Reference_Library">FT_Reference_Library</a>.</p>
402 </td></tr></table>
403 </td></tr></table>
404 <hr width="75%">
405 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
406 <td width="100%"></td>
407 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
408
409 <table align=center width="75%"><tr><td>
410 <h4><a name="FT_Done_Library">FT_Done_Library</a></h4>
411 <table align=center width="87%"><tr><td>
412 Defined in FT_MODULE_H (freetype/ftmodapi.h).
413 </td></tr></table><br>
414 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
415
416   FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
417   <b>FT_Done_Library</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a>  library );
418
419 </pre></table><br>
420 <table align=center width="87%"><tr><td>
421 <p>Discard a given library object. This closes all drivers and discards all resource objects.</p>
422 </td></tr></table><br>
423 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
424 <p></p>
425 <table cellpadding=3 border=0>
426 <tr valign=top><td><b>library</b></td><td>
427 <p>A handle to the target library.</p>
428 </td></tr>
429 </table>
430 </td></tr></table>
431 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
432 <p>FreeType error code. 0&nbsp;means success.</p>
433 </td></tr></table>
434 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
435 <p>See the discussion of reference counters in the description of <a href="ft2-module_management.html#FT_Reference_Library">FT_Reference_Library</a>.</p>
436 </td></tr></table>
437 </td></tr></table>
438 <hr width="75%">
439 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
440 <td width="100%"></td>
441 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
442
443 <table align=center width="75%"><tr><td>
444 <h4><a name="FT_Set_Debug_Hook">FT_Set_Debug_Hook</a></h4>
445 <table align=center width="87%"><tr><td>
446 Defined in FT_MODULE_H (freetype/ftmodapi.h).
447 </td></tr></table><br>
448 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
449
450   FT_EXPORT( <span class="keyword">void</span> )
451   <b>FT_Set_Debug_Hook</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a>         library,
452                      <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>            hook_index,
453                      FT_DebugHook_Func  debug_hook );
454
455 </pre></table><br>
456 <table align=center width="87%"><tr><td>
457 <p>Set a debug hook function for debugging the interpreter of a font format.</p>
458 </td></tr></table><br>
459 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
460 <p></p>
461 <table cellpadding=3 border=0>
462 <tr valign=top><td><b>library</b></td><td>
463 <p>A handle to the library object.</p>
464 </td></tr>
465 </table>
466 </td></tr></table>
467 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
468 <p></p>
469 <table cellpadding=3 border=0>
470 <tr valign=top><td><b>hook_index</b></td><td>
471 <p>The index of the debug hook. You should use the values defined in &lsquo;ftobjs.h&rsquo;, e.g., &lsquo;FT_DEBUG_HOOK_TRUETYPE&rsquo;.</p>
472 </td></tr>
473 <tr valign=top><td><b>debug_hook</b></td><td>
474 <p>The function used to debug the interpreter.</p>
475 </td></tr>
476 </table>
477 </td></tr></table>
478 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
479 <p>Currently, four debug hook slots are available, but only two (for the TrueType and the Type&nbsp;1 interpreter) are defined.</p>
480 <p>Since the internal headers of FreeType are no longer installed, the symbol &lsquo;FT_DEBUG_HOOK_TRUETYPE&rsquo; isn't available publicly. This is a bug and will be fixed in a forthcoming release.</p>
481 </td></tr></table>
482 </td></tr></table>
483 <hr width="75%">
484 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
485 <td width="100%"></td>
486 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
487
488 <table align=center width="75%"><tr><td>
489 <h4><a name="FT_Add_Default_Modules">FT_Add_Default_Modules</a></h4>
490 <table align=center width="87%"><tr><td>
491 Defined in FT_MODULE_H (freetype/ftmodapi.h).
492 </td></tr></table><br>
493 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
494
495   FT_EXPORT( <span class="keyword">void</span> )
496   <b>FT_Add_Default_Modules</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a>  library );
497
498 </pre></table><br>
499 <table align=center width="87%"><tr><td>
500 <p>Add the set of default drivers to a given library object. This is only useful when you create a library object with <a href="ft2-module_management.html#FT_New_Library">FT_New_Library</a> (usually to plug a custom memory manager).</p>
501 </td></tr></table><br>
502 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
503 <p></p>
504 <table cellpadding=3 border=0>
505 <tr valign=top><td><b>library</b></td><td>
506 <p>A handle to a new library object.</p>
507 </td></tr>
508 </table>
509 </td></tr></table>
510 </td></tr></table>
511 <hr width="75%">
512 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
513 <td width="100%"></td>
514 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
515
516 <table align=center width="75%"><tr><td>
517 <h4><a name="FT_Renderer_Class">FT_Renderer_Class</a></h4>
518 <table align=center width="87%"><tr><td>
519 Defined in FT_RENDER_H (freetype/ftrender.h).
520 </td></tr></table><br>
521 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
522
523   <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_Renderer_Class_
524   {
525     <a href="ft2-module_management.html#FT_Module_Class">FT_Module_Class</a>            root;
526
527     <a href="ft2-basic_types.html#FT_Glyph_Format">FT_Glyph_Format</a>            glyph_format;
528
529     FT_Renderer_RenderFunc     render_glyph;
530     FT_Renderer_TransformFunc  transform_glyph;
531     FT_Renderer_GetCBoxFunc    get_glyph_cbox;
532     FT_Renderer_SetModeFunc    set_mode;
533
534     <a href="ft2-raster.html#FT_Raster_Funcs">FT_Raster_Funcs</a>*           raster_class;
535
536   } <b>FT_Renderer_Class</b>;
537
538 </pre></table><br>
539 <table align=center width="87%"><tr><td>
540 <p>The renderer module class descriptor.</p>
541 </td></tr></table><br>
542 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>fields</b></em></td></tr><tr><td>
543 <p></p>
544 <table cellpadding=3 border=0>
545 <tr valign=top><td><b>root</b></td><td>
546 <p>The root <a href="ft2-module_management.html#FT_Module_Class">FT_Module_Class</a> fields.</p>
547 </td></tr>
548 <tr valign=top><td><b>glyph_format</b></td><td>
549 <p>The glyph image format this renderer handles.</p>
550 </td></tr>
551 <tr valign=top><td><b>render_glyph</b></td><td>
552 <p>A method used to render the image that is in a given glyph slot into a bitmap.</p>
553 </td></tr>
554 <tr valign=top><td><b>transform_glyph</b></td><td>
555 <p>A method used to transform the image that is in a given glyph slot.</p>
556 </td></tr>
557 <tr valign=top><td><b>get_glyph_cbox</b></td><td>
558 <p>A method used to access the glyph's cbox.</p>
559 </td></tr>
560 <tr valign=top><td><b>set_mode</b></td><td>
561 <p>A method used to pass additional parameters.</p>
562 </td></tr>
563 <tr valign=top><td><b>raster_class</b></td><td>
564 <p>For <a href="ft2-basic_types.html#FT_Glyph_Format">FT_GLYPH_FORMAT_OUTLINE</a> renderers only. This is a pointer to its raster's class.</p>
565 </td></tr>
566 </table>
567 </td></tr></table>
568 </td></tr></table>
569 <hr width="75%">
570 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
571 <td width="100%"></td>
572 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
573
574 <table align=center width="75%"><tr><td>
575 <h4><a name="FT_Get_Renderer">FT_Get_Renderer</a></h4>
576 <table align=center width="87%"><tr><td>
577 Defined in FT_RENDER_H (freetype/ftrender.h).
578 </td></tr></table><br>
579 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
580
581   FT_EXPORT( <a href="ft2-base_interface.html#FT_Renderer">FT_Renderer</a> )
582   <b>FT_Get_Renderer</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a>       library,
583                    <a href="ft2-basic_types.html#FT_Glyph_Format">FT_Glyph_Format</a>  format );
584
585 </pre></table><br>
586 <table align=center width="87%"><tr><td>
587 <p>Retrieve the current renderer for a given glyph format.</p>
588 </td></tr></table><br>
589 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
590 <p></p>
591 <table cellpadding=3 border=0>
592 <tr valign=top><td><b>library</b></td><td>
593 <p>A handle to the library object.</p>
594 </td></tr>
595 <tr valign=top><td><b>format</b></td><td>
596 <p>The glyph format.</p>
597 </td></tr>
598 </table>
599 </td></tr></table>
600 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
601 <p>A renderer handle. 0&nbsp;if none found.</p>
602 </td></tr></table>
603 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
604 <p>An error will be returned if a module already exists by that name, or if the module requires a version of FreeType that is too great.</p>
605 <p>To add a new renderer, simply use <a href="ft2-module_management.html#FT_Add_Module">FT_Add_Module</a>. To retrieve a renderer by its name, use <a href="ft2-module_management.html#FT_Get_Module">FT_Get_Module</a>.</p>
606 </td></tr></table>
607 </td></tr></table>
608 <hr width="75%">
609 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
610 <td width="100%"></td>
611 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
612
613 <table align=center width="75%"><tr><td>
614 <h4><a name="FT_Set_Renderer">FT_Set_Renderer</a></h4>
615 <table align=center width="87%"><tr><td>
616 Defined in FT_RENDER_H (freetype/ftrender.h).
617 </td></tr></table><br>
618 <table align=center width="87%"><tr bgcolor="#D6E8FF"><td><pre>
619
620   FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
621   <b>FT_Set_Renderer</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a>     library,
622                    <a href="ft2-base_interface.html#FT_Renderer">FT_Renderer</a>    renderer,
623                    <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a>        num_params,
624                    <a href="ft2-base_interface.html#FT_Parameter">FT_Parameter</a>*  parameters );
625
626 </pre></table><br>
627 <table align=center width="87%"><tr><td>
628 <p>Set the current renderer to use, and set additional mode.</p>
629 </td></tr></table><br>
630 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>inout</b></em></td></tr><tr><td>
631 <p></p>
632 <table cellpadding=3 border=0>
633 <tr valign=top><td><b>library</b></td><td>
634 <p>A handle to the library object.</p>
635 </td></tr>
636 </table>
637 </td></tr></table>
638 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>input</b></em></td></tr><tr><td>
639 <p></p>
640 <table cellpadding=3 border=0>
641 <tr valign=top><td><b>renderer</b></td><td>
642 <p>A handle to the renderer object.</p>
643 </td></tr>
644 <tr valign=top><td><b>num_params</b></td><td>
645 <p>The number of additional parameters.</p>
646 </td></tr>
647 <tr valign=top><td><b>parameters</b></td><td>
648 <p>Additional parameters.</p>
649 </td></tr>
650 </table>
651 </td></tr></table>
652 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>return</b></em></td></tr><tr><td>
653 <p>FreeType error code. 0&nbsp;means success.</p>
654 </td></tr></table>
655 <table align=center width="87%" cellpadding=5><tr bgcolor="#EEEEFF"><td><em><b>note</b></em></td></tr><tr><td>
656 <p>In case of success, the renderer will be used to convert glyph images in the renderer's known format into bitmaps.</p>
657 <p>This doesn't change the current renderer for other formats.</p>
658 <p>Currently, only the B/W renderer, if compiled with FT_RASTER_OPTION_ANTI_ALIASING (providing a 5-levels anti-aliasing mode; this option must be set directly in &lsquo;ftraster.c&rsquo; and is undefined by default) accepts a single tag &lsquo;pal5&rsquo; to set its gray palette as a character string with 5&nbsp;elements. Consequently, the third and fourth argument are zero normally.</p>
659 </td></tr></table>
660 </td></tr></table>
661 <hr width="75%">
662 <table align=center width="75%"><tr><td><font size=-2>[<a href="ft2-index.html">Index</a>]</font></td>
663 <td width="100%"></td>
664 <td><font size=-2>[<a href="ft2-toc.html">TOC</a>]</font></td></tr></table>
665
666 </body>
667 </html>