From 05f00e318b7842595179ad4d228dfaee5e992951 Mon Sep 17 00:00:00 2001 From: Mike DePaulo Date: Sat, 28 Feb 2015 07:31:25 -0500 Subject: Updated to freetype 2.5.5 --- freetype/docs/reference/ft2-module_management.html | 974 ++++++++++----------- 1 file changed, 467 insertions(+), 507 deletions(-) (limited to 'freetype/docs/reference/ft2-module_management.html') diff --git a/freetype/docs/reference/ft2-module_management.html b/freetype/docs/reference/ft2-module_management.html index 754a648bf..a836715e2 100644 --- a/freetype/docs/reference/ft2-module_management.html +++ b/freetype/docs/reference/ft2-module_management.html @@ -3,54 +3,120 @@ -FreeType-2.5.3 API Reference +FreeType-2.5.5 API Reference - - -
[Index][TOC]
-

FreeType-2.5.3 API Reference

+ +

FreeType-2.5.5 API Reference

-

-Module Management -

+

Module Management

Synopsis

- - - - - - - -
FT_Module_ConstructorFT_Remove_ModuleFT_Set_Debug_Hook
FT_Module_DestructorFT_Property_SetFT_Add_Default_Modules
FT_Module_RequesterFT_Property_GetFT_Renderer_Class
FT_Module_ClassFT_Reference_LibraryFT_Get_Renderer
FT_Add_ModuleFT_New_LibraryFT_Set_Renderer
FT_Get_ModuleFT_Done_Library


- -
+ + + + + + + + + + +
FT_ModuleFT_Add_Default_ModulesFT_Renderer
FT_Module_Constructor FT_Renderer_Class
FT_Module_DestructorFT_Property_Set 
FT_Module_RequesterFT_Property_GetFT_Get_Renderer
FT_Module_Class FT_Set_Renderer
 FT_New_Library 
FT_Add_ModuleFT_Done_LibraryFT_Set_Debug_Hook
FT_Get_ModuleFT_Reference_Library 
FT_Remove_Module FT_Driver
+ +

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.

Here is a list of possible values of the ‘module_name’ field in the FT_Module_Class structure.

@@ -74,102 +140,87 @@ Module Management
   winfonts                                                         
 

Note that the FreeType Cache sub-system is not a FreeType module.

-

-
-

FT_Module_Constructor

-
-Defined in FT_MODULE_H (ftmodapi.h). -

-
 
+
+

FT_Module

+

Defined in FT_FREETYPE_H (freetype.h).

+
+  typedef struct FT_ModuleRec_*  FT_Module;
+
+ +

A handle to a given FreeType module object. Each module can be a font driver, a renderer, or anything else that provides services to the formers.

+ +
+
+ +
+

FT_Module_Constructor

+

Defined in FT_MODULE_H (ftmodapi.h).

+
   typedef FT_Error
-  (*FT_Module_Constructor)( FT_Module  module );
+  (*FT_Module_Constructor)( FT_Module  module );
+
-

-

A function used to initialize (not create) a new module object.

-

-
input
-

- -
module + +

input

+ +
module

The module to initialize.

-
-
-
- - -
[Index][TOC]
- -
-

FT_Module_Destructor

-
-Defined in FT_MODULE_H (ftmodapi.h). -

-
 
+
+ + +
+

FT_Module_Destructor

+

Defined in FT_MODULE_H (ftmodapi.h).

+
   typedef void
-  (*FT_Module_Destructor)( FT_Module  module );
+  (*FT_Module_Destructor)( FT_Module  module );
+
-

-

A function used to finalize (not destroy) a given module object.

-

-
input
-

- -
module + +

input

+ +
module

The module to finalize.

-
-
-
- - -
[Index][TOC]
- -
-

FT_Module_Requester

-
-Defined in FT_MODULE_H (ftmodapi.h). -

-
 
+
+ + +
+

FT_Module_Requester

+

Defined in FT_MODULE_H (ftmodapi.h).

+
   typedef FT_Module_Interface
-  (*FT_Module_Requester)( FT_Module    module,
+  (*FT_Module_Requester)( FT_Module    module,
                           const char*  name );
+
-

-

A function used to query a given module for a specific interface.

-

-
input
-

- -
module + +

input

+ + -
module

The module to be searched.

name +
name

The name of the interface in the module.

-
-
-
- - -
[Index][TOC]
- -
-

FT_Module_Class

-
-Defined in FT_MODULE_H (ftmodapi.h). -

-
 
+
+ + +
+

FT_Module_Class

+

Defined in FT_MODULE_H (ftmodapi.h).

+
   typedef struct  FT_Module_Class_
   {
     FT_ULong               module_flags;
@@ -185,209 +236,193 @@ Defined in FT_MODULE_H (ftmodapi.h).
     FT_Module_Requester    get_interface;
 
   } FT_Module_Class;
+
-

-

The module class descriptor.

-

-
fields
-

- -
module_flags + +

fields

+ + - - - - - - -
module_flags

Bit flags describing the module.

module_size +
module_size

The size of one module object/instance in bytes.

module_name +
module_name

The name of the module.

module_version +
module_version

The version, as a 16.16 fixed number (major.minor).

module_requires +
module_requires

The version of FreeType this module requires, as a 16.16 fixed number (major.minor). Starts at version 2.0, i.e., 0x20000.

module_init +
module_init

The initializing function.

module_done +
module_done

The finalizing function.

get_interface +
get_interface

The interface requesting function.

-
-
-
- - -
[Index][TOC]
- -
-

FT_Add_Module

-
-Defined in FT_MODULE_H (ftmodapi.h). -

-
 
+
+ + +
+

FT_Add_Module

+

Defined in FT_MODULE_H (ftmodapi.h).

+
   FT_EXPORT( FT_Error )
   FT_Add_Module( FT_Library              library,
                  const FT_Module_Class*  clazz );
+
-

-

Add a new module to a given library instance.

-

-
inout
-

- -
library + +

inout

+ +
library

A handle to the library object.

-
-
input
-

- -
clazz + +

input

+ +
clazz

A pointer to class descriptor for the module.

-
-
return
+ +

return

FreeType error code. 0 means success.

-
-
note
+ +

note

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.

-
-
-
- - -
[Index][TOC]
- -
-

FT_Get_Module

-
-Defined in FT_MODULE_H (ftmodapi.h). -

-
-
-  FT_EXPORT( FT_Module )
+
+
+ + +
+

FT_Get_Module

+

Defined in FT_MODULE_H (ftmodapi.h).

+
+  FT_EXPORT( FT_Module )
   FT_Get_Module( FT_Library   library,
                  const char*  module_name );
+
-

-

Find a module by its name.

-

-
input
-

- -
library + +

input

+ + -
library

A handle to the library object.

module_name +
module_name

The module's name (as an ASCII string).

-
-
return
+ +

return

A module handle. 0 if none was found.

-
-
note
+ +

note

FreeType's internal modules aren't documented very well, and you should look up the source code for details.

-
-
-
- - -
[Index][TOC]
- -
-

FT_Remove_Module

-
-Defined in FT_MODULE_H (ftmodapi.h). -

-
 
+
+ + +
+

FT_Remove_Module

+

Defined in FT_MODULE_H (ftmodapi.h).

+
   FT_EXPORT( FT_Error )
   FT_Remove_Module( FT_Library  library,
-                    FT_Module   module );
+                    FT_Module   module );
+
-

-

Remove a given module from a library instance.

-

-
inout
-

- -
library + +

inout

+ +
library

A handle to a library object.

-
-
input
-

- -
module + +

input

+ +
module

A handle to a module object.

-
-
return
+ +

return

FreeType error code. 0 means success.

-
-
note
+ +

note

The module object is destroyed by the function in case of success.

-
-
-
- - -
[Index][TOC]
- -
-

FT_Property_Set

-
-Defined in FT_MODULE_H (ftmodapi.h). -

-
 
+
+ + +
+

FT_Add_Default_Modules

+

Defined in FT_MODULE_H (ftmodapi.h).

+
+  FT_EXPORT( void )
+  FT_Add_Default_Modules( FT_Library  library );
+
+ +

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).

+ +

inout

+ + +
library +

A handle to a new library object.

+
+ +
+
+ +
+

FT_Property_Set

+

Defined in FT_MODULE_H (ftmodapi.h).

+
   FT_EXPORT( FT_Error )
   FT_Property_Set( FT_Library        library,
                    const FT_String*  module_name,
                    const FT_String*  property_name,
                    const void*       value );
+
-

-

Set a property for a given module.

-

-
input
-

- -
library + +

input

+ + - - -
library

A handle to the library the module is part of.

module_name +
module_name

The module name.

property_name +
property_name

The property name. Properties are described in the ‘Synopsis’ subsection of the module's documentation.

Note that only a few modules have properties.

value +
value

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.

-
-
return
+ +

return

FreeType error code. 0 means success.

-
-
note
+ +

note

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.

The following example sets property ‘bar’ (a simple integer) in module ‘foo’ to value 1.

@@ -399,59 +434,50 @@ Defined in FT_MODULE_H (ftmodapi.h).
 

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.

It is not possible to set properties of the FreeType Cache sub-system itself with FT_Property_Set; use ?FTC_Property_Set? instead.

-
-
since
+ +

since

2.4.11

-
-
-
- - -
[Index][TOC]
- -
-

FT_Property_Get

-
-Defined in FT_MODULE_H (ftmodapi.h). -

-
 
+
+ + +
+

FT_Property_Get

+

Defined in FT_MODULE_H (ftmodapi.h).

+
   FT_EXPORT( FT_Error )
   FT_Property_Get( FT_Library        library,
                    const FT_String*  module_name,
                    const FT_String*  property_name,
                    void*             value );
+
-

-

Get a module's property value.

-

-
input
-

- -
library + +

input

+ + - -
library

A handle to the library the module is part of.

module_name +
module_name

The module name.

property_name +
property_name

The property name. Properties are described in the ‘Synopsis’ subsection of the module's documentation.

-
-
inout
-

- -
value + +

inout

+ +
value

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.

-
-
return
+ +

return

FreeType error code. 0 means success.

-
-
note
+ +

note

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.

The following example gets property ‘baz’ (a range) in module ‘foo’.

@@ -468,210 +494,118 @@ Defined in FT_MODULE_H (ftmodapi.h).
   FT_Property_Get( library, "foo", "baz", &baz );
 

It is not possible to retrieve properties of the FreeType Cache sub-system with FT_Property_Get; use ?FTC_Property_Get? instead.

-
-
since
-

2.4.11

-
-
-
- - -
[Index][TOC]
- -
-

FT_Reference_Library

-
-Defined in FT_MODULE_H (ftmodapi.h). -

-
 
-  FT_EXPORT( FT_Error )
-  FT_Reference_Library( FT_Library  library );
+

since

+

2.4.11

-

-
-

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.

-

This function helps in managing life-cycles of structures that reference FT_Library objects.

-

-
input
-

- - -
library -

A handle to a target library object.

-
-
-
return
-

FreeType error code. 0 means success.

-
-
since
-

2.4.2

-
-
-
- - -
[Index][TOC]
- -
-

FT_New_Library

-
-Defined in FT_MODULE_H (ftmodapi.h). -

-
+
+ +
+

FT_New_Library

+

Defined in FT_MODULE_H (ftmodapi.h).

+
   FT_EXPORT( FT_Error )
   FT_New_Library( FT_Memory    memory,
                   FT_Library  *alibrary );
+
-

-

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.

Normally, you would call this function (followed by a call to FT_Add_Default_Modules or a series of calls to FT_Add_Module) instead of FT_Init_FreeType to initialize the FreeType library.

Don't use FT_Done_FreeType but FT_Done_Library to destroy a library instance.

-

-
input
-

- -
memory + +

input

+ +
memory

A handle to the original memory object.

-
-
output
-

- -
alibrary + +

output

+ +
alibrary

A pointer to handle of a new library object.

-
-
return
+ +

return

FreeType error code. 0 means success.

-
-
note
+ +

note

See the discussion of reference counters in the description of FT_Reference_Library.

-
-
-
- - -
[Index][TOC]
- -
-

FT_Done_Library

-
-Defined in FT_MODULE_H (ftmodapi.h). -

-
 
+
+ + +
+

FT_Done_Library

+

Defined in FT_MODULE_H (ftmodapi.h).

+
   FT_EXPORT( FT_Error )
   FT_Done_Library( FT_Library  library );
+
-

-

Discard a given library object. This closes all drivers and discards all resource objects.

-

-
input
-

- -
library + +

input

+ +
library

A handle to the target library.

-
-
return
+ +

return

FreeType error code. 0 means success.

-
-
note
+ +

note

See the discussion of reference counters in the description of FT_Reference_Library.

-
-
-
- - -
[Index][TOC]
- -
-

FT_Set_Debug_Hook

-
-Defined in FT_MODULE_H (ftmodapi.h). -

-
 
-  FT_EXPORT( void )
-  FT_Set_Debug_Hook( FT_Library         library,
-                     FT_UInt            hook_index,
-                     FT_DebugHook_Func  debug_hook );
+
+ -

-
-

Set a debug hook function for debugging the interpreter of a font format.

-

-
inout
-

- - -
library -

A handle to the library object.

-
-
-
input
-

- - - -
hook_index -

The index of the debug hook. You should use the values defined in ‘ftobjs.h’, e.g., ‘FT_DEBUG_HOOK_TRUETYPE’.

-
debug_hook -

The function used to debug the interpreter.

-
-
-
note
-

Currently, four debug hook slots are available, but only two (for the TrueType and the Type 1 interpreter) are defined.

-

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.

-
-
-
- - -
[Index][TOC]
- -
-

FT_Add_Default_Modules

-
-Defined in FT_MODULE_H (ftmodapi.h). -

-
+
+

FT_Reference_Library

+

Defined in FT_MODULE_H (ftmodapi.h).

+
+  FT_EXPORT( FT_Error )
+  FT_Reference_Library( FT_Library  library );
+
- FT_EXPORT( void ) - FT_Add_Default_Modules( FT_Library library ); +

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.

+

This function helps in managing life-cycles of structures that reference FT_Library objects.

-

-
-

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).

-

-
inout
-

- -
library -

A handle to a new library object.

+

input

+ +
library +

A handle to a target library object.

-
-
-
- - -
[Index][TOC]
- -
-

FT_Renderer_Class

-
-Defined in FT_RENDER_H (ftrender.h). -

-
 
+

return

+

FreeType error code. 0 means success.

+ +

since

+

2.4.2

+ +
+ + +
+

FT_Renderer

+

Defined in FT_FREETYPE_H (freetype.h).

+
+  typedef struct FT_RendererRec_*  FT_Renderer;
+
+ +

A handle to a given FreeType renderer. A renderer is a special module in charge of converting a glyph image to a bitmap, when necessary. Each renderer supports a given glyph image format, and one or more target surface depths.

+ +
+
+ +
+

FT_Renderer_Class

+

Defined in FT_RENDER_H (ftrender.h).

+
   typedef struct  FT_Renderer_Class_
   {
     FT_Module_Class            root;
@@ -686,134 +620,160 @@ Defined in FT_RENDER_H (ftrender.h).
     FT_Raster_Funcs*           raster_class;
 
   } FT_Renderer_Class;
+
-

-

The renderer module class descriptor.

-

-
fields
-

- -
root + +

fields

+ + - - - - - -
root

The root FT_Module_Class fields.

glyph_format +
glyph_format

The glyph image format this renderer handles.

render_glyph +
render_glyph

A method used to render the image that is in a given glyph slot into a bitmap.

transform_glyph +
transform_glyph

A method used to transform the image that is in a given glyph slot.

get_glyph_cbox +
get_glyph_cbox

A method used to access the glyph's cbox.

set_mode +
set_mode

A method used to pass additional parameters.

raster_class +
raster_class

For FT_GLYPH_FORMAT_OUTLINE renderers only. This is a pointer to its raster's class.

-
-
-
- - -
[Index][TOC]
- -
-

FT_Get_Renderer

-
-Defined in FT_RENDER_H (ftrender.h). -

-
-
-  FT_EXPORT( FT_Renderer )
+
+
+ + +
+

FT_Get_Renderer

+

Defined in FT_RENDER_H (ftrender.h).

+
+  FT_EXPORT( FT_Renderer )
   FT_Get_Renderer( FT_Library       library,
                    FT_Glyph_Format  format );
+
-

-

Retrieve the current renderer for a given glyph format.

-

-
input
-

- -
library + +

input

+ + -
library

A handle to the library object.

format +
format

The glyph format.

-
-
return
+ +

return

A renderer handle. 0 if none found.

-
-
note
+ +

note

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.

To add a new renderer, simply use FT_Add_Module. To retrieve a renderer by its name, use FT_Get_Module.

-
-
-
- - -
[Index][TOC]
- -
-

FT_Set_Renderer

-
-Defined in FT_RENDER_H (ftrender.h). -

-
 
+
+ + +
+

FT_Set_Renderer

+

Defined in FT_RENDER_H (ftrender.h).

+
   FT_EXPORT( FT_Error )
   FT_Set_Renderer( FT_Library     library,
-                   FT_Renderer    renderer,
+                   FT_Renderer    renderer,
                    FT_UInt        num_params,
                    FT_Parameter*  parameters );
+
-

-

Set the current renderer to use, and set additional mode.

-

-
inout
-

- -
library + +

inout

+ +
library

A handle to the library object.

-
-
input
-

- -
renderer + +

input

+ + - -
renderer

A handle to the renderer object.

num_params +
num_params

The number of additional parameters.

parameters +
parameters

Additional parameters.

-
-
return
+ +

return

FreeType error code. 0 means success.

-
-
note
+ +

note

In case of success, the renderer will be used to convert glyph images in the renderer's known format into bitmaps.

This doesn't change the current renderer for other formats.

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.

-
-
-
- - -
[Index][TOC]
+ +
+ + +
+

FT_Set_Debug_Hook

+

Defined in FT_MODULE_H (ftmodapi.h).

+
+  FT_EXPORT( void )
+  FT_Set_Debug_Hook( FT_Library         library,
+                     FT_UInt            hook_index,
+                     FT_DebugHook_Func  debug_hook );
+
+ +

Set a debug hook function for debugging the interpreter of a font format.

+ +

inout

+ + +
library +

A handle to the library object.

+
+ +

input

+ + + +
hook_index +

The index of the debug hook. You should use the values defined in ‘ftobjs.h’, e.g., ‘FT_DEBUG_HOOK_TRUETYPE’.

+
debug_hook +

The function used to debug the interpreter.

+
+ +

note

+

Currently, four debug hook slots are available, but only two (for the TrueType and the Type 1 interpreter) are defined.

+

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.

+ +
+
+ +
+

FT_Driver

+

Defined in FT_FREETYPE_H (freetype.h).

+
+  typedef struct FT_DriverRec_*  FT_Driver;
+
+ +

A handle to a given FreeType font driver object. Each font driver is a special module capable of creating faces from font files.

+ +
+
-- cgit v1.2.3