4349 |
Serge |
1 |
|
|
|
2 |
"http://www.w3.org/TR/html4/loose.dtd"> |
|
|
3 |
|
|
|
4 |
|
|
|
5 |
|
|
|
6 |
FreeType-2.5.0 API Reference |
|
|
7 |
|
|
|
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 |
|
|
|
32 |
|
|
|
33 |
|
|
|
34 |
|
|
|
35 |
|
|
|
38 |
FreeType-2.5.0 API Reference
|
|
|
39 |
|
|
|
40 |
|
|
|
41 |
Module Management |
|
|
42 |
|
|
|
43 |
Synopsis
|
|
|
44 |
|
|
|
52 |
|
|
|
53 |
|
|
|
54 |
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.
|
|
|
55 |
Here is a list of possible values of the ‘module_name’ field in the FT_Module_Class structure.
|
|
|
56 |
|
|
|
57 |
autofitter |
|
|
58 |
bdf |
|
|
59 |
cff |
|
|
60 |
gxvalid |
|
|
61 |
otvalid |
|
|
62 |
pcf |
|
|
63 |
pfr |
|
|
64 |
psaux |
|
|
65 |
pshinter |
|
|
66 |
psnames |
|
|
67 |
raster1, raster5 |
|
|
68 |
sfnt |
|
|
69 |
smooth, smooth-lcd, smooth-lcdv |
|
|
70 |
truetype |
|
|
71 |
type1 |
|
|
72 |
type42 |
|
|
73 |
t1cid |
|
|
74 |
winfonts |
|
|
75 |
|
|
|
76 |
Note that the FreeType Cache sub-system is not a FreeType module.
|
|
|
77 |
|
|
|
|
78 |
|
|
|
79 |
|
|
|
80 |
|
|
|
81 |
Defined in FT_MODULE_H (freetype/ftmodapi.h). |
|
|
82 |
|
|
|
|
83 |
|
|
|
89 |
|
|
|
90 |
A function used to initialize (not create) a new module object.
|
|
|
91 |
|
|
|
|
92 |
|
|
|
100 |
|
|
|
|
101 |
|
|
|
102 |
|
|
|
105 |
|
|
|
106 |
|
|
|
107 |
|
|
|
108 |
|
|
|
109 |
Defined in FT_MODULE_H (freetype/ftmodapi.h). |
|
|
110 |
|
|
|
|
111 |
|
|
|
117 |
|
|
|
118 |
A function used to finalize (not destroy) a given module object.
|
|
|
119 |
|
|
|
|
120 |
|
|
|
128 |
|
|
|
|
129 |
|
|
|
130 |
|
|
|
133 |
|
|
|
134 |
|
|
|
135 |
|
|
|
136 |
|
|
|
137 |
Defined in FT_MODULE_H (freetype/ftmodapi.h). |
|
|
138 |
|
|
|
|
139 |
|
|
|
146 |
|
|
|
147 |
A function used to query a given module for a specific interface.
|
|
|
148 |
|
|
|
|
149 |
|
|
|
160 |
|
|
|
|
161 |
|
|
|
162 |
|
|
|
165 |
|
|
|
166 |
|
|
|
167 |
|
|
|
168 |
|
|
|
169 |
Defined in FT_MODULE_H (freetype/ftmodapi.h). |
|
|
170 |
|
|
|
|
171 |
|
|
|
190 |
|
|
|
191 |
The module class descriptor.
|
|
|
192 |
|
|
|
|
193 |
fields | |
|
|
194 |
|
|
|
195 |
|
|
196 |
module_flags | |
|
|
197 |
Bit flags describing the module.
|
|
|
198 |
|
|
|
|
199 |
module_size | |
|
|
200 |
The size of one module object/instance in bytes.
|
|
|
201 |
|
|
|
|
202 |
module_name | |
|
|
203 |
The name of the module.
|
|
|
204 |
|
|
|
|
205 |
module_version | |
|
|
206 |
The version, as a 16.16 fixed number (major.minor).
|
|
|
207 |
|
|
|
|
208 |
module_requires | |
|
|
209 |
The version of FreeType this module requires, as a 16.16 fixed number (major.minor). Starts at version 2.0, i.e., 0x20000.
|
|
|
210 |
|
|
|
|
211 |
module_init | |
|
|
212 |
The initializing function.
|
|
|
213 |
|
|
|
|
214 |
module_done | |
|
|
215 |
The finalizing function.
|
|
|
216 |
|
|
|
|
217 |
get_interface | |
|
|
218 |
The interface requesting function.
|
|
|
219 |
|
|
|
|
220 |
| |
|
|
221 |
|
|
|
|
222 |
|
|
|
|
223 |
|
|
|
224 |
|
|
|
227 |
|
|
|
228 |
|
|
|
229 |
|
|
|
230 |
|
|
|
231 |
Defined in FT_MODULE_H (freetype/ftmodapi.h). |
|
|
232 |
|
|
|
|
233 |
|
|
|
240 |
|
|
|
241 |
Add a new module to a given library instance.
|
|
|
242 |
|
|
|
|
243 |
|
|
|
251 |
|
|
|
259 |
return | |
|
|
260 |
FreeType error code. 0 means success.
|
|
|
261 |
|
|
|
|
262 |
note | |
|
|
263 |
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.
|
|
|
264 |
|
|
|
|
265 |
|
|
|
|
266 |
|
|
|
267 |
|
|
|
270 |
|
|
|
271 |
|
|
|
272 |
|
|
|
273 |
|
|
|
274 |
Defined in FT_MODULE_H (freetype/ftmodapi.h). |
|
|
275 |
|
|
|
|
276 |
|
|
|
283 |
|
|
|
284 |
Find a module by its name.
|
|
|
285 |
|
|
|
|
286 |
|
|
|
297 |
return | |
|
|
298 |
A module handle. 0 if none was found.
|
|
|
299 |
|
|
|
|
300 |
note | |
|
|
301 |
FreeType's internal modules aren't documented very well, and you should look up the source code for details.
|
|
|
302 |
|
|
|
|
303 |
|
|
|
|
304 |
|
|
|
305 |
|
|
|
308 |
|
|
|
309 |
|
|
|
310 |
|
|
|
311 |
|
|
|
312 |
Defined in FT_MODULE_H (freetype/ftmodapi.h). |
|
|
313 |
|
|
|
|
314 |
|
|
|
321 |
|
|
|
322 |
Remove a given module from a library instance.
|
|
|
323 |
|
|
|
|
324 |
|
|
|
332 |
|
|
|
340 |
return | |
|
|
341 |
FreeType error code. 0 means success.
|
|
|
342 |
|
|
|
|
343 |
note | |
|
|
344 |
The module object is destroyed by the function in case of success.
|
|
|
345 |
|
|
|
|
346 |
|
|
|
|
347 |
|
|
|
348 |
|
|
|
351 |
|
|
|
352 |
|
|
|
353 |
|
|
|
354 |
|
|
|
355 |
Defined in FT_MODULE_H (freetype/ftmodapi.h). |
|
|
356 |
|
|
|
|
357 |
|
|
|
366 |
|
|
|
367 |
Set a property for a given module.
|
|
|
368 |
|
|
|
|
369 |
input | |
|
|
370 |
|
|
|
371 |
|
|
372 |
library | |
|
|
373 |
A handle to the library the module is part of.
|
|
|
374 |
|
|
|
|
375 |
module_name | |
|
|
376 |
The module name.
|
|
|
377 |
|
|
|
|
378 |
property_name | |
|
|
379 |
The property name. Properties are described in the ‘Synopsis’ subsection of the module's documentation.
|
|
|
380 |
Note that only a few modules have properties.
|
|
|
381 |
|
|
|
|
382 |
value | |
|
|
383 |
A generic pointer to a variable or structure which 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.
|
|
|
384 |
|
|
|
|
385 |
| |
|
|
386 |
|
|
|
|
387 |
return | |
|
|
388 |
FreeType error code. 0 means success.
|
|
|
389 |
|
|
|
|
390 |
note | |
|
|
391 |
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.
|
|
|
392 |
The following example sets property ‘bar’ (a simple integer) in module ‘foo’ to value 1.
|
|
|
393 |
|
|
|
394 |
FT_UInt bar; |
|
|
395 |
|
|
|
396 |
|
|
|
397 |
bar = 1; |
|
|
398 |
FT_Property_Set( library, "foo", "bar", &bar ); |
|
|
399 |
|
|
|
400 |
Note that the FreeType Cache sub-system doesn't recognize module property changes. To avoid glyph lookup confusion within the cache you should call FTC_Manager_Reset to completely flush the cache if a module property gets changed after FTC_Manager_New has been called.
|
|
|
401 |
It is not possible to set properties of the FreeType Cache sub-system itself with FT_Property_Set; use ?FTC_Property_Set? instead.
|
|
|
402 |
|
|
|
|
403 |
|
|
|
406 |
|
|
|
|
407 |
|
|
|
408 |
|
|
|
411 |
|
|
|
412 |
|
|
|
413 |
|
|
|
414 |
|
|
|
415 |
Defined in FT_MODULE_H (freetype/ftmodapi.h). |
|
|
416 |
|
|
|
|
417 |
|
|
|
426 |
|
|
|
427 |
Get a module's property value.
|
|
|
428 |
|
|
|
|
429 |
input | |
|
|
430 |
|
|
|
431 |
|
|
432 |
library | |
|
|
433 |
A handle to the library the module is part of.
|
|
|
434 |
|
|
|
|
435 |
module_name | |
|
|
436 |
The module name.
|
|
|
437 |
|
|
|
|
438 |
property_name | |
|
|
439 |
The property name. Properties are described in the ‘Synopsis’ subsection of the module's documentation.
|
|
|
440 |
|
|
|
|
441 |
| |
|
|
442 |
|
|
|
|
443 |
inout | |
|
|
444 |
|
|
|
445 |
|
|
446 |
value | |
|
|
447 |
A generic pointer to a variable or structure which 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.
|
|
|
448 |
|
|
|
|
449 |
| |
|
|
450 |
|
|
|
|
451 |
return | |
|
|
452 |
FreeType error code. 0 means success.
|
|
|
453 |
|
|
|
|
454 |
note | |
|
|
455 |
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.
|
|
|
456 |
The following example gets property ‘baz’ (a range) in module ‘foo’.
|
|
|
457 |
|
|
|
458 |
typedef range_ |
|
|
459 |
{ |
|
|
460 |
FT_Int32 min; |
|
|
461 |
FT_Int32 max; |
|
|
462 |
|
|
|
463 |
} range; |
|
|
464 |
|
|
|
465 |
range baz; |
|
|
466 |
|
|
|
467 |
|
|
|
468 |
FT_Property_Get( library, "foo", "baz", &baz ); |
|
|
469 |
|
|
|
470 |
It is not possible to retrieve properties of the FreeType Cache sub-system with FT_Property_Get; use ?FTC_Property_Get? instead.
|
|
|
471 |
|
|
|
|
472 |
|
|
|
475 |
|
|
|
|
476 |
|
|
|
477 |
|
|
|
480 |
|
|
|
481 |
|
|
|
482 |
|
|
|
483 |
|
|
|
484 |
Defined in FT_MODULE_H (freetype/ftmodapi.h). |
|
|
485 |
|
|
|
|
486 |
|
|
|
492 |
|
|
|
493 |
A counter gets initialized to 1 at the time an FT_Library structure is created. This function increments the counter. FT_Done_Library then only destroys a library if the counter is 1, otherwise it simply decrements the counter.
|
|
|
494 |
This function helps in managing life-cycles of structures which reference FT_Library objects.
|
|
|
495 |
|
|
|
|
496 |
|
|
|
504 |
return | |
|
|
505 |
FreeType error code. 0 means success.
|
|
|
506 |
|
|
|
|
507 |
|
|
|
510 |
|
|
|
|
511 |
|
|
|
512 |
|
|
|
515 |
|
|
|
516 |
|
|
|
556 |
|
|
|
557 |
|
|
|
560 |
|
|
|
561 |
|
|
|
562 |
|
|
|
563 |
|
|
|
564 |
Defined in FT_MODULE_H (freetype/ftmodapi.h). |
|
|
565 |
|
|
|
|
566 |
|
|
|
572 |
|
|
|
573 |
Discard a given library object. This closes all drivers and discards all resource objects.
|
|
|
574 |
|
|
|
|
575 |
|
|
|
583 |
return | |
|
|
584 |
FreeType error code. 0 means success.
|
|
|
585 |
|
|
|
|
586 |
|
|
|
589 |
|
|
|
|
590 |
|
|
|
591 |
|
|
|
594 |
|
|
|
595 |
|
|
|
596 |
|
|
|
597 |
|
|
|
598 |
Defined in FT_MODULE_H (freetype/ftmodapi.h). |
|
|
599 |
|
|
|
|
600 |
|
|
|
608 |
|
|
|
609 |
Set a debug hook function for debugging the interpreter of a font format.
|
|
|
610 |
|
|
|
|
611 |
|
|
|
619 |
input | |
|
|
620 |
|
|
|
621 |
|
|
622 |
hook_index | |
|
|
623 |
The index of the debug hook. You should use the values defined in ‘ftobjs.h’, e.g., ‘FT_DEBUG_HOOK_TRUETYPE’.
|
|
|
624 |
|
|
|
|
625 |
debug_hook | |
|
|
626 |
The function used to debug the interpreter.
|
|
|
627 |
|
|
|
|
628 |
| |
|
|
629 |
|
|
|
|
630 |
note | |
|
|
631 |
Currently, four debug hook slots are available, but only two (for the TrueType and the Type 1 interpreter) are defined.
|
|
|
632 |
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.
|
|
|
633 |
|
|
|
|
634 |
|
|
|
|
635 |
|
|
|
636 |
|
|
|
639 |
|
|
|
640 |
|
|
|
641 |
|
|
|
642 |
|
|
|
643 |
Defined in FT_MODULE_H (freetype/ftmodapi.h). |
|
|
644 |
|
|
|
|
645 |
|
|
|
651 |
|
|
|
652 |
Add the set of default drivers to a given library object. This is only useful when you create a library object with FT_New_Library (usually to plug a custom memory manager).
|
|
|
653 |
|
|
|
|
654 |
|
|
|
662 |
|
|
|
|
663 |
|
|
|
664 |
|
|
|
667 |
|
|
|
668 |
|
|
|
721 |
|
|
|
722 |
|
|
|
725 |
|
|
|
726 |
|
|
|
727 |
|
|
|
728 |
|
|
|
729 |
Defined in FT_RENDER_H (freetype/ftrender.h). |
|
|
730 |
|
|
|
|
731 |
|
|
|
738 |
|
|
|
739 |
Retrieve the current renderer for a given glyph format.
|
|
|
740 |
|
|
|
|
741 |
|
|
|
752 |
return | |
|
|
753 |
A renderer handle. 0 if none found.
|
|
|
754 |
|
|
|
|
755 |
note | |
|
|
756 |
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.
|
|
|
757 |
To add a new renderer, simply use FT_Add_Module. To retrieve a renderer by its name, use FT_Get_Module.
|
|
|
758 |
|
|
|
|
759 |
|
|
|
|
760 |
|
|
|
761 |
|
|
|
764 |
|
|
|
765 |
|
|
|
766 |
|
|
|
767 |
|
|
|
768 |
Defined in FT_RENDER_H (freetype/ftrender.h). |
|
|
769 |
|
|
|
|
770 |
|
|
|
779 |
|
|
|
780 |
Set the current renderer to use, and set additional mode.
|
|
|
781 |
|
|
|
|
782 |
|
|
|
790 |
|
|
|
804 |
return | |
|
|
805 |
FreeType error code. 0 means success.
|
|
|
806 |
|
|
|
|
807 |
note | |
|
|
808 |
In case of success, the renderer will be used to convert glyph images in the renderer's known format into bitmaps.
|
|
|
809 |
This doesn't change the current renderer for other formats.
|
|
|
810 |
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 ‘ftraster.c’ and is undefined by default) accepts a single tag ‘pal5’ to set its gray palette as a character string with 5 elements. Consequently, the third and fourth argument are zero normally.
|
|
|
811 |
|
|
|
|
812 |
|
|
|
|
813 |
|
|
|
814 |
|
|
|
817 |
|
|
|
818 |
|
|
|
819 |
|
!DOCTYPE>