1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
2 "http://www.w3.org/TR/html4/loose.dtd">
5 <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
6 <title>FreeType-2.8 API Reference</title>
7 <style type="text/css">
8 a:link { color: #0000EF; }
9 a:visited { color: #51188E; }
10 a:hover { color: #FF0000; }
12 body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
18 div.section { width: 75%;
20 div.section hr { margin: 4ex 0 1ex 0; }
21 div.section h4 { background-color: #EEEEFF;
25 margin: 3ex 0 1.5ex 9%;
26 padding: 0.3ex 0 0.3ex 1%; }
27 div.section p { margin: 1.5ex 0 1.5ex 10%; }
28 div.section pre { margin: 3ex 0 3ex 9%;
29 background-color: #D6E8FF;
30 padding: 2ex 0 2ex 1%; }
31 div.section table.fields { width: 90%;
32 margin: 1.5ex 0 1.5ex 10%; }
33 div.section table.toc { width: 95%;
34 margin: 1.5ex 0 1.5ex 5%; }
35 div.timestamp { text-align: center;
37 margin: 1.5ex 0 1.5ex 0; }
39 h1 { text-align: center; }
40 h3 { font-size: medium;
41 margin: 4ex 0 1.5ex 0; }
43 p { text-align: justify; }
45 pre.colored { color: blue; }
47 span.keyword { font-family: monospace;
52 table.fields td.val { font-weight: bold;
55 vertical-align: baseline;
56 padding: 1ex 1em 1ex 0; }
57 table.fields td.desc { vertical-align: baseline;
58 padding: 1ex 0 1ex 1em; }
59 table.fields td.desc p:first-child { margin: 0; }
60 table.fields td.desc p { margin: 1.5ex 0 0 0; }
61 table.index { margin: 6ex auto 6ex auto;
63 border-collapse: separate;
64 border-spacing: 1em 0.3ex; }
65 table.index tr { padding: 0; }
66 table.index td { padding: 0; }
67 table.index-toc-link { width: 100%;
70 margin: 1ex 0 1ex 0; }
71 table.index-toc-link td.left { padding: 0 0.5em 0 0.5em;
74 table.index-toc-link td.middle { padding: 0 0.5em 0 0.5em;
77 table.index-toc-link td.right { padding: 0 0.5em 0 0.5em;
80 table.synopsis { margin: 6ex auto 6ex auto;
82 border-collapse: separate;
83 border-spacing: 2em 0.6ex; }
84 table.synopsis tr { padding: 0; }
85 table.synopsis td { padding: 0; }
86 table.toc td.link { width: 30%;
88 vertical-align: baseline;
89 padding: 1ex 1em 1ex 0; }
90 table.toc td.desc { vertical-align: baseline;
91 padding: 1ex 0 1ex 1em;
93 table.toc td.desc p:first-child { margin: 0;
95 table.toc td.desc p { margin: 1.5ex 0 0 0;
102 <table class="index-toc-link"><tr><td class="left">[<a href="ft2-index.html">Index</a>]</td><td class="right">[<a href="ft2-toc.html">TOC</a>]</td></tr></table>
103 <h1>FreeType-2.8 API Reference</h1>
105 <h1 id="module_management">Module Management</h1>
107 <table class="synopsis">
108 <tr><td><a href="#FT_Module">FT_Module</a></td><td> </td></tr>
109 <tr><td><a href="#FT_Module_Constructor">FT_Module_Constructor</a></td><td><a href="#FT_New_Library">FT_New_Library</a></td></tr>
110 <tr><td><a href="#FT_Module_Destructor">FT_Module_Destructor</a></td><td><a href="#FT_Done_Library">FT_Done_Library</a></td></tr>
111 <tr><td><a href="#FT_Module_Requester">FT_Module_Requester</a></td><td><a href="#FT_Reference_Library">FT_Reference_Library</a></td></tr>
112 <tr><td><a href="#FT_Module_Class">FT_Module_Class</a></td><td> </td></tr>
113 <tr><td> </td><td><a href="#FT_Renderer">FT_Renderer</a></td></tr>
114 <tr><td><a href="#FT_Add_Module">FT_Add_Module</a></td><td><a href="#FT_Renderer_Class">FT_Renderer_Class</a></td></tr>
115 <tr><td><a href="#FT_Get_Module">FT_Get_Module</a></td><td> </td></tr>
116 <tr><td><a href="#FT_Remove_Module">FT_Remove_Module</a></td><td><a href="#FT_Get_Renderer">FT_Get_Renderer</a></td></tr>
117 <tr><td><a href="#FT_Add_Default_Modules">FT_Add_Default_Modules</a></td><td><a href="#FT_Set_Renderer">FT_Set_Renderer</a></td></tr>
118 <tr><td> </td><td> </td></tr>
119 <tr><td><a href="#FT_Property_Set">FT_Property_Set</a></td><td><a href="#FT_Set_Debug_Hook">FT_Set_Debug_Hook</a></td></tr>
120 <tr><td><a href="#FT_Property_Get">FT_Property_Get</a></td><td> </td></tr>
121 <tr><td><a href="#FT_Set_Default_Properties">FT_Set_Default_Properties</a></td><td><a href="#FT_Driver">FT_Driver</a></td></tr>
125 <p>The definitions below are used to manage modules within FreeType. Modules can be added, upgraded, and removed at runtime. Additionally, some module properties can be controlled also.</p>
126 <p>Here is a list of possible values of the ‘module_name’ field in the <a href="ft2-module_management.html#FT_Module_Class">FT_Module_Class</a> structure.</p>
127 <pre class="colored">
140 smooth, smooth-lcd, smooth-lcdv
147 <p>Note that the FreeType Cache sub-system is not a FreeType module.</p>
149 <div class="section">
150 <h3 id="FT_Module">FT_Module</h3>
151 <p>Defined in FT_FREETYPE_H (freetype/freetype.h).</p>
153 <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_ModuleRec_* <b>FT_Module</b>;
156 <p>A handle to a given FreeType module object. A module can be a font driver, a renderer, or anything else that provides services to the former.</p>
159 <table class="index-toc-link"><tr><td class="left">[<a href="ft2-index.html">Index</a>]</td><td class="middle">[<a href="#">Top</a>]</td><td class="right">[<a href="ft2-toc.html">TOC</a>]</td></tr></table></div>
161 <div class="section">
162 <h3 id="FT_Module_Constructor">FT_Module_Constructor</h3>
163 <p>Defined in FT_MODULE_H (freetype/ftmodapi.h).</p>
165 <span class="keyword">typedef</span> <a href="ft2-basic_types.html#FT_Error">FT_Error</a>
166 (*<b>FT_Module_Constructor</b>)( <a href="ft2-module_management.html#FT_Module">FT_Module</a> module );
169 <p>A function used to initialize (not create) a new module object.</p>
172 <table class="fields">
173 <tr><td class="val" id="module">module</td><td class="desc">
174 <p>The module to initialize.</p>
179 <table class="index-toc-link"><tr><td class="left">[<a href="ft2-index.html">Index</a>]</td><td class="middle">[<a href="#">Top</a>]</td><td class="right">[<a href="ft2-toc.html">TOC</a>]</td></tr></table></div>
181 <div class="section">
182 <h3 id="FT_Module_Destructor">FT_Module_Destructor</h3>
183 <p>Defined in FT_MODULE_H (freetype/ftmodapi.h).</p>
185 <span class="keyword">typedef</span> <span class="keyword">void</span>
186 (*<b>FT_Module_Destructor</b>)( <a href="ft2-module_management.html#FT_Module">FT_Module</a> module );
189 <p>A function used to finalize (not destroy) a given module object.</p>
192 <table class="fields">
193 <tr><td class="val" id="module">module</td><td class="desc">
194 <p>The module to finalize.</p>
199 <table class="index-toc-link"><tr><td class="left">[<a href="ft2-index.html">Index</a>]</td><td class="middle">[<a href="#">Top</a>]</td><td class="right">[<a href="ft2-toc.html">TOC</a>]</td></tr></table></div>
201 <div class="section">
202 <h3 id="FT_Module_Requester">FT_Module_Requester</h3>
203 <p>Defined in FT_MODULE_H (freetype/ftmodapi.h).</p>
205 <span class="keyword">typedef</span> FT_Module_Interface
206 (*<b>FT_Module_Requester</b>)( <a href="ft2-module_management.html#FT_Module">FT_Module</a> module,
207 <span class="keyword">const</span> <span class="keyword">char</span>* name );
210 <p>A function used to query a given module for a specific interface.</p>
213 <table class="fields">
214 <tr><td class="val" id="module">module</td><td class="desc">
215 <p>The module to be searched.</p>
217 <tr><td class="val" id="name">name</td><td class="desc">
218 <p>The name of the interface in the module.</p>
223 <table class="index-toc-link"><tr><td class="left">[<a href="ft2-index.html">Index</a>]</td><td class="middle">[<a href="#">Top</a>]</td><td class="right">[<a href="ft2-toc.html">TOC</a>]</td></tr></table></div>
225 <div class="section">
226 <h3 id="FT_Module_Class">FT_Module_Class</h3>
227 <p>Defined in FT_MODULE_H (freetype/ftmodapi.h).</p>
229 <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_Module_Class_
231 <a href="ft2-basic_types.html#FT_ULong">FT_ULong</a> module_flags;
232 <a href="ft2-basic_types.html#FT_Long">FT_Long</a> module_size;
233 <span class="keyword">const</span> <a href="ft2-basic_types.html#FT_String">FT_String</a>* module_name;
234 <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a> module_version;
235 <a href="ft2-basic_types.html#FT_Fixed">FT_Fixed</a> module_requires;
237 <span class="keyword">const</span> <span class="keyword">void</span>* module_interface;
239 <a href="ft2-module_management.html#FT_Module_Constructor">FT_Module_Constructor</a> module_init;
240 <a href="ft2-module_management.html#FT_Module_Destructor">FT_Module_Destructor</a> module_done;
241 <a href="ft2-module_management.html#FT_Module_Requester">FT_Module_Requester</a> get_interface;
243 } <b>FT_Module_Class</b>;
246 <p>The module class descriptor.</p>
249 <table class="fields">
250 <tr><td class="val" id="module_flags">module_flags</td><td class="desc">
251 <p>Bit flags describing the module.</p>
253 <tr><td class="val" id="module_size">module_size</td><td class="desc">
254 <p>The size of one module object/instance in bytes.</p>
256 <tr><td class="val" id="module_name">module_name</td><td class="desc">
257 <p>The name of the module.</p>
259 <tr><td class="val" id="module_version">module_version</td><td class="desc">
260 <p>The version, as a 16.16 fixed number (major.minor).</p>
262 <tr><td class="val" id="module_requires">module_requires</td><td class="desc">
263 <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>
265 <tr><td class="val" id="module_init">module_init</td><td class="desc">
266 <p>The initializing function.</p>
268 <tr><td class="val" id="module_done">module_done</td><td class="desc">
269 <p>The finalizing function.</p>
271 <tr><td class="val" id="get_interface">get_interface</td><td class="desc">
272 <p>The interface requesting function.</p>
277 <table class="index-toc-link"><tr><td class="left">[<a href="ft2-index.html">Index</a>]</td><td class="middle">[<a href="#">Top</a>]</td><td class="right">[<a href="ft2-toc.html">TOC</a>]</td></tr></table></div>
279 <div class="section">
280 <h3 id="FT_Add_Module">FT_Add_Module</h3>
281 <p>Defined in FT_MODULE_H (freetype/ftmodapi.h).</p>
283 FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
284 <b>FT_Add_Module</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a> library,
285 <span class="keyword">const</span> <a href="ft2-module_management.html#FT_Module_Class">FT_Module_Class</a>* clazz );
288 <p>Add a new module to a given library instance.</p>
291 <table class="fields">
292 <tr><td class="val" id="library">library</td><td class="desc">
293 <p>A handle to the library object.</p>
298 <table class="fields">
299 <tr><td class="val" id="clazz">clazz</td><td class="desc">
300 <p>A pointer to class descriptor for the module.</p>
305 <p>FreeType error code. 0 means success.</p>
308 <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>
311 <table class="index-toc-link"><tr><td class="left">[<a href="ft2-index.html">Index</a>]</td><td class="middle">[<a href="#">Top</a>]</td><td class="right">[<a href="ft2-toc.html">TOC</a>]</td></tr></table></div>
313 <div class="section">
314 <h3 id="FT_Get_Module">FT_Get_Module</h3>
315 <p>Defined in FT_MODULE_H (freetype/ftmodapi.h).</p>
317 FT_EXPORT( <a href="ft2-module_management.html#FT_Module">FT_Module</a> )
318 <b>FT_Get_Module</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a> library,
319 <span class="keyword">const</span> <span class="keyword">char</span>* module_name );
322 <p>Find a module by its name.</p>
325 <table class="fields">
326 <tr><td class="val" id="library">library</td><td class="desc">
327 <p>A handle to the library object.</p>
329 <tr><td class="val" id="module_name">module_name</td><td class="desc">
330 <p>The module's name (as an ASCII string).</p>
335 <p>A module handle. 0 if none was found.</p>
338 <p>FreeType's internal modules aren't documented very well, and you should look up the source code for details.</p>
341 <table class="index-toc-link"><tr><td class="left">[<a href="ft2-index.html">Index</a>]</td><td class="middle">[<a href="#">Top</a>]</td><td class="right">[<a href="ft2-toc.html">TOC</a>]</td></tr></table></div>
343 <div class="section">
344 <h3 id="FT_Remove_Module">FT_Remove_Module</h3>
345 <p>Defined in FT_MODULE_H (freetype/ftmodapi.h).</p>
347 FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
348 <b>FT_Remove_Module</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a> library,
349 <a href="ft2-module_management.html#FT_Module">FT_Module</a> module );
352 <p>Remove a given module from a library instance.</p>
355 <table class="fields">
356 <tr><td class="val" id="library">library</td><td class="desc">
357 <p>A handle to a library object.</p>
362 <table class="fields">
363 <tr><td class="val" id="module">module</td><td class="desc">
364 <p>A handle to a module object.</p>
369 <p>FreeType error code. 0 means success.</p>
372 <p>The module object is destroyed by the function in case of success.</p>
375 <table class="index-toc-link"><tr><td class="left">[<a href="ft2-index.html">Index</a>]</td><td class="middle">[<a href="#">Top</a>]</td><td class="right">[<a href="ft2-toc.html">TOC</a>]</td></tr></table></div>
377 <div class="section">
378 <h3 id="FT_Add_Default_Modules">FT_Add_Default_Modules</h3>
379 <p>Defined in FT_MODULE_H (freetype/ftmodapi.h).</p>
381 FT_EXPORT( <span class="keyword">void</span> )
382 <b>FT_Add_Default_Modules</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a> library );
385 <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>
388 <table class="fields">
389 <tr><td class="val" id="library">library</td><td class="desc">
390 <p>A handle to a new library object.</p>
395 <table class="index-toc-link"><tr><td class="left">[<a href="ft2-index.html">Index</a>]</td><td class="middle">[<a href="#">Top</a>]</td><td class="right">[<a href="ft2-toc.html">TOC</a>]</td></tr></table></div>
397 <div class="section">
398 <h3 id="FT_Property_Set">FT_Property_Set</h3>
399 <p>Defined in FT_MODULE_H (freetype/ftmodapi.h).</p>
401 FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
402 <b>FT_Property_Set</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a> library,
403 <span class="keyword">const</span> <a href="ft2-basic_types.html#FT_String">FT_String</a>* module_name,
404 <span class="keyword">const</span> <a href="ft2-basic_types.html#FT_String">FT_String</a>* property_name,
405 <span class="keyword">const</span> <span class="keyword">void</span>* value );
408 <p>Set a property for a given module.</p>
411 <table class="fields">
412 <tr><td class="val" id="library">library</td><td class="desc">
413 <p>A handle to the library the module is part of.</p>
415 <tr><td class="val" id="module_name">module_name</td><td class="desc">
416 <p>The module name.</p>
418 <tr><td class="val" id="property_name">property_name</td><td class="desc">
419 <p>The property name. Properties are described in the ‘Synopsis’ subsection of the module's documentation.</p>
420 <p>Note that only a few modules have properties.</p>
422 <tr><td class="val" id="value">value</td><td class="desc">
423 <p>A generic pointer to a variable or structure that gives the new value of the property. The exact definition of ‘value’ is dependent on the property; see the ‘Synopsis’ subsection of the module's documentation.</p>
428 <p>FreeType error code. 0 means success.</p>
431 <p>If ‘module_name’ isn't a valid module name, or ‘property_name’ doesn't specify a valid property, or if ‘value’ doesn't represent a valid value for the given property, an error is returned.</p>
432 <p>The following example sets property ‘bar’ (a simple integer) in module ‘foo’ to value 1.</p>
433 <pre class="colored">
438 FT_Property_Set( library, "foo", "bar", &bar );
440 <p>Note that the FreeType Cache sub-system doesn't recognize module property changes. To avoid glyph lookup confusion within the cache you should call <a href="ft2-cache_subsystem.html#FTC_Manager_Reset">FTC_Manager_Reset</a> to completely flush the cache if a module property gets changed after <a href="ft2-cache_subsystem.html#FTC_Manager_New">FTC_Manager_New</a> has been called.</p>
441 <p>It is not possible to set properties of the FreeType Cache sub-system itself with FT_Property_Set; use ?FTC_Property_Set? instead.</p>
447 <table class="index-toc-link"><tr><td class="left">[<a href="ft2-index.html">Index</a>]</td><td class="middle">[<a href="#">Top</a>]</td><td class="right">[<a href="ft2-toc.html">TOC</a>]</td></tr></table></div>
449 <div class="section">
450 <h3 id="FT_Property_Get">FT_Property_Get</h3>
451 <p>Defined in FT_MODULE_H (freetype/ftmodapi.h).</p>
453 FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
454 <b>FT_Property_Get</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a> library,
455 <span class="keyword">const</span> <a href="ft2-basic_types.html#FT_String">FT_String</a>* module_name,
456 <span class="keyword">const</span> <a href="ft2-basic_types.html#FT_String">FT_String</a>* property_name,
457 <span class="keyword">void</span>* value );
460 <p>Get a module's property value.</p>
463 <table class="fields">
464 <tr><td class="val" id="library">library</td><td class="desc">
465 <p>A handle to the library the module is part of.</p>
467 <tr><td class="val" id="module_name">module_name</td><td class="desc">
468 <p>The module name.</p>
470 <tr><td class="val" id="property_name">property_name</td><td class="desc">
471 <p>The property name. Properties are described in the ‘Synopsis’ subsection of the module's documentation.</p>
476 <table class="fields">
477 <tr><td class="val" id="value">value</td><td class="desc">
478 <p>A generic pointer to a variable or structure that gives the value of the property. The exact definition of ‘value’ is dependent on the property; see the ‘Synopsis’ subsection of the module's documentation.</p>
483 <p>FreeType error code. 0 means success.</p>
486 <p>If ‘module_name’ isn't a valid module name, or ‘property_name’ doesn't specify a valid property, or if ‘value’ doesn't represent a valid value for the given property, an error is returned.</p>
487 <p>The following example gets property ‘baz’ (a range) in module ‘foo’.</p>
488 <pre class="colored">
499 FT_Property_Get( library, "foo", "baz", &baz );
501 <p>It is not possible to retrieve properties of the FreeType Cache sub-system with FT_Property_Get; use ?FTC_Property_Get? instead.</p>
507 <table class="index-toc-link"><tr><td class="left">[<a href="ft2-index.html">Index</a>]</td><td class="middle">[<a href="#">Top</a>]</td><td class="right">[<a href="ft2-toc.html">TOC</a>]</td></tr></table></div>
509 <div class="section">
510 <h3 id="FT_Set_Default_Properties">FT_Set_Default_Properties</h3>
511 <p>Defined in FT_MODULE_H (freetype/ftmodapi.h).</p>
513 FT_EXPORT( <span class="keyword">void</span> )
514 <b>FT_Set_Default_Properties</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a> library );
517 <p>If compilation option FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES is set, this function reads the ‘FREETYPE_PROPERTIES’ environment variable to control driver properties. See sections ‘<a href="ft2-auto_hinter.html#auto_hinter">The auto-hinter</a>’, ‘<a href="ft2-cff_driver.html#cff_driver">The CFF driver</a>’, ‘<a href="ft2-pcf_driver.html#pcf_driver">The PCF driver</a>’, and ‘<a href="ft2-tt_driver.html#tt_driver">The TrueType driver</a>’ for more.</p>
518 <p>If the compilation option is not set, this function does nothing.</p>
519 <p>‘FREETYPE_PROPERTIES’ has the following syntax form (broken here into multiple lines for better readability).</p>
520 <pre class="colored">
521 <optional whitespace>
524 <h4>module-name1</h4>
527 <h4>property-name1</h4>
528 <p>'=' <property-value1></p>
530 <h4>module-name2</h4>
533 <h4>property-name2</h4>
534 <p>'=' <property-value2> ... }</p>
536 <pre class="colored">
537 FREETYPE_PROPERTIES=truetype:interpreter-version=35 \
538 cff:no-stem-darkening=1 \
543 <table class="fields">
544 <tr><td class="val" id="library">library</td><td class="desc">
545 <p>A handle to a new library object.</p>
550 <table class="index-toc-link"><tr><td class="left">[<a href="ft2-index.html">Index</a>]</td><td class="middle">[<a href="#">Top</a>]</td><td class="right">[<a href="ft2-toc.html">TOC</a>]</td></tr></table></div>
552 <div class="section">
553 <h3 id="FT_New_Library">FT_New_Library</h3>
554 <p>Defined in FT_MODULE_H (freetype/ftmodapi.h).</p>
556 FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
557 <b>FT_New_Library</b>( <a href="ft2-system_interface.html#FT_Memory">FT_Memory</a> memory,
558 <a href="ft2-base_interface.html#FT_Library">FT_Library</a> *alibrary );
561 <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. Note, however, that the used <a href="ft2-system_interface.html#FT_Memory">FT_Memory</a> structure is expected to remain valid for the life of the <a href="ft2-base_interface.html#FT_Library">FT_Library</a> object.</p>
562 <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>, and a call to <a href="ft2-module_management.html#FT_Set_Default_Properties">FT_Set_Default_Properties</a>) instead of <a href="ft2-base_interface.html#FT_Init_FreeType">FT_Init_FreeType</a> to initialize the FreeType library.</p>
563 <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>
566 <table class="fields">
567 <tr><td class="val" id="memory">memory</td><td class="desc">
568 <p>A handle to the original memory object.</p>
573 <table class="fields">
574 <tr><td class="val" id="alibrary">alibrary</td><td class="desc">
575 <p>A pointer to handle of a new library object.</p>
580 <p>FreeType error code. 0 means success.</p>
583 <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>
586 <table class="index-toc-link"><tr><td class="left">[<a href="ft2-index.html">Index</a>]</td><td class="middle">[<a href="#">Top</a>]</td><td class="right">[<a href="ft2-toc.html">TOC</a>]</td></tr></table></div>
588 <div class="section">
589 <h3 id="FT_Done_Library">FT_Done_Library</h3>
590 <p>Defined in FT_MODULE_H (freetype/ftmodapi.h).</p>
592 FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
593 <b>FT_Done_Library</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a> library );
596 <p>Discard a given library object. This closes all drivers and discards all resource objects.</p>
599 <table class="fields">
600 <tr><td class="val" id="library">library</td><td class="desc">
601 <p>A handle to the target library.</p>
606 <p>FreeType error code. 0 means success.</p>
609 <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>
612 <table class="index-toc-link"><tr><td class="left">[<a href="ft2-index.html">Index</a>]</td><td class="middle">[<a href="#">Top</a>]</td><td class="right">[<a href="ft2-toc.html">TOC</a>]</td></tr></table></div>
614 <div class="section">
615 <h3 id="FT_Reference_Library">FT_Reference_Library</h3>
616 <p>Defined in FT_MODULE_H (freetype/ftmodapi.h).</p>
618 FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
619 <b>FT_Reference_Library</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a> library );
622 <p>A counter gets initialized to 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 1, otherwise it simply decrements the counter.</p>
623 <p>This function helps in managing life-cycles of structures that reference <a href="ft2-base_interface.html#FT_Library">FT_Library</a> objects.</p>
626 <table class="fields">
627 <tr><td class="val" id="library">library</td><td class="desc">
628 <p>A handle to a target library object.</p>
633 <p>FreeType error code. 0 means success.</p>
639 <table class="index-toc-link"><tr><td class="left">[<a href="ft2-index.html">Index</a>]</td><td class="middle">[<a href="#">Top</a>]</td><td class="right">[<a href="ft2-toc.html">TOC</a>]</td></tr></table></div>
641 <div class="section">
642 <h3 id="FT_Renderer">FT_Renderer</h3>
643 <p>Defined in FT_FREETYPE_H (freetype/freetype.h).</p>
645 <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_RendererRec_* <b>FT_Renderer</b>;
648 <p>A handle to a given FreeType renderer. A renderer is a module in charge of converting a glyph's outline image to a bitmap. It supports a single glyph image format, and one or more target surface depths.</p>
651 <table class="index-toc-link"><tr><td class="left">[<a href="ft2-index.html">Index</a>]</td><td class="middle">[<a href="#">Top</a>]</td><td class="right">[<a href="ft2-toc.html">TOC</a>]</td></tr></table></div>
653 <div class="section">
654 <h3 id="FT_Renderer_Class">FT_Renderer_Class</h3>
655 <p>Defined in FT_RENDER_H (freetype/ftrender.h).</p>
657 <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_Renderer_Class_
659 <a href="ft2-module_management.html#FT_Module_Class">FT_Module_Class</a> root;
661 <a href="ft2-basic_types.html#FT_Glyph_Format">FT_Glyph_Format</a> glyph_format;
663 FT_Renderer_RenderFunc render_glyph;
664 FT_Renderer_TransformFunc transform_glyph;
665 FT_Renderer_GetCBoxFunc get_glyph_cbox;
666 FT_Renderer_SetModeFunc set_mode;
668 <a href="ft2-raster.html#FT_Raster_Funcs">FT_Raster_Funcs</a>* raster_class;
670 } <b>FT_Renderer_Class</b>;
673 <p>The renderer module class descriptor.</p>
676 <table class="fields">
677 <tr><td class="val" id="root">root</td><td class="desc">
678 <p>The root <a href="ft2-module_management.html#FT_Module_Class">FT_Module_Class</a> fields.</p>
680 <tr><td class="val" id="glyph_format">glyph_format</td><td class="desc">
681 <p>The glyph image format this renderer handles.</p>
683 <tr><td class="val" id="render_glyph">render_glyph</td><td class="desc">
684 <p>A method used to render the image that is in a given glyph slot into a bitmap.</p>
686 <tr><td class="val" id="transform_glyph">transform_glyph</td><td class="desc">
687 <p>A method used to transform the image that is in a given glyph slot.</p>
689 <tr><td class="val" id="get_glyph_cbox">get_glyph_cbox</td><td class="desc">
690 <p>A method used to access the glyph's cbox.</p>
692 <tr><td class="val" id="set_mode">set_mode</td><td class="desc">
693 <p>A method used to pass additional parameters.</p>
695 <tr><td class="val" id="raster_class">raster_class</td><td class="desc">
696 <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>
701 <table class="index-toc-link"><tr><td class="left">[<a href="ft2-index.html">Index</a>]</td><td class="middle">[<a href="#">Top</a>]</td><td class="right">[<a href="ft2-toc.html">TOC</a>]</td></tr></table></div>
703 <div class="section">
704 <h3 id="FT_Get_Renderer">FT_Get_Renderer</h3>
705 <p>Defined in FT_RENDER_H (freetype/ftrender.h).</p>
707 FT_EXPORT( <a href="ft2-module_management.html#FT_Renderer">FT_Renderer</a> )
708 <b>FT_Get_Renderer</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a> library,
709 <a href="ft2-basic_types.html#FT_Glyph_Format">FT_Glyph_Format</a> format );
712 <p>Retrieve the current renderer for a given glyph format.</p>
715 <table class="fields">
716 <tr><td class="val" id="library">library</td><td class="desc">
717 <p>A handle to the library object.</p>
719 <tr><td class="val" id="format">format</td><td class="desc">
720 <p>The glyph format.</p>
725 <p>A renderer handle. 0 if none found.</p>
728 <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>
729 <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>
732 <table class="index-toc-link"><tr><td class="left">[<a href="ft2-index.html">Index</a>]</td><td class="middle">[<a href="#">Top</a>]</td><td class="right">[<a href="ft2-toc.html">TOC</a>]</td></tr></table></div>
734 <div class="section">
735 <h3 id="FT_Set_Renderer">FT_Set_Renderer</h3>
736 <p>Defined in FT_RENDER_H (freetype/ftrender.h).</p>
738 FT_EXPORT( <a href="ft2-basic_types.html#FT_Error">FT_Error</a> )
739 <b>FT_Set_Renderer</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a> library,
740 <a href="ft2-module_management.html#FT_Renderer">FT_Renderer</a> renderer,
741 <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a> num_params,
742 <a href="ft2-base_interface.html#FT_Parameter">FT_Parameter</a>* parameters );
745 <p>Set the current renderer to use, and set additional mode.</p>
748 <table class="fields">
749 <tr><td class="val" id="library">library</td><td class="desc">
750 <p>A handle to the library object.</p>
755 <table class="fields">
756 <tr><td class="val" id="renderer">renderer</td><td class="desc">
757 <p>A handle to the renderer object.</p>
759 <tr><td class="val" id="num_params">num_params</td><td class="desc">
760 <p>The number of additional parameters.</p>
762 <tr><td class="val" id="parameters">parameters</td><td class="desc">
763 <p>Additional parameters.</p>
768 <p>FreeType error code. 0 means success.</p>
771 <p>In case of success, the renderer will be used to convert glyph images in the renderer's known format into bitmaps.</p>
772 <p>This doesn't change the current renderer for other formats.</p>
773 <p>Currently, no FreeType renderer module uses ‘parameters’; you should thus always pass NULL as the value.</p>
776 <table class="index-toc-link"><tr><td class="left">[<a href="ft2-index.html">Index</a>]</td><td class="middle">[<a href="#">Top</a>]</td><td class="right">[<a href="ft2-toc.html">TOC</a>]</td></tr></table></div>
778 <div class="section">
779 <h3 id="FT_Set_Debug_Hook">FT_Set_Debug_Hook</h3>
780 <p>Defined in FT_MODULE_H (freetype/ftmodapi.h).</p>
782 FT_EXPORT( <span class="keyword">void</span> )
783 <b>FT_Set_Debug_Hook</b>( <a href="ft2-base_interface.html#FT_Library">FT_Library</a> library,
784 <a href="ft2-basic_types.html#FT_UInt">FT_UInt</a> hook_index,
785 FT_DebugHook_Func debug_hook );
788 <p>Set a debug hook function for debugging the interpreter of a font format.</p>
791 <table class="fields">
792 <tr><td class="val" id="library">library</td><td class="desc">
793 <p>A handle to the library object.</p>
798 <table class="fields">
799 <tr><td class="val" id="hook_index">hook_index</td><td class="desc">
800 <p>The index of the debug hook. You should use the values defined in ‘ftobjs.h’, e.g., ‘FT_DEBUG_HOOK_TRUETYPE’.</p>
802 <tr><td class="val" id="debug_hook">debug_hook</td><td class="desc">
803 <p>The function used to debug the interpreter.</p>
808 <p>Currently, four debug hook slots are available, but only two (for the TrueType and the Type 1 interpreter) are defined.</p>
809 <p>Since the internal headers of FreeType are no longer installed, the symbol ‘FT_DEBUG_HOOK_TRUETYPE’ isn't available publicly. This is a bug and will be fixed in a forthcoming release.</p>
812 <table class="index-toc-link"><tr><td class="left">[<a href="ft2-index.html">Index</a>]</td><td class="middle">[<a href="#">Top</a>]</td><td class="right">[<a href="ft2-toc.html">TOC</a>]</td></tr></table></div>
814 <div class="section">
815 <h3 id="FT_Driver">FT_Driver</h3>
816 <p>Defined in FT_FREETYPE_H (freetype/freetype.h).</p>
818 <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_DriverRec_* <b>FT_Driver</b>;
821 <p>A handle to a given FreeType font driver object. A font driver is a module capable of creating faces from font files.</p>
824 <table class="index-toc-link"><tr><td class="left">[<a href="ft2-index.html">Index</a>]</td><td class="middle">[<a href="#">Top</a>]</td><td class="right">[<a href="ft2-toc.html">TOC</a>]</td></tr></table></div>