w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

ftmodapi.h File Reference
#include <freetype/freetype.h>
Include dependency graph for ftmodapi.h:

Go to the source code of this file.

Classes

struct  FT_Module_Class_
 

Macros

#define FT_MODULE_FONT_DRIVER   1 /* this module is a font driver */
 
#define FT_MODULE_RENDERER   2 /* this module is a renderer */
 
#define FT_MODULE_HINTER   4 /* this module is a glyph hinter */
 
#define FT_MODULE_STYLER   8 /* this module is a styler */
 
#define FT_MODULE_DRIVER_SCALABLE   0x100 /* the driver supports */
 
#define FT_MODULE_DRIVER_NO_OUTLINES   0x200 /* the driver does not */
 
#define FT_MODULE_DRIVER_HAS_HINTER   0x400 /* the driver provides its */
 
#define FT_MODULE_DRIVER_HINTS_LIGHTLY   0x800 /* the driver's hinter */
 
#define ft_module_font_driver   FT_MODULE_FONT_DRIVER
 
#define ft_module_renderer   FT_MODULE_RENDERER
 
#define ft_module_hinter   FT_MODULE_HINTER
 
#define ft_module_styler   FT_MODULE_STYLER
 
#define ft_module_driver_scalable   FT_MODULE_DRIVER_SCALABLE
 
#define ft_module_driver_no_outlines   FT_MODULE_DRIVER_NO_OUTLINES
 
#define ft_module_driver_has_hinter   FT_MODULE_DRIVER_HAS_HINTER
 
#define ft_module_driver_hints_lightly   FT_MODULE_DRIVER_HINTS_LIGHTLY
 
#define FT_DEBUG_HOOK_TRUETYPE   0
 

Typedefs

typedef FT_Pointer FT_Module_Interface
 
typedef FT_Error(* FT_Module_Constructor) (FT_Module module)
 
typedef void(* FT_Module_Destructor) (FT_Module module)
 
typedef FT_Module_Interface(* FT_Module_Requester) (FT_Module module, const char *name)
 
typedef struct FT_Module_Class_ FT_Module_Class
 
typedef FT_Error(* FT_DebugHook_Func) (void *arg)
 
typedef enum FT_TrueTypeEngineType_ FT_TrueTypeEngineType
 

Enumerations

enum  FT_TrueTypeEngineType_ {
  FT_TRUETYPE_ENGINE_TYPE_NONE = 0 , FT_TRUETYPE_ENGINE_TYPE_UNPATENTED , FT_TRUETYPE_ENGINE_TYPE_PATENTED , FT_TRUETYPE_ENGINE_TYPE_NONE = 0 ,
  FT_TRUETYPE_ENGINE_TYPE_UNPATENTED , FT_TRUETYPE_ENGINE_TYPE_PATENTED
}
 

Functions

 FT_Add_Module (FT_Library library, const FT_Module_Class *clazz)
 
 FT_Get_Module (FT_Library library, const char *module_name)
 
 FT_Remove_Module (FT_Library library, FT_Module module)
 
 FT_Property_Set (FT_Library library, const FT_String *module_name, const FT_String *property_name, const void *value)
 
 FT_Property_Get (FT_Library library, const FT_String *module_name, const FT_String *property_name, void *value)
 
 FT_Set_Default_Properties (FT_Library library)
 
 FT_Reference_Library (FT_Library library)
 
 FT_New_Library (FT_Memory memory, FT_Library *alibrary)
 
 FT_Done_Library (FT_Library library)
 
 FT_Set_Debug_Hook (FT_Library library, FT_UInt hook_index, FT_DebugHook_Func debug_hook)
 
 FT_Add_Default_Modules (FT_Library library)
 
 FT_Get_TrueType_Engine_Type (FT_Library library)
 

Macro Definition Documentation

◆ FT_DEBUG_HOOK_TRUETYPE

#define FT_DEBUG_HOOK_TRUETYPE   0

Definition at line 641 of file ftmodapi.h.

◆ FT_MODULE_DRIVER_HAS_HINTER

#define FT_MODULE_DRIVER_HAS_HINTER   0x400 /* the driver provides its */

Definition at line 118 of file ftmodapi.h.

◆ ft_module_driver_has_hinter

#define ft_module_driver_has_hinter   FT_MODULE_DRIVER_HAS_HINTER

Definition at line 132 of file ftmodapi.h.

◆ FT_MODULE_DRIVER_HINTS_LIGHTLY

#define FT_MODULE_DRIVER_HINTS_LIGHTLY   0x800 /* the driver's hinter */

Definition at line 120 of file ftmodapi.h.

◆ ft_module_driver_hints_lightly

#define ft_module_driver_hints_lightly   FT_MODULE_DRIVER_HINTS_LIGHTLY

Definition at line 133 of file ftmodapi.h.

◆ FT_MODULE_DRIVER_NO_OUTLINES

#define FT_MODULE_DRIVER_NO_OUTLINES   0x200 /* the driver does not */

Definition at line 116 of file ftmodapi.h.

◆ ft_module_driver_no_outlines

#define ft_module_driver_no_outlines   FT_MODULE_DRIVER_NO_OUTLINES

Definition at line 131 of file ftmodapi.h.

◆ FT_MODULE_DRIVER_SCALABLE

#define FT_MODULE_DRIVER_SCALABLE   0x100 /* the driver supports */

Definition at line 114 of file ftmodapi.h.

◆ ft_module_driver_scalable

#define ft_module_driver_scalable   FT_MODULE_DRIVER_SCALABLE

Definition at line 130 of file ftmodapi.h.

◆ FT_MODULE_FONT_DRIVER

#define FT_MODULE_FONT_DRIVER   1 /* this module is a font driver */

ftmodapi.h

FreeType modules public interface (specification).

Copyright (C) 1996-2020 by David Turner, Robert Wilhelm, and Werner Lemberg.

This file is part of the FreeType project, and may only be used, modified, and distributed under the terms of the FreeType project license, LICENSE.TXT. By continuing to use, modify, or distribute this file you indicate that you have read the license and understand and accept it fully.

Definition at line 109 of file ftmodapi.h.

◆ ft_module_font_driver

#define ft_module_font_driver   FT_MODULE_FONT_DRIVER

Definition at line 125 of file ftmodapi.h.

◆ FT_MODULE_HINTER

#define FT_MODULE_HINTER   4 /* this module is a glyph hinter */

Definition at line 111 of file ftmodapi.h.

◆ ft_module_hinter

#define ft_module_hinter   FT_MODULE_HINTER

Definition at line 127 of file ftmodapi.h.

◆ FT_MODULE_RENDERER

#define FT_MODULE_RENDERER   2 /* this module is a renderer */

Definition at line 110 of file ftmodapi.h.

◆ ft_module_renderer

#define ft_module_renderer   FT_MODULE_RENDERER

Definition at line 126 of file ftmodapi.h.

◆ FT_MODULE_STYLER

#define FT_MODULE_STYLER   8 /* this module is a styler */

Definition at line 112 of file ftmodapi.h.

◆ ft_module_styler

#define ft_module_styler   FT_MODULE_STYLER

Definition at line 128 of file ftmodapi.h.

Typedef Documentation

◆ FT_DebugHook_Func

typedef FT_Error(* FT_DebugHook_Func) (void *arg)

@functype: FT_DebugHook_Func

@description: A drop-in replacement (or rather a wrapper) for the bytecode or charstring interpreter's main loop function.

Its job is essentially

  • to activate debug mode to enforce single-stepping,
  • to call the main loop function to interpret the next opcode, and
  • to show the changed context to the user.

An example for such a main loop function is TT_RunIns (declared in FreeType's internal header file src/truetype/ttinterp.h).

Have a look at the source code of the ttdebug FreeType demo program for an example of a drop-in replacement.

@inout: arg :: A typeless pointer, to be cast to the main loop function's data structure (which depends on the font module). For TrueType fonts it is bytecode interpreter's execution context, TT_ExecContext, which is declared in FreeType's internal header file tttypes.h.

Definition at line 625 of file ftmodapi.h.

◆ FT_Module_Class

◆ FT_Module_Constructor

typedef FT_Error(* FT_Module_Constructor) (FT_Module module)

@functype: FT_Module_Constructor

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

@input: module :: The module to initialize.

Definition at line 151 of file ftmodapi.h.

◆ FT_Module_Destructor

typedef void(* FT_Module_Destructor) (FT_Module module)

@functype: FT_Module_Destructor

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

@input: module :: The module to finalize.

Definition at line 167 of file ftmodapi.h.

◆ FT_Module_Interface

Definition at line 136 of file ftmodapi.h.

◆ FT_Module_Requester

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

@functype: FT_Module_Requester

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

@input: module :: The module to be searched.

name :: The name of the interface in the module.

Definition at line 186 of file ftmodapi.h.

◆ FT_TrueTypeEngineType

Enumeration Type Documentation

◆ FT_TrueTypeEngineType_

Enumerator
FT_TRUETYPE_ENGINE_TYPE_NONE 
FT_TRUETYPE_ENGINE_TYPE_UNPATENTED 
FT_TRUETYPE_ENGINE_TYPE_PATENTED 
FT_TRUETYPE_ENGINE_TYPE_NONE 
FT_TRUETYPE_ENGINE_TYPE_UNPATENTED 
FT_TRUETYPE_ENGINE_TYPE_PATENTED 

Definition at line 744 of file ftmodapi.h.

Function Documentation

◆ FT_Add_Default_Modules()

FT_Add_Default_Modules ( FT_Library  library)

@function: FT_Add_Default_Modules

@description: 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.

Definition at line 80 of file ftinit.c.

References cur, error, FT_Add_Module(), ft_default_modules, FT_TRACE0, and library.

◆ FT_Add_Module()

FT_Add_Module ( FT_Library  library,
const FT_Module_Class clazz 
)

@function: FT_Add_Module

@description: Add a new module to a given library instance.

@inout: library :: A handle to the library object.

@input: clazz :: A pointer to class descriptor for the module.

Returns
: FreeType error code. 0~means success.
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.

Definition at line 4871 of file ftobjs.c.

References FT_LibraryRec_::auto_hinter, FT_RendererRec_::clazz, FT_DriverRec_::clazz, error, Exit(), FREETYPE_VER_FIXED, ft_add_renderer(), FT_ALLOC, FT_DRIVER, FT_Err_Ok, FT_FREE, FT_GLYPH_FORMAT_OUTLINE, FT_MAX_MODULES, FT_MODULE_IS_DRIVER, FT_MODULE_IS_HINTER, FT_MODULE_IS_RENDERER, FT_Remove_Module(), FT_RENDERER, ft_strcmp, FT_THROW, FT_Renderer_Class_::glyph_format, library, FT_LibraryRec_::memory, FT_LibraryRec_::modules, nn, NULL, FT_LibraryRec_::num_modules, FT_RendererRec_::raster, FT_Renderer_Class_::raster_class, and FT_Raster_Funcs_::raster_done.

Referenced by FT_Add_Default_Modules().

◆ FT_Done_Library()

FT_Done_Library ( FT_Library  library)

@function: FT_Done_Library

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

@input: library :: A handle to the target library.

Returns
: FreeType error code. 0~means success.
Note
: See the discussion of reference counters in the description of @FT_Reference_Library.

Definition at line 5353 of file ftobjs.c.

References FT_ListNodeRec_::data, Destroy_Module(), Exit(), FT_Done_Face(), FT_DRIVER, FT_Err_Ok, FT_FACE, FT_FREE, FT_MODULE_FONT_DRIVER, FT_Remove_Module(), ft_strcmp, FT_THROW, FT_TRACE0, FT_TRACE7, FT_ListRec_::head, library, m, FT_LibraryRec_::memory, FT_LibraryRec_::modules, n, NULL, FT_LibraryRec_::num_modules, and FT_LibraryRec_::refcount.

Referenced by FT_Done_FreeType().

◆ FT_Get_Module()

FT_Get_Module ( FT_Library  library,
const char *  module_name 
)

@function: FT_Get_Module

@description: Find a module by its name.

@input: library :: A handle to the library object.

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

Returns
: A module handle. 0~if none was found.
Note
: FreeType's internal modules aren't documented very well, and you should look up the source code for details.

Definition at line 4984 of file ftobjs.c.

References cur, ft_strcmp, library, limit, FT_LibraryRec_::modules, NULL, FT_LibraryRec_::num_modules, and check-static-inits::result.

Referenced by cff_get_glyph_name(), cff_get_interface(), cff_get_name_index(), cff_size_get_globals_funcs(), cff_slot_init(), cid_size_get_globals_funcs(), cid_slot_init(), FT_DEFINE_SERVICE_PSINFOREC(), if(), sfnt_init_face(), T1_GlyphSlot_Init(), T1_Size_Get_Globals_Funcs(), T42_Driver_Init(), T42_Face_Init(), and tt_get_interface().

◆ FT_Get_TrueType_Engine_Type()

FT_Get_TrueType_Engine_Type ( FT_Library  library)

@function: FT_Get_TrueType_Engine_Type

@description: Return an @FT_TrueTypeEngineType value to indicate which level of the TrueType virtual machine a given library instance supports.

@input: library :: A library instance.

Returns
: A value indicating which level is supported.
Since
: 2.2

Definition at line 5470 of file ftobjs.c.

References FT_Get_Module(), ft_module_get_service(), FT_SERVICE_ID_TRUETYPE_ENGINE, FT_TRUETYPE_ENGINE_TYPE_NONE, library, and check-static-inits::result.

◆ FT_New_Library()

FT_New_Library ( FT_Memory  memory,
FT_Library alibrary 
)

@function: FT_New_Library

@description: 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 @FT_Memory structure is expected to remain valid for the life of the @FT_Library object.

Normally, you would call this function (followed by a call to @FT_Add_Default_Modules or a series of calls to @FT_Add_Module, and a call to @FT_Set_Default_Properties) 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 :: A handle to the original memory object.

@output: alibrary :: A pointer to handle of a new library object.

Returns
: FreeType error code. 0~means success.
Note
: See the discussion of reference counters in the description of @FT_Reference_Library.

Definition at line 5285 of file ftobjs.c.

References error, FREETYPE_MAJOR, FREETYPE_MINOR, FREETYPE_PATCH, ft_debug_init(), FT_Err_Ok, FT_NEW, FT_THROW, library, FT_LibraryRec_::memory, NULL, FT_LibraryRec_::refcount, FT_LibraryRec_::version_major, FT_LibraryRec_::version_minor, and FT_LibraryRec_::version_patch.

Referenced by FT_Init_FreeType().

◆ FT_Property_Get()

FT_Property_Get ( FT_Library  library,
const FT_String module_name,
const FT_String property_name,
void value 
)

@function: FT_Property_Get

@description: Get a module's property value.

@input: library :: A handle to the library the module is part of.

module_name :: The module name.

property_name :: The property name. Properties are described in section @properties.

@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 section @properties.

Returns
: FreeType error code. 0~means success.
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'.

typedef range_
{
FT_Int32 min;
FT_Int32 max;
range baz;
FT_Property_Get( library, "foo", "baz", &baz );
FT_Property_Get(FT_Library library, const FT_String *module_name, const FT_String *property_name, void *value)
Definition: ftobjs.c:5219
FT_Library library
Definition: cffdrivr.c:660
#define min(a, b)
Definition: pbmplus.h:223
#define max(a, b)
Definition: pbmto4425.c:11
@ range
Definition: preamble.c:52

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

Definition at line 5219 of file ftobjs.c.

References FALSE, ft_property_do(), and library.

◆ FT_Property_Set()

FT_Property_Set ( FT_Library  library,
const FT_String module_name,
const FT_String property_name,
const void value 
)

@function: FT_Property_Set

@description: Set a property for a given module.

@input: library :: A handle to the library the module is part of.

module_name :: The module name.

property_name :: The property name. Properties are described in section @properties.

Note that only a few modules have properties.

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 section @properties.

Returns
: FreeType error code. 0~means success.
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.

FT_UInt bar;
bar = 1;
FT_Property_Set( library, "foo", "bar", &bar );
FT_Property_Set(FT_Library library, const FT_String *module_name, const FT_String *property_name, const void *value)
Definition: ftobjs.c:5202
unsigned int FT_UInt
Definition: fttypes.h:231

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
: 2.4.11
Examples
/dev/shm/warix/file_cache/windows/misc/w32tex-src.tar.xz/ktx/libs/freetype/include/freetype/ftdriver.h, and /dev/shm/warix/file_cache/windows/misc/w32tex-src.tar.xz/ptx/libs/freetype/include/freetype/ftdriver.h.

Definition at line 5202 of file ftobjs.c.

References FALSE, ft_property_do(), library, and TRUE.

◆ FT_Reference_Library()

FT_Reference_Library ( FT_Library  library)

@function: FT_Reference_Library

@description: 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.

Returns
: FreeType error code. 0~means success.
Since
: 2.4.2

Definition at line 5271 of file ftobjs.c.

References FT_Err_Ok, FT_THROW, library, and FT_LibraryRec_::refcount.

◆ FT_Remove_Module()

FT_Remove_Module ( FT_Library  library,
FT_Module  module 
)

@function: FT_Remove_Module

@description: Remove a given module from a library instance.

@inout: library :: A handle to a library object.

@input: module :: A handle to a module object.

Returns
: FreeType error code. 0~means success.
Note
: The module object is destroyed by the function in case of success.

Definition at line 5074 of file ftobjs.c.

References cur, Destroy_Module(), FT_Err_Ok, FT_THROW, library, limit, FT_LibraryRec_::modules, NULL, and FT_LibraryRec_::num_modules.

◆ FT_Set_Debug_Hook()

FT_Set_Debug_Hook ( FT_Library  library,
FT_UInt  hook_index,
FT_DebugHook_Func  debug_hook 
)

@function: FT_Set_Debug_Hook

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

While this is a public API function, an application needs access to FreeType's internal header files to do something useful.

Have a look at the source code of the ttdebug FreeType demo program for an example of its usage.

@inout: library :: A handle to the library object.

@input: hook_index :: The index of the debug hook. You should use defined enumeration macros like @FT_DEBUG_HOOK_TRUETYPE.

debug_hook :: The function used to debug the interpreter.

Note
: Currently, four debug hook slots are available, but only one (for the TrueType interpreter) is defined.

Definition at line 5456 of file ftobjs.c.

References FT_LibraryRec_::debug_hooks, library, and sizeof().

◆ FT_Set_Default_Properties()

FT_Set_Default_Properties ( FT_Library  library)

@function: FT_Set_Default_Properties

@description: If compilation option FT_CONFIG_OPTION_ENVIRONMENT_PROPERTIES is set, this function reads the FREETYPE_PROPERTIES environment variable to control driver properties. See section @properties for more.

If the compilation option is not set, this function does nothing.

FREETYPE_PROPERTIES has the following syntax form (broken here into multiple lines for better readability).

<optional whitespace>
<module-name1> ':'
<property-name1> '=' <property-value1>
<module-name2> ':'
<property-name2> '=' <property-value2>
...
static void whitespace(void)
Definition: gsftopk.c:1466
Definition: obx.h:117

Example:

FREETYPE_PROPERTIES=truetype:interpreter-version=35 \
cff:no-stem-darkening=0 \
autofitter:warping=1
#define version
Definition: nup.c:10
word interpreter
static char no[99]
Definition: scanid.c:41
Definition: type1.c:137

@inout: library :: A handle to a new library object.

Since
: 2.8

Definition at line 188 of file ftinit.c.

References FT_UNUSED, and library.