Formatting.

Synchronizing docs.
This commit is contained in:
Werner Lemberg 2000-07-10 21:41:32 +00:00
parent e208f4e020
commit 93ac3e3985
6 changed files with 409 additions and 329 deletions

View File

@ -2,20 +2,20 @@
/* */ /* */
/* ftmm.h */ /* ftmm.h */
/* */ /* */
/* FreeType Multiple-Master interface. */ /* FreeType Multiple Master font interface. */
/* */
/* */ /* */
/* Copyright 1996-2000 by */ /* Copyright 1996-2000 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used */ /* This file is part of the FreeType project, and may only be used, */
/* modified and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
#ifndef FTMM_H #ifndef FTMM_H
#define FTMM_H #define FTMM_H
@ -25,21 +25,23 @@
extern "C" { extern "C" {
#endif #endif
/**********************************************************************
* /*************************************************************************/
* <Struct> /* */
* FT_MM_Axis /* <Struct> */
* /* FT_MM_Axis */
* <Description> /* */
* A simple structure used to model a given axis in design space /* <Description> */
* for multiple masters fonts.. /* A simple structure used to model a given axis in design space for */
* /* Multiple Masters fonts. */
* <Fields> /* */
* name :: axis' name /* <Fields> */
* minimum :: axis' minimum design coordinate /* name :: The axis's name. */
* maximum :: axis's maximum design coordinate /* */
* /* minimum :: The axis's minimum design coordinate. */
*/ /* */
/* maximum :: The axis's maximum design coordinate. */
/* */
typedef struct FT_MM_Axis_ typedef struct FT_MM_Axis_
{ {
FT_String* name; FT_String* name;
@ -48,26 +50,26 @@
} FT_MM_Axis; } FT_MM_Axis;
/**********************************************************************
* /*************************************************************************/
* <Struct> /* */
* FT_Multi_Master /* <Struct> */
* /* FT_Multi_Master */
* <Description> /* */
* A structure used to model the axis and space of a multiple /* <Description> */
* masters font. /* A structure used to model the axes and space of a Multiple Masters */
* /* font. */
* <Fields> /* */
* num_axis :: number of axis. cannot exceed 4 /* <Fields> */
* /* num_axis :: Number of axes. Cannot exceed 4. */
* num_designs :: number of designs, should ne normally 2^num_axis /* */
* even though the Type 1 specification strangely /* num_designs :: Number of designs; should ne normally 2^num_axis */
* allows for intermediate designs to be present /* even though the Type 1 specification strangely */
* this number cannot exceed 16 /* allows for intermediate designs to be present. This */
* /* number cannot exceed 16. */
* axis :: an table of axis descriptors.. /* */
* /* axis :: A table of axis descriptors. */
*/ /* */
typedef struct FT_Multi_Master_ typedef struct FT_Multi_Master_
{ {
FT_UInt num_axis; FT_UInt num_axis;
@ -77,7 +79,8 @@
} FT_Multi_Master; } FT_Multi_Master;
typedef FT_Error (*FT_Get_MM_Func)( FT_Face face, FT_Multi_Master* master ); typedef FT_Error (*FT_Get_MM_Func)( FT_Face face,
FT_Multi_Master* master );
typedef FT_Error (*FT_Set_MM_Design_Func)( FT_Face face, typedef FT_Error (*FT_Set_MM_Design_Func)( FT_Face face,
FT_UInt num_coords, FT_UInt num_coords,
@ -87,77 +90,86 @@
FT_UInt num_coords, FT_UInt num_coords,
FT_Long* coords ); FT_Long* coords );
/*************************************************************************
* /*************************************************************************/
* <Function> /* */
* FT_Get_Multi_Master /* <Function> */
* /* FT_Get_Multi_Master */
* <Description> /* */
* Retrieves the multiple master descriptor of a given font /* <Description> */
* /* Retrieves the Multiple Master descriptor of a given font. */
* <Input> /* */
* face :: handle to source face /* <Input> */
* /* face :: A handle to the source face. */
* <Output> /* */
* master :: multiple masters descriptor /* <Output> */
* /* master :: The Multiple Masters descriptor. */
* <Return> /* */
* Error code. 0 means success. /* <Return> */
* /* FreeType error code. 0 means success. */
*/ /* */
FT_EXPORT_DEF( FT_Error ) FT_Get_Multi_Master( FT_Face face, FT_EXPORT_DEF( FT_Error ) FT_Get_Multi_Master( FT_Face face,
FT_Multi_Master* master ); FT_Multi_Master* master );
/************************************************************************* /*************************************************************************/
* /* */
* <Function> /* <Function> */
* FT_Set_MM_Design_Coordinates /* FT_Set_MM_Design_Coordinates */
* /* */
* <Description> /* <Description> */
* For multiple masters fonts, choose an interpolated font design /* For Multiple Masters fonts, choose an interpolated font design */
* through design coordinates /* through design coordinates. */
* /* */
* <Input> /* <Input> */
* face :: handle to source face /* face :: A handle to the source face. */
* num_coords :: number of design coordinates (must be equal to the /* */
* number of axis in the font). /* num_coords :: The number of design coordinates (must be equal to */
* coords :: design coordinates /* the number of axes in the font). */
* /* */
* <Return> /* coords :: The design coordinates. */
* Error code. 0 means success. /* */
* /* <Return> */
*/ /* FreeType error code. 0 means success. */
FT_EXPORT_DEF(FT_Error) FT_Set_MM_Design_Coordinates( FT_Face face, /* */
FT_EXPORT_DEF( FT_Error ) FT_Set_MM_Design_Coordinates(
FT_Face face,
FT_UInt num_coords, FT_UInt num_coords,
FT_Long* coords ); FT_Long* coords );
/*************************************************************************
* /*************************************************************************/
* <Function> /* */
* FT_Set_MM_Blend_Coordinates /* <Function> */
* /* FT_Set_MM_Blend_Coordinates */
* <Description> /* */
* For multiple masters fonts, choose an interpolated font design /* <Description> */
* through normalized blend coordinates /* For Multiple Masters fonts, choose an interpolated font design */
* /* through normalized blend coordinates. */
* <Input> /* */
* face :: handle to source face /* <Input> */
* num_coords :: number of design coordinates (must be equal to the /* face :: A handle to the source face. */
* number of axis in the font). /* */
* coords :: design coordinates (each one must be between 0 and 1.0) /* num_coords :: The number of design coordinates (must be equal to */
* /* the number of axes in the font). */
* <Return> /* */
* Error code. 0 means success. /* coords :: The design coordinates (each one must be between 0 */
* /* and 1.0). */
*/ /* */
FT_EXPORT_DEF(FT_Error) FT_Set_MM_Blend_Coordinates( FT_Face face, /* <Return> */
/* FreeType error code. 0 means success. */
/* */
FT_EXPORT_DEF( FT_Error ) FT_Set_MM_Blend_Coordinates(
FT_Face face,
FT_UInt num_coords, FT_UInt num_coords,
FT_Fixed* coords ); FT_Fixed* coords );
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
#endif /* FTMM_H */ #endif /* FTMM_H */
/* END */ /* END */

View File

@ -7,19 +7,21 @@
/* Copyright 1996-2000 by */ /* Copyright 1996-2000 by */
/* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */
/* */ /* */
/* This file is part of the FreeType project, and may only be used */ /* This file is part of the FreeType project, and may only be used, */
/* modified and distributed under the terms of the FreeType project */ /* modified, and distributed under the terms of the FreeType project */
/* license, LICENSE.TXT. By continuing to use, modify, or distribute */ /* license, LICENSE.TXT. By continuing to use, modify, or distribute */
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/***************************************************************************/ /***************************************************************************/
#ifndef FTMODULE_H #ifndef FTMODULE_H
#define FTMODULE_H #define FTMODULE_H
#include <freetype/freetype.h> #include <freetype/freetype.h>
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
@ -33,18 +35,18 @@
ft_module_hinter = 4, /* this module is a glyph hinter */ ft_module_hinter = 4, /* this module is a glyph hinter */
ft_module_styler = 8, /* this module is a styler */ ft_module_styler = 8, /* this module is a styler */
ft_module_driver_scalable = 0x100, /* the driver supports scalable fonts */ ft_module_driver_scalable = 0x100, /* the driver supports scalable */
ft_module_driver_no_outlines = 0x200, /* the driver does not support vector outlines */ /* fonts */
ft_module_driver_no_outlines = 0x200, /* the driver does not support */
ft_module_driver_has_hinter = 0x400 /* the driver provides its own hinter */ /* vector outlines */
ft_module_driver_has_hinter = 0x400 /* the driver provides its own */
/* hinter */
} FT_Module_Flags; } FT_Module_Flags;
typedef void (*FT_Module_Interface)( void ); typedef void (*FT_Module_Interface)( void );
typedef FT_Error (*FT_Module_Constructor)( FT_Module module ); typedef FT_Error (*FT_Module_Constructor)( FT_Module module );
typedef void (*FT_Module_Destructor)( FT_Module module ); typedef void (*FT_Module_Destructor)( FT_Module module );
@ -53,33 +55,37 @@
const char* name ); const char* name );
/************************************************************************* /*************************************************************************/
* /* */
* <Struct> /* <Struct> */
* FT_Module_Class /* FT_Module_Class */
* /* */
* <Description> /* <Description> */
* The module class descriptor. /* The module class descriptor. */
* /* */
* <Fields> /* <Fields> */
* module_flags :: bit flags describing the module /* module_flags :: Bit flags describing the module. */
* module_size :: size of one module object/instance in bytes /* */
* module_name :: name of the module /* module_size :: The size of one module object/instance in */
* module_version :: version, as a 16.16 fixed number (major.minor) /* bytes. */
* module_requires :: the version of FreeType this module requires /* */
* (starts at 2.0, a.k.a. 0x20000) /* module_name :: The name of the module. */
* /* */
* module_init :: a function used to initialise (not create) a /* module_version :: The version, as a 16.16 fixed number */
* new module object /* (major.minor). */
* /* */
* module_done :: a function used to finalise (not destroy) a /* module_requires :: The version of FreeType this module requires */
* given module object /* (starts at version 2.0, i.e 0x20000) */
* /* */
* get_interface :: queries a given module for a specific interface /* module_init :: A function used to initialize (not create) a */
* by name.. /* new module object. */
* /* */
*************************************************************************/ /* module_done :: A function used to finalize (not destroy) a */
/* given module object */
/* */
/* get_interface :: Queries a given module for a specific */
/* interface by name. */
/* */
typedef struct FT_Module_Class_ typedef struct FT_Module_Class_
{ {
FT_ULong module_flags; FT_ULong module_flags;
@ -97,170 +103,170 @@
} FT_Module_Class; } FT_Module_Class;
/*************************************************************************/
/************************************************************************* /* */
* /* <Function> */
* <Function> /* FT_Add_Module */
* FT_Add_Module /* */
* /* <Description> */
* <Description> /* Adds a new module to a given library instance. */
* Add a new module to a given library instance. /* */
* /* <Input> */
* <Input> /* library :: A handle to the library object. */
* library :: handle to library object /* */
* clazz :: pointer to class descriptor for the module /* clazz :: A pointer to class descriptor for the module. */
* /* */
* <Return> /* <Return> */
* Error code. 0 means success /* FreeType error code. 0 means success. */
* /* */
* <Note> /* <Note> */
* An error will be returned if a module already exists by that /* An error will be returned if a module already exists by that name, */
* name, or if the module requires a version of freetype that is /* or if the module requires a version of FreeType that is too great. */
* too great /* */
*
*************************************************************************/
FT_EXPORT_DEF( FT_Error ) FT_Add_Module( FT_Library library, FT_EXPORT_DEF( FT_Error ) FT_Add_Module( FT_Library library,
const FT_Module_Class* clazz ); const FT_Module_Class* clazz );
/************************************************************************* /*************************************************************************/
* /* */
* <Function> /* <Function> */
* FT_Get_Module /* FT_Get_Module */
* /* */
* <Description> /* <Description> */
* Find a module by its name. /* Finds a module by its name. */
* /* */
* <Input> /* <Input> */
* library :: handle to library object /* library :: A handle to the library object. */
* module_name :: the module's ASCII name. /* */
* /* module_name :: The module's name (as an ASCII string). */
* <Return> /* */
* Module handle, 0 if none was found. /* <Return> */
* /* A module handle. 0 if none was found. */
* <Note> /* */
* You'd better be familiar with FreeType internals to know which /* <Note> */
* module to look for :-) /* You should better be familiar with FreeType internals to know */
* /* which module to look for :-) */
*************************************************************************/ /* */
FT_EXPORT_DEF( FT_Module ) FT_Get_Module( FT_Library library, FT_EXPORT_DEF( FT_Module ) FT_Get_Module( FT_Library library,
const char* module_name ); const char* module_name );
/************************************************************************* /*************************************************************************/
* /* */
* <Function> /* <Function> */
* FT_Get_Module_Interface /* FT_Get_Module_Interface */
* /* */
* <Description> /* <Description> */
* Find a module and returns it's specific interface as a void* /* Finds a module and returns its specific interface as a typeless */
* /* pointer. */
* <Input> /* */
* library :: handle to library object /* <Input> */
* module_name :: the module's ASCII name. /* library :: A handle to the library object. */
* /* */
* <Return> /* module_name :: The module's name (as an ASCII string). */
* Module specific interface, if any /* */
* /* <Return> */
* <Note> /* A module-specific interface if available, 0 otherwise. */
* You'd better be familiar with FreeType internals to know which /* */
* module to look for, and what it's interface is :-) /* <Note> */
* /* You should better be familiar with FreeType internals to know */
*************************************************************************/ /* which module to look for, and what its interface is :-) */
/* */
FT_EXPORT_DEF(const void*) FT_Get_Module_Interface( FT_Library library, FT_EXPORT_DEF( const void* ) FT_Get_Module_Interface(
FT_Library library,
const char* mod_name ); const char* mod_name );
/*************************************************************************
*
* <Function>
* FT_Remove_Module
*
* <Description>
* Removes a given module from a library instance.
*
* <Input>
* library :: handle to library object
* module :: handle to module object
*
* <Return>
* Error code (module not listed)
*
* <Note>
* The module object is destroyed by the function in case of success
*
*************************************************************************/
/*************************************************************************/
/* */
/* <Function> */
/* FT_Remove_Module */
/* */
/* <Description> */
/* Removes a given module from a library instance. */
/* */
/* <Input> */
/* library :: A handle to a library object. */
/* */
/* module :: A handle to a module object. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
/* <Note> */
/* The module object is destroyed by the function in case of success. */
/* */
FT_EXPORT_DEF( FT_Error ) FT_Remove_Module( FT_Library library, FT_EXPORT_DEF( FT_Error ) FT_Remove_Module( FT_Library library,
FT_Module module ); FT_Module module );
/************************************************************************* /*************************************************************************/
* /* */
* <Function> /* <Function> */
* FT_New_Library /* FT_New_Library */
* /* */
* <Description> /* <Description> */
* Creates a new "virgin" library that uses a custom memory manager. /* This function is used to create a new FreeType library instance */
* The library has no registered driver, those can be added with a /* from a given memory object. It is thus possible to use libraries */
* call to FT_Add_Default_Modules /* with distinct memory allocators within the same program. */
* /* */
* <Input> /* <Input> */
* memory :: handle to custom memory manager /* memory :: A handle to the original memory object. */
* /* */
* <Output> /* <Output> */
* library :: handle to fresh new library object /* alibrary :: A pointer to handle of a new library object. */
* /* */
* <Return> /* <Return> */
* Error code (module not listed) /* FreeType error code. 0 means success. */
* /* */
*************************************************************************/
FT_EXPORT_DEF( FT_Error ) FT_New_Library( FT_Memory memory, FT_EXPORT_DEF( FT_Error ) FT_New_Library( FT_Memory memory,
FT_Library* library ); FT_Library* library );
/************************************************************************* /*************************************************************************/
* /* */
* <Function> /* <Function> */
* FT_Done_Library /* FT_Done_Library */
* /* */
* <Description> /* <Description> */
* Destroys a given library, and all child objects, except the /* Discards a given library object. This closes all drivers and */
* memory manager. /* discards all resource objects. */
* /* */
* <Input> /* <Input> */
* library :: handle to target library object /* library :: A handle to the target library. */
* /* */
* <Return> /* <Return> */
* Error code (module not listed) /* FreeType error code. 0 means success. */
* /* */
*************************************************************************/
FT_EXPORT_DEF( FT_Error ) FT_Done_Library( FT_Library library ); FT_EXPORT_DEF( FT_Error ) FT_Done_Library( FT_Library library );
/*************************************************************************
*
* <Function>
* FT_Set_Debug_Hook
*
* <Description>
* Used only by the TrueType debugger. This function is private and
* should never be called by normal applications..
*
* <Input>
* library :: handle to target library object
* hook_index :: hook index
* debug_hook :: debug hook functions
*
*************************************************************************/
typedef void (*FT_DebugHook_Func)( void* arg ); typedef void (*FT_DebugHook_Func)( void* arg );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Set_Debug_Hook */
/* */
/* <Description> */
/* Sets a debug hook function for debugging the interpreter of a font */
/* format. */
/* */
/* <Input> */
/* library :: A handle to the library object. */
/* */
/* 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. */
/* */
FT_EXPORT_DEF( void ) FT_Set_Debug_Hook( FT_Library library, FT_EXPORT_DEF( void ) FT_Set_Debug_Hook( FT_Library library,
FT_UInt hook_index, FT_UInt hook_index,
FT_DebugHook_Func debug_hook ); FT_DebugHook_Func debug_hook );
@ -273,11 +279,11 @@
/* FT_Add_Default_Modules */ /* FT_Add_Default_Modules */
/* */ /* */
/* <Description> */ /* <Description> */
/* Adds the set of default modules to a given library object. */ /* Adds the set of default drivers to a given library object. */
/* This is only useful when you create a library object with */ /* This is only useful when you create a library object with */
/* FT_New_Library (usually to plug a custom memory manager) */ /* FT_New_Library() (usually to plug a custom memory manager). */
/* */ /* */
/* <Input> */ /* <InOut> */
/* library :: A handle to a new library object. */ /* library :: A handle to a new library object. */
/* */ /* */
FT_EXPORT_DEF( void ) FT_Add_Default_Modules( FT_Library library ); FT_EXPORT_DEF( void ) FT_Add_Default_Modules( FT_Library library );

View File

@ -75,6 +75,8 @@ const FT_Module_Class* ft_default_modules[] =
/* */ /* */
/* <Description> */ /* <Description> */
/* Adds the set of default drivers to a given library object. */ /* Adds 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> */ /* <InOut> */
/* library :: A handle to a new library object. */ /* library :: A handle to a new library object. */

View File

@ -30,6 +30,23 @@
#define FT_COMPONENT trace_mm #define FT_COMPONENT trace_mm
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Multi_Master */
/* */
/* <Description> */
/* Retrieves the Multiple Master descriptor of a given font. */
/* */
/* <Input> */
/* face :: A handle to the source face. */
/* */
/* <Output> */
/* master :: The Multiple Masters descriptor. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
FT_EXPORT_FUNC( FT_Error ) FT_Get_Multi_Master( FT_Face face, FT_EXPORT_FUNC( FT_Error ) FT_Get_Multi_Master( FT_Face face,
FT_Multi_Master* master ) FT_Multi_Master* master )
{ {
@ -57,6 +74,26 @@
} }
/*************************************************************************/
/* */
/* <Function> */
/* FT_Set_MM_Design_Coordinates */
/* */
/* <Description> */
/* For Multiple Masters fonts, choose an interpolated font design */
/* through design coordinates. */
/* */
/* <Input> */
/* face :: A handle to the source face. */
/* */
/* num_coords :: The number of design coordinates (must be equal to */
/* the number of axes in the font). */
/* */
/* coords :: The design coordinates. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
FT_EXPORT_FUNC( FT_Error ) FT_Set_MM_Design_Coordinates( FT_EXPORT_FUNC( FT_Error ) FT_Set_MM_Design_Coordinates(
FT_Face face, FT_Face face,
FT_UInt num_coords, FT_UInt num_coords,
@ -86,6 +123,27 @@
} }
/*************************************************************************/
/* */
/* <Function> */
/* FT_Set_MM_Blend_Coordinates */
/* */
/* <Description> */
/* For Multiple Masters fonts, choose an interpolated font design */
/* through normalized blend coordinates. */
/* */
/* <Input> */
/* face :: A handle to the source face. */
/* */
/* num_coords :: The number of design coordinates (must be equal to */
/* the number of axes in the font). */
/* */
/* coords :: The design coordinates (each one must be between 0 */
/* and 1.0). */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
FT_EXPORT_FUNC( FT_Error ) FT_Set_MM_Blend_Coordinates( FT_EXPORT_FUNC( FT_Error ) FT_Set_MM_Blend_Coordinates(
FT_Face face, FT_Face face,
FT_UInt num_coords, FT_UInt num_coords,

View File

@ -2722,6 +2722,7 @@
/* */ /* */
/* <Input> */ /* <Input> */
/* library :: A handle to the library object. */ /* library :: A handle to the library object. */
/* */
/* clazz :: A pointer to class descriptor for the module. */ /* clazz :: A pointer to class descriptor for the module. */
/* */ /* */
/* <Return> */ /* <Return> */

View File

@ -131,6 +131,7 @@
{ {
FT_UInt nn; FT_UInt nn;
/* allocate the blend `private' and `font_info' dictionaries */ /* allocate the blend `private' and `font_info' dictionaries */
if ( ALLOC_ARRAY( blend->font_infos[1], num_designs, T1_FontInfo ) || if ( ALLOC_ARRAY( blend->font_infos[1], num_designs, T1_FontInfo ) ||
ALLOC_ARRAY( blend->privates[1], num_designs, T1_Private ) || ALLOC_ARRAY( blend->privates[1], num_designs, T1_Private ) ||
@ -1260,9 +1261,9 @@
index = Z1_ToInt( parser ); index = Z1_ToInt( parser );
/* make sure we get subr index and loop count in sync */ /* make sure we get subr index and loop count in sync -- */
/* in some cases, the dictionary count is simply the last */ /* in some cases, the dictionary count is simply the last */
/* subr index + 1, with possible holes in the table.. */ /* subr index + 1, with possible holes in the table */
if ( index > n ) if ( index > n )
n = index; n = index;