Imported Upstream version 2.8
[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.8 API Reference</title>
7 <style type="text/css">
8   a:link { color: #0000EF; }
9   a:visited { color: #51188E; }
10   a:hover { color: #FF0000; }
11
12   body { font-family: Verdana, Geneva, Arial, Helvetica, serif;
13          color: #000000;
14          background: #FFFFFF;
15          width: 87%;
16          margin: auto; }
17
18   div.section { width: 75%;
19                 margin: auto; }
20   div.section hr { margin: 4ex 0 1ex 0; }
21   div.section h4 { background-color: #EEEEFF;
22                    font-size: medium;
23                    font-style: oblique;
24                    font-weight: bold;
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;
36                   font-size: 69%;
37                   margin: 1.5ex 0 1.5ex 0; }
38
39   h1 { text-align: center; }
40   h3 { font-size: medium;
41        margin: 4ex 0 1.5ex 0; }
42
43   p { text-align: justify; }
44
45   pre.colored { color: blue; }
46
47   span.keyword { font-family: monospace;
48                  text-align: left;
49                  white-space: pre;
50                  color: darkblue; }
51
52   table.fields td.val { font-weight: bold;
53                         text-align: right;
54                         width: 30%;
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;
62                 border: 0;
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%;
68                          border: 0;
69                          border-spacing: 0;
70                          margin: 1ex 0 1ex 0; }
71   table.index-toc-link td.left { padding: 0 0.5em 0 0.5em;
72                                  font-size: 83%;
73                                  text-align: left; }
74   table.index-toc-link td.middle { padding: 0 0.5em 0 0.5em;
75                                    font-size: 83%;
76                                    text-align: center; }
77   table.index-toc-link td.right { padding: 0 0.5em 0 0.5em;
78                                   font-size: 83%;
79                                   text-align: right; }
80   table.synopsis { margin: 6ex auto 6ex auto;
81                    border: 0;
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%;
87                       text-align: right;
88                       vertical-align: baseline;
89                       padding: 1ex 1em 1ex 0; }
90   table.toc td.desc { vertical-align: baseline;
91                       padding: 1ex 0 1ex 1em;
92                       text-align: left; }
93   table.toc td.desc p:first-child { margin: 0;
94                                     text-align: left; }
95   table.toc td.desc p { margin: 1.5ex 0 0 0;
96                         text-align: left; }
97
98 </style>
99 </head>
100 <body>
101
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>
104
105 <h1 id="module_management">Module Management</h1>
106 <h2>Synopsis</h2>
107 <table class="synopsis">
108 <tr><td><a href="#FT_Module">FT_Module</a></td><td>&nbsp;</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>&nbsp;</td></tr>
113 <tr><td>&nbsp;</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>&nbsp;</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>&nbsp;</td><td>&nbsp;</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>&nbsp;</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>
122 </table>
123
124
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 &lsquo;module_name&rsquo; field in the <a href="ft2-module_management.html#FT_Module_Class">FT_Module_Class</a> structure.</p>
127 <pre class="colored">
128   autofitter
129   bdf
130   cff
131   gxvalid
132   otvalid
133   pcf
134   pfr
135   psaux
136   pshinter
137   psnames
138   raster1
139   sfnt
140   smooth, smooth-lcd, smooth-lcdv
141   truetype
142   type1
143   type42
144   t1cid
145   winfonts
146 </pre>
147 <p>Note that the FreeType Cache sub-system is not a FreeType module.</p>
148
149 <div class="section">
150 <h3 id="FT_Module">FT_Module</h3>
151 <p>Defined in FT_FREETYPE_H (freetype/freetype.h).</p>
152 <pre>
153   <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_ModuleRec_*  <b>FT_Module</b>;
154 </pre>
155
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>
157
158 <hr>
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>
160
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>
164 <pre>
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 );
167 </pre>
168
169 <p>A function used to initialize (not create) a new module object.</p>
170
171 <h4>input</h4>
172 <table class="fields">
173 <tr><td class="val" id="module">module</td><td class="desc">
174 <p>The module to initialize.</p>
175 </td></tr>
176 </table>
177
178 <hr>
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>
180
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>
184 <pre>
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 );
187 </pre>
188
189 <p>A function used to finalize (not destroy) a given module object.</p>
190
191 <h4>input</h4>
192 <table class="fields">
193 <tr><td class="val" id="module">module</td><td class="desc">
194 <p>The module to finalize.</p>
195 </td></tr>
196 </table>
197
198 <hr>
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>
200
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>
204 <pre>
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 );
208 </pre>
209
210 <p>A function used to query a given module for a specific interface.</p>
211
212 <h4>input</h4>
213 <table class="fields">
214 <tr><td class="val" id="module">module</td><td class="desc">
215 <p>The module to be searched.</p>
216 </td></tr>
217 <tr><td class="val" id="name">name</td><td class="desc">
218 <p>The name of the interface in the module.</p>
219 </td></tr>
220 </table>
221
222 <hr>
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>
224
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>
228 <pre>
229   <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_Module_Class_
230   {
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;
236
237     <span class="keyword">const</span> <span class="keyword">void</span>*            module_interface;
238
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;
242
243   } <b>FT_Module_Class</b>;
244 </pre>
245
246 <p>The module class descriptor.</p>
247
248 <h4>fields</h4>
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>
252 </td></tr>
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>
255 </td></tr>
256 <tr><td class="val" id="module_name">module_name</td><td class="desc">
257 <p>The name of the module.</p>
258 </td></tr>
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>
261 </td></tr>
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>
264 </td></tr>
265 <tr><td class="val" id="module_init">module_init</td><td class="desc">
266 <p>The initializing function.</p>
267 </td></tr>
268 <tr><td class="val" id="module_done">module_done</td><td class="desc">
269 <p>The finalizing function.</p>
270 </td></tr>
271 <tr><td class="val" id="get_interface">get_interface</td><td class="desc">
272 <p>The interface requesting function.</p>
273 </td></tr>
274 </table>
275
276 <hr>
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>
278
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>
282 <pre>
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 );
286 </pre>
287
288 <p>Add a new module to a given library instance.</p>
289
290 <h4>inout</h4>
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>
294 </td></tr>
295 </table>
296
297 <h4>input</h4>
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>
301 </td></tr>
302 </table>
303
304 <h4>return</h4>
305 <p>FreeType error code. 0&nbsp;means success.</p>
306
307 <h4>note</h4>
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>
309
310 <hr>
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>
312
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>
316 <pre>
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 );
320 </pre>
321
322 <p>Find a module by its name.</p>
323
324 <h4>input</h4>
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>
328 </td></tr>
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>
331 </td></tr>
332 </table>
333
334 <h4>return</h4>
335 <p>A module handle. 0&nbsp;if none was found.</p>
336
337 <h4>note</h4>
338 <p>FreeType's internal modules aren't documented very well, and you should look up the source code for details.</p>
339
340 <hr>
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>
342
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>
346 <pre>
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 );
350 </pre>
351
352 <p>Remove a given module from a library instance.</p>
353
354 <h4>inout</h4>
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>
358 </td></tr>
359 </table>
360
361 <h4>input</h4>
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>
365 </td></tr>
366 </table>
367
368 <h4>return</h4>
369 <p>FreeType error code. 0&nbsp;means success.</p>
370
371 <h4>note</h4>
372 <p>The module object is destroyed by the function in case of success.</p>
373
374 <hr>
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>
376
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>
380 <pre>
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 );
383 </pre>
384
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>
386
387 <h4>inout</h4>
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>
391 </td></tr>
392 </table>
393
394 <hr>
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>
396
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>
400 <pre>
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 );
406 </pre>
407
408 <p>Set a property for a given module.</p>
409
410 <h4>input</h4>
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>
414 </td></tr>
415 <tr><td class="val" id="module_name">module_name</td><td class="desc">
416 <p>The module name.</p>
417 </td></tr>
418 <tr><td class="val" id="property_name">property_name</td><td class="desc">
419 <p>The property name. Properties are described in the &lsquo;Synopsis&rsquo; subsection of the module's documentation.</p>
420 <p>Note that only a few modules have properties.</p>
421 </td></tr>
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 &lsquo;value&rsquo; is dependent on the property; see the &lsquo;Synopsis&rsquo; subsection of the module's documentation.</p>
424 </td></tr>
425 </table>
426
427 <h4>return</h4>
428 <p>FreeType error code. 0&nbsp;means success.</p>
429
430 <h4>note</h4>
431 <p>If &lsquo;module_name&rsquo; isn't a valid module name, or &lsquo;property_name&rsquo; doesn't specify a valid property, or if &lsquo;value&rsquo; doesn't represent a valid value for the given property, an error is returned.</p>
432 <p>The following example sets property &lsquo;bar&rsquo; (a simple integer) in module &lsquo;foo&rsquo; to value&nbsp;1.</p>
433 <pre class="colored">
434   FT_UInt  bar;
435
436
437   bar = 1;
438   FT_Property_Set( library, "foo", "bar", &amp;bar );
439 </pre>
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>
442
443 <h4>since</h4>
444 <p>2.4.11</p>
445
446 <hr>
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>
448
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>
452 <pre>
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 );
458 </pre>
459
460 <p>Get a module's property value.</p>
461
462 <h4>input</h4>
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>
466 </td></tr>
467 <tr><td class="val" id="module_name">module_name</td><td class="desc">
468 <p>The module name.</p>
469 </td></tr>
470 <tr><td class="val" id="property_name">property_name</td><td class="desc">
471 <p>The property name. Properties are described in the &lsquo;Synopsis&rsquo; subsection of the module's documentation.</p>
472 </td></tr>
473 </table>
474
475 <h4>inout</h4>
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 &lsquo;value&rsquo; is dependent on the property; see the &lsquo;Synopsis&rsquo; subsection of the module's documentation.</p>
479 </td></tr>
480 </table>
481
482 <h4>return</h4>
483 <p>FreeType error code. 0&nbsp;means success.</p>
484
485 <h4>note</h4>
486 <p>If &lsquo;module_name&rsquo; isn't a valid module name, or &lsquo;property_name&rsquo; doesn't specify a valid property, or if &lsquo;value&rsquo; doesn't represent a valid value for the given property, an error is returned.</p>
487 <p>The following example gets property &lsquo;baz&rsquo; (a range) in module &lsquo;foo&rsquo;.</p>
488 <pre class="colored">
489   typedef  range_
490   {
491     FT_Int32  min;
492     FT_Int32  max;
493
494   } range;
495
496   range  baz;
497
498
499   FT_Property_Get( library, "foo", "baz", &amp;baz );
500 </pre>
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>
502
503 <h4>since</h4>
504 <p>2.4.11</p>
505
506 <hr>
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>
508
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>
512 <pre>
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 );
515 </pre>
516
517 <p>If compilation option FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES is set, this function reads the &lsquo;FREETYPE_PROPERTIES&rsquo; environment variable to control driver properties. See sections &lsquo;<a href="ft2-auto_hinter.html#auto_hinter">The auto-hinter</a>&rsquo;, &lsquo;<a href="ft2-cff_driver.html#cff_driver">The CFF driver</a>&rsquo;, &lsquo;<a href="ft2-pcf_driver.html#pcf_driver">The PCF driver</a>&rsquo;, and &lsquo;<a href="ft2-tt_driver.html#tt_driver">The TrueType driver</a>&rsquo; for more.</p>
518 <p>If the compilation option is not set, this function does nothing.</p>
519 <p>&lsquo;FREETYPE_PROPERTIES&rsquo; has the following syntax form (broken here into multiple lines for better readability).</p>
520 <pre class="colored">
521   &lt;optional whitespace&gt;
522 </pre>
523
524 <h4>module-name1</h4>
525 <p>':'</p>
526
527 <h4>property-name1</h4>
528 <p>'=' &lt;property-value1&gt;</p>
529
530 <h4>module-name2</h4>
531 <p>':'</p>
532
533 <h4>property-name2</h4>
534 <p>'=' &lt;property-value2&gt; ... }</p>
535 <p>Example:</p>
536 <pre class="colored">
537   FREETYPE_PROPERTIES=truetype:interpreter-version=35 \
538                       cff:no-stem-darkening=1 \
539                       autofitter:warping=1
540 </pre>
541
542 <h4>inout</h4>
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>
546 </td></tr>
547 </table>
548
549 <hr>
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>
551
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>
555 <pre>
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 );
559 </pre>
560
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>
564
565 <h4>input</h4>
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>
569 </td></tr>
570 </table>
571
572 <h4>output</h4>
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>
576 </td></tr>
577 </table>
578
579 <h4>return</h4>
580 <p>FreeType error code. 0&nbsp;means success.</p>
581
582 <h4>note</h4>
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>
584
585 <hr>
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>
587
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>
591 <pre>
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 );
594 </pre>
595
596 <p>Discard a given library object. This closes all drivers and discards all resource objects.</p>
597
598 <h4>input</h4>
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>
602 </td></tr>
603 </table>
604
605 <h4>return</h4>
606 <p>FreeType error code. 0&nbsp;means success.</p>
607
608 <h4>note</h4>
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>
610
611 <hr>
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>
613
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>
617 <pre>
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 );
620 </pre>
621
622 <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>
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>
624
625 <h4>input</h4>
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>
629 </td></tr>
630 </table>
631
632 <h4>return</h4>
633 <p>FreeType error code. 0&nbsp;means success.</p>
634
635 <h4>since</h4>
636 <p>2.4.2</p>
637
638 <hr>
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>
640
641 <div class="section">
642 <h3 id="FT_Renderer">FT_Renderer</h3>
643 <p>Defined in FT_FREETYPE_H (freetype/freetype.h).</p>
644 <pre>
645   <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_RendererRec_*  <b>FT_Renderer</b>;
646 </pre>
647
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>
649
650 <hr>
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>
652
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>
656 <pre>
657   <span class="keyword">typedef</span> <span class="keyword">struct</span>  FT_Renderer_Class_
658   {
659     <a href="ft2-module_management.html#FT_Module_Class">FT_Module_Class</a>            root;
660
661     <a href="ft2-basic_types.html#FT_Glyph_Format">FT_Glyph_Format</a>            glyph_format;
662
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;
667
668     <a href="ft2-raster.html#FT_Raster_Funcs">FT_Raster_Funcs</a>*           raster_class;
669
670   } <b>FT_Renderer_Class</b>;
671 </pre>
672
673 <p>The renderer module class descriptor.</p>
674
675 <h4>fields</h4>
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>
679 </td></tr>
680 <tr><td class="val" id="glyph_format">glyph_format</td><td class="desc">
681 <p>The glyph image format this renderer handles.</p>
682 </td></tr>
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>
685 </td></tr>
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>
688 </td></tr>
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>
691 </td></tr>
692 <tr><td class="val" id="set_mode">set_mode</td><td class="desc">
693 <p>A method used to pass additional parameters.</p>
694 </td></tr>
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>
697 </td></tr>
698 </table>
699
700 <hr>
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>
702
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>
706 <pre>
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 );
710 </pre>
711
712 <p>Retrieve the current renderer for a given glyph format.</p>
713
714 <h4>input</h4>
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>
718 </td></tr>
719 <tr><td class="val" id="format">format</td><td class="desc">
720 <p>The glyph format.</p>
721 </td></tr>
722 </table>
723
724 <h4>return</h4>
725 <p>A renderer handle. 0&nbsp;if none found.</p>
726
727 <h4>note</h4>
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>
730
731 <hr>
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>
733
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>
737 <pre>
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 );
743 </pre>
744
745 <p>Set the current renderer to use, and set additional mode.</p>
746
747 <h4>inout</h4>
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>
751 </td></tr>
752 </table>
753
754 <h4>input</h4>
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>
758 </td></tr>
759 <tr><td class="val" id="num_params">num_params</td><td class="desc">
760 <p>The number of additional parameters.</p>
761 </td></tr>
762 <tr><td class="val" id="parameters">parameters</td><td class="desc">
763 <p>Additional parameters.</p>
764 </td></tr>
765 </table>
766
767 <h4>return</h4>
768 <p>FreeType error code. 0&nbsp;means success.</p>
769
770 <h4>note</h4>
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 &lsquo;parameters&rsquo;; you should thus always pass NULL as the value.</p>
774
775 <hr>
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>
777
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>
781 <pre>
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 );
786 </pre>
787
788 <p>Set a debug hook function for debugging the interpreter of a font format.</p>
789
790 <h4>inout</h4>
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>
794 </td></tr>
795 </table>
796
797 <h4>input</h4>
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 &lsquo;ftobjs.h&rsquo;, e.g., &lsquo;FT_DEBUG_HOOK_TRUETYPE&rsquo;.</p>
801 </td></tr>
802 <tr><td class="val" id="debug_hook">debug_hook</td><td class="desc">
803 <p>The function used to debug the interpreter.</p>
804 </td></tr>
805 </table>
806
807 <h4>note</h4>
808 <p>Currently, four debug hook slots are available, but only two (for the TrueType and the Type&nbsp;1 interpreter) are defined.</p>
809 <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>
810
811 <hr>
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>
813
814 <div class="section">
815 <h3 id="FT_Driver">FT_Driver</h3>
816 <p>Defined in FT_FREETYPE_H (freetype/freetype.h).</p>
817 <pre>
818   <span class="keyword">typedef</span> <span class="keyword">struct</span> FT_DriverRec_*  <b>FT_Driver</b>;
819 </pre>
820
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>
822
823 <hr>
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>
825
826 </body>
827 </html>