nuclear@0: /***************************************************************************/ nuclear@0: /* */ nuclear@0: /* ftmodapi.h */ nuclear@0: /* */ nuclear@0: /* FreeType modules public interface (specification). */ nuclear@0: /* */ nuclear@0: /* Copyright 1996-2001, 2002, 2003, 2006, 2008, 2009, 2010 by */ nuclear@0: /* David Turner, Robert Wilhelm, and Werner Lemberg. */ nuclear@0: /* */ nuclear@0: /* This file is part of the FreeType project, and may only be used, */ nuclear@0: /* modified, and distributed under the terms of the FreeType project */ nuclear@0: /* license, LICENSE.TXT. By continuing to use, modify, or distribute */ nuclear@0: /* this file you indicate that you have read the license and */ nuclear@0: /* understand and accept it fully. */ nuclear@0: /* */ nuclear@0: /***************************************************************************/ nuclear@0: nuclear@0: nuclear@0: #ifndef __FTMODAPI_H__ nuclear@0: #define __FTMODAPI_H__ nuclear@0: nuclear@0: nuclear@0: #include nuclear@0: #include FT_FREETYPE_H nuclear@0: nuclear@0: #ifdef FREETYPE_H nuclear@0: #error "freetype.h of FreeType 1 has been loaded!" nuclear@0: #error "Please fix the directory search order for header files" nuclear@0: #error "so that freetype.h of FreeType 2 is found first." nuclear@0: #endif nuclear@0: nuclear@0: nuclear@0: FT_BEGIN_HEADER nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /*
*/ nuclear@0: /* module_management */ nuclear@0: /* */ nuclear@0: /* */ nuclear@0: /* Module Management */ nuclear@0: /* */ nuclear@0: /* <Abstract> */ nuclear@0: /* How to add, upgrade, and remove modules from FreeType. */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* The definitions below are used to manage modules within FreeType. */ nuclear@0: /* Modules can be added, upgraded, and removed at runtime. */ nuclear@0: /* */ nuclear@0: /*************************************************************************/ nuclear@0: nuclear@0: nuclear@0: /* module bit flags */ nuclear@0: #define FT_MODULE_FONT_DRIVER 1 /* this module is a font driver */ nuclear@0: #define FT_MODULE_RENDERER 2 /* this module is a renderer */ nuclear@0: #define FT_MODULE_HINTER 4 /* this module is a glyph hinter */ nuclear@0: #define FT_MODULE_STYLER 8 /* this module is a styler */ nuclear@0: nuclear@0: #define FT_MODULE_DRIVER_SCALABLE 0x100 /* the driver supports */ nuclear@0: /* scalable fonts */ nuclear@0: #define FT_MODULE_DRIVER_NO_OUTLINES 0x200 /* the driver does not */ nuclear@0: /* support vector outlines */ nuclear@0: #define FT_MODULE_DRIVER_HAS_HINTER 0x400 /* the driver provides its */ nuclear@0: /* own hinter */ nuclear@0: nuclear@0: nuclear@0: /* deprecated values */ nuclear@0: #define ft_module_font_driver FT_MODULE_FONT_DRIVER nuclear@0: #define ft_module_renderer FT_MODULE_RENDERER nuclear@0: #define ft_module_hinter FT_MODULE_HINTER nuclear@0: #define ft_module_styler FT_MODULE_STYLER nuclear@0: nuclear@0: #define ft_module_driver_scalable FT_MODULE_DRIVER_SCALABLE nuclear@0: #define ft_module_driver_no_outlines FT_MODULE_DRIVER_NO_OUTLINES nuclear@0: #define ft_module_driver_has_hinter FT_MODULE_DRIVER_HAS_HINTER nuclear@0: nuclear@0: nuclear@0: typedef FT_Pointer FT_Module_Interface; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <FuncType> */ nuclear@0: /* FT_Module_Constructor */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* A function used to initialize (not create) a new module object. */ nuclear@0: /* */ nuclear@0: /* <Input> */ nuclear@0: /* module :: The module to initialize. */ nuclear@0: /* */ nuclear@0: typedef FT_Error nuclear@0: (*FT_Module_Constructor)( FT_Module module ); nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <FuncType> */ nuclear@0: /* FT_Module_Destructor */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* A function used to finalize (not destroy) a given module object. */ nuclear@0: /* */ nuclear@0: /* <Input> */ nuclear@0: /* module :: The module to finalize. */ nuclear@0: /* */ nuclear@0: typedef void nuclear@0: (*FT_Module_Destructor)( FT_Module module ); nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <FuncType> */ nuclear@0: /* FT_Module_Requester */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* A function used to query a given module for a specific interface. */ nuclear@0: /* */ nuclear@0: /* <Input> */ nuclear@0: /* module :: The module to finalize. */ nuclear@0: /* */ nuclear@0: /* name :: The name of the interface in the module. */ nuclear@0: /* */ nuclear@0: typedef FT_Module_Interface nuclear@0: (*FT_Module_Requester)( FT_Module module, nuclear@0: const char* name ); nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Struct> */ nuclear@0: /* FT_Module_Class */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* The module class descriptor. */ nuclear@0: /* */ nuclear@0: /* <Fields> */ nuclear@0: /* module_flags :: Bit flags describing the module. */ nuclear@0: /* */ nuclear@0: /* module_size :: The size of one module object/instance in */ nuclear@0: /* bytes. */ nuclear@0: /* */ nuclear@0: /* module_name :: The name of the module. */ nuclear@0: /* */ nuclear@0: /* module_version :: The version, as a 16.16 fixed number */ nuclear@0: /* (major.minor). */ nuclear@0: /* */ nuclear@0: /* module_requires :: The version of FreeType this module requires, */ nuclear@0: /* as a 16.16 fixed number (major.minor). Starts */ nuclear@0: /* at version 2.0, i.e., 0x20000. */ nuclear@0: /* */ nuclear@0: /* module_init :: The initializing function. */ nuclear@0: /* */ nuclear@0: /* module_done :: The finalizing function. */ nuclear@0: /* */ nuclear@0: /* get_interface :: The interface requesting function. */ nuclear@0: /* */ nuclear@0: typedef struct FT_Module_Class_ nuclear@0: { nuclear@0: FT_ULong module_flags; nuclear@0: FT_Long module_size; nuclear@0: const FT_String* module_name; nuclear@0: FT_Fixed module_version; nuclear@0: FT_Fixed module_requires; nuclear@0: nuclear@0: const void* module_interface; nuclear@0: nuclear@0: FT_Module_Constructor module_init; nuclear@0: FT_Module_Destructor module_done; nuclear@0: FT_Module_Requester get_interface; nuclear@0: nuclear@0: } FT_Module_Class; nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Function> */ nuclear@0: /* FT_Add_Module */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* Add a new module to a given library instance. */ nuclear@0: /* */ nuclear@0: /* <InOut> */ nuclear@0: /* library :: A handle to the library object. */ nuclear@0: /* */ nuclear@0: /* <Input> */ nuclear@0: /* clazz :: A pointer to class descriptor for the module. */ nuclear@0: /* */ nuclear@0: /* <Return> */ nuclear@0: /* FreeType error code. 0~means success. */ nuclear@0: /* */ nuclear@0: /* <Note> */ nuclear@0: /* An error will be returned if a module already exists by that name, */ nuclear@0: /* or if the module requires a version of FreeType that is too great. */ nuclear@0: /* */ nuclear@0: FT_EXPORT( FT_Error ) nuclear@0: FT_Add_Module( FT_Library library, nuclear@0: const FT_Module_Class* clazz ); nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Function> */ nuclear@0: /* FT_Get_Module */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* Find a module by its name. */ nuclear@0: /* */ nuclear@0: /* <Input> */ nuclear@0: /* library :: A handle to the library object. */ nuclear@0: /* */ nuclear@0: /* module_name :: The module's name (as an ASCII string). */ nuclear@0: /* */ nuclear@0: /* <Return> */ nuclear@0: /* A module handle. 0~if none was found. */ nuclear@0: /* */ nuclear@0: /* <Note> */ nuclear@0: /* FreeType's internal modules aren't documented very well, and you */ nuclear@0: /* should look up the source code for details. */ nuclear@0: /* */ nuclear@0: FT_EXPORT( FT_Module ) nuclear@0: FT_Get_Module( FT_Library library, nuclear@0: const char* module_name ); nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Function> */ nuclear@0: /* FT_Remove_Module */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* Remove a given module from a library instance. */ nuclear@0: /* */ nuclear@0: /* <InOut> */ nuclear@0: /* library :: A handle to a library object. */ nuclear@0: /* */ nuclear@0: /* <Input> */ nuclear@0: /* module :: A handle to a module object. */ nuclear@0: /* */ nuclear@0: /* <Return> */ nuclear@0: /* FreeType error code. 0~means success. */ nuclear@0: /* */ nuclear@0: /* <Note> */ nuclear@0: /* The module object is destroyed by the function in case of success. */ nuclear@0: /* */ nuclear@0: FT_EXPORT( FT_Error ) nuclear@0: FT_Remove_Module( FT_Library library, nuclear@0: FT_Module module ); nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Function> */ nuclear@0: /* FT_Reference_Library */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* A counter gets initialized to~1 at the time an @FT_Library */ nuclear@0: /* structure is created. This function increments the counter. */ nuclear@0: /* @FT_Done_Library then only destroys a library if the counter is~1, */ nuclear@0: /* otherwise it simply decrements the counter. */ nuclear@0: /* */ nuclear@0: /* This function helps in managing life-cycles of structures which */ nuclear@0: /* reference @FT_Library objects. */ nuclear@0: /* */ nuclear@0: /* <Input> */ nuclear@0: /* library :: A handle to a target library object. */ nuclear@0: /* */ nuclear@0: /* <Return> */ nuclear@0: /* FreeType error code. 0~means success. */ nuclear@0: /* */ nuclear@0: /* <Since> */ nuclear@0: /* 2.4.2 */ nuclear@0: /* */ nuclear@0: FT_EXPORT( FT_Error ) nuclear@0: FT_Reference_Library( FT_Library library ); nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Function> */ nuclear@0: /* FT_New_Library */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* This function is used to create a new FreeType library instance */ nuclear@0: /* from a given memory object. It is thus possible to use libraries */ nuclear@0: /* with distinct memory allocators within the same program. */ nuclear@0: /* */ nuclear@0: /* Normally, you would call this function (followed by a call to */ nuclear@0: /* @FT_Add_Default_Modules or a series of calls to @FT_Add_Module) */ nuclear@0: /* instead of @FT_Init_FreeType to initialize the FreeType library. */ nuclear@0: /* */ nuclear@0: /* Don't use @FT_Done_FreeType but @FT_Done_Library to destroy a */ nuclear@0: /* library instance. */ nuclear@0: /* */ nuclear@0: /* <Input> */ nuclear@0: /* memory :: A handle to the original memory object. */ nuclear@0: /* */ nuclear@0: /* <Output> */ nuclear@0: /* alibrary :: A pointer to handle of a new library object. */ nuclear@0: /* */ nuclear@0: /* <Return> */ nuclear@0: /* FreeType error code. 0~means success. */ nuclear@0: /* */ nuclear@0: /* <Note> */ nuclear@0: /* See the discussion of reference counters in the description of */ nuclear@0: /* @FT_Reference_Library. */ nuclear@0: /* */ nuclear@0: FT_EXPORT( FT_Error ) nuclear@0: FT_New_Library( FT_Memory memory, nuclear@0: FT_Library *alibrary ); nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Function> */ nuclear@0: /* FT_Done_Library */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* Discard a given library object. This closes all drivers and */ nuclear@0: /* discards all resource objects. */ nuclear@0: /* */ nuclear@0: /* <Input> */ nuclear@0: /* library :: A handle to the target library. */ nuclear@0: /* */ nuclear@0: /* <Return> */ nuclear@0: /* FreeType error code. 0~means success. */ nuclear@0: /* */ nuclear@0: /* <Note> */ nuclear@0: /* See the discussion of reference counters in the description of */ nuclear@0: /* @FT_Reference_Library. */ nuclear@0: /* */ nuclear@0: FT_EXPORT( FT_Error ) nuclear@0: FT_Done_Library( FT_Library library ); nuclear@0: nuclear@0: /* */ nuclear@0: nuclear@0: typedef void nuclear@0: (*FT_DebugHook_Func)( void* arg ); nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Function> */ nuclear@0: /* FT_Set_Debug_Hook */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* Set a debug hook function for debugging the interpreter of a font */ nuclear@0: /* format. */ nuclear@0: /* */ nuclear@0: /* <InOut> */ nuclear@0: /* library :: A handle to the library object. */ nuclear@0: /* */ nuclear@0: /* <Input> */ nuclear@0: /* hook_index :: The index of the debug hook. You should use the */ nuclear@0: /* values defined in `ftobjs.h', e.g., */ nuclear@0: /* `FT_DEBUG_HOOK_TRUETYPE'. */ nuclear@0: /* */ nuclear@0: /* debug_hook :: The function used to debug the interpreter. */ nuclear@0: /* */ nuclear@0: /* <Note> */ nuclear@0: /* Currently, four debug hook slots are available, but only two (for */ nuclear@0: /* the TrueType and the Type~1 interpreter) are defined. */ nuclear@0: /* */ nuclear@0: /* Since the internal headers of FreeType are no longer installed, */ nuclear@0: /* the symbol `FT_DEBUG_HOOK_TRUETYPE' isn't available publicly. */ nuclear@0: /* This is a bug and will be fixed in a forthcoming release. */ nuclear@0: /* */ nuclear@0: FT_EXPORT( void ) nuclear@0: FT_Set_Debug_Hook( FT_Library library, nuclear@0: FT_UInt hook_index, nuclear@0: FT_DebugHook_Func debug_hook ); nuclear@0: nuclear@0: nuclear@0: /*************************************************************************/ nuclear@0: /* */ nuclear@0: /* <Function> */ nuclear@0: /* FT_Add_Default_Modules */ nuclear@0: /* */ nuclear@0: /* <Description> */ nuclear@0: /* Add the set of default drivers to a given library object. */ nuclear@0: /* This is only useful when you create a library object with */ nuclear@0: /* @FT_New_Library (usually to plug a custom memory manager). */ nuclear@0: /* */ nuclear@0: /* <InOut> */ nuclear@0: /* library :: A handle to a new library object. */ nuclear@0: /* */ nuclear@0: FT_EXPORT( void ) nuclear@0: FT_Add_Default_Modules( FT_Library library ); nuclear@0: nuclear@0: nuclear@0: nuclear@0: /************************************************************************** nuclear@0: * nuclear@0: * @section: nuclear@0: * truetype_engine nuclear@0: * nuclear@0: * @title: nuclear@0: * The TrueType Engine nuclear@0: * nuclear@0: * @abstract: nuclear@0: * TrueType bytecode support. nuclear@0: * nuclear@0: * @description: nuclear@0: * This section contains a function used to query the level of TrueType nuclear@0: * bytecode support compiled in this version of the library. nuclear@0: * nuclear@0: */ nuclear@0: nuclear@0: nuclear@0: /************************************************************************** nuclear@0: * nuclear@0: * @enum: nuclear@0: * FT_TrueTypeEngineType nuclear@0: * nuclear@0: * @description: nuclear@0: * A list of values describing which kind of TrueType bytecode nuclear@0: * engine is implemented in a given FT_Library instance. It is used nuclear@0: * by the @FT_Get_TrueType_Engine_Type function. nuclear@0: * nuclear@0: * @values: nuclear@0: * FT_TRUETYPE_ENGINE_TYPE_NONE :: nuclear@0: * The library doesn't implement any kind of bytecode interpreter. nuclear@0: * nuclear@0: * FT_TRUETYPE_ENGINE_TYPE_UNPATENTED :: nuclear@0: * The library implements a bytecode interpreter that doesn't nuclear@0: * support the patented operations of the TrueType virtual machine. nuclear@0: * nuclear@0: * Its main use is to load certain Asian fonts which position and nuclear@0: * scale glyph components with bytecode instructions. It produces nuclear@0: * bad output for most other fonts. nuclear@0: * nuclear@0: * FT_TRUETYPE_ENGINE_TYPE_PATENTED :: nuclear@0: * The library implements a bytecode interpreter that covers nuclear@0: * the full instruction set of the TrueType virtual machine (this nuclear@0: * was governed by patents until May 2010, hence the name). nuclear@0: * nuclear@0: * @since: nuclear@0: * 2.2 nuclear@0: * nuclear@0: */ nuclear@0: typedef enum FT_TrueTypeEngineType_ nuclear@0: { nuclear@0: FT_TRUETYPE_ENGINE_TYPE_NONE = 0, nuclear@0: FT_TRUETYPE_ENGINE_TYPE_UNPATENTED, nuclear@0: FT_TRUETYPE_ENGINE_TYPE_PATENTED nuclear@0: nuclear@0: } FT_TrueTypeEngineType; nuclear@0: nuclear@0: nuclear@0: /************************************************************************** nuclear@0: * nuclear@0: * @func: nuclear@0: * FT_Get_TrueType_Engine_Type nuclear@0: * nuclear@0: * @description: nuclear@0: * Return an @FT_TrueTypeEngineType value to indicate which level of nuclear@0: * the TrueType virtual machine a given library instance supports. nuclear@0: * nuclear@0: * @input: nuclear@0: * library :: nuclear@0: * A library instance. nuclear@0: * nuclear@0: * @return: nuclear@0: * A value indicating which level is supported. nuclear@0: * nuclear@0: * @since: nuclear@0: * 2.2 nuclear@0: * nuclear@0: */ nuclear@0: FT_EXPORT( FT_TrueTypeEngineType ) nuclear@0: FT_Get_TrueType_Engine_Type( FT_Library library ); nuclear@0: nuclear@0: nuclear@0: /* */ nuclear@0: nuclear@0: nuclear@0: FT_END_HEADER nuclear@0: nuclear@0: #endif /* __FTMODAPI_H__ */ nuclear@0: nuclear@0: nuclear@0: /* END */