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 */
/* */
/* FreeType Multiple-Master interface. */
/* */
/* FreeType Multiple Master font interface. */
/* */
/* Copyright 1996-2000 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 */
/* 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. */
/* */
/***************************************************************************/
#ifndef FTMM_H
#define FTMM_H
@ -25,22 +25,24 @@
extern "C" {
#endif
/**********************************************************************
*
* <Struct>
* FT_MM_Axis
*
* <Description>
* A simple structure used to model a given axis in design space
* for multiple masters fonts..
*
* <Fields>
* name :: axis' name
* minimum :: axis' minimum design coordinate
* maximum :: axis's maximum design coordinate
*
*/
typedef struct FT_MM_Axis_
/*************************************************************************/
/* */
/* <Struct> */
/* FT_MM_Axis */
/* */
/* <Description> */
/* A simple structure used to model a given axis in design space for */
/* Multiple Masters fonts. */
/* */
/* <Fields> */
/* name :: The axis's name. */
/* */
/* minimum :: The axis's minimum design coordinate. */
/* */
/* maximum :: The axis's maximum design coordinate. */
/* */
typedef struct FT_MM_Axis_
{
FT_String* name;
FT_Long minimum;
@ -48,116 +50,126 @@
} FT_MM_Axis;
/**********************************************************************
*
* <Struct>
* FT_Multi_Master
*
* <Description>
* A structure used to model the axis and space of a multiple
* masters font.
*
* <Fields>
* num_axis :: number of axis. cannot exceed 4
*
* num_designs :: number of designs, should ne normally 2^num_axis
* even though the Type 1 specification strangely
* allows for intermediate designs to be present
* this number cannot exceed 16
*
* axis :: an table of axis descriptors..
*
*/
typedef struct FT_Multi_Master_
/*************************************************************************/
/* */
/* <Struct> */
/* FT_Multi_Master */
/* */
/* <Description> */
/* A structure used to model the axes and space of a Multiple Masters */
/* font. */
/* */
/* <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 */
/* allows for intermediate designs to be present. This */
/* number cannot exceed 16. */
/* */
/* axis :: A table of axis descriptors. */
/* */
typedef struct FT_Multi_Master_
{
FT_UInt num_axis;
FT_UInt num_designs;
FT_MM_Axis axis[ T1_MAX_MM_AXIS ];
FT_MM_Axis axis[T1_MAX_MM_AXIS];
} 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,
FT_UInt num_coords,
FT_Long* coords );
typedef FT_Error (*FT_Set_MM_Blend_Func)( FT_Face face,
typedef FT_Error (*FT_Set_MM_Design_Func)( FT_Face face,
FT_UInt num_coords,
FT_Long* coords );
/*************************************************************************
*
* <Function>
* FT_Get_Multi_Master
*
* <Description>
* Retrieves the multiple master descriptor of a given font
*
* <Input>
* face :: handle to source face
*
* <Output>
* master :: multiple masters descriptor
*
* <Return>
* Error code. 0 means success.
*
*/
FT_EXPORT_DEF(FT_Error) FT_Get_Multi_Master( FT_Face face,
FT_Multi_Master* master );
typedef FT_Error (*FT_Set_MM_Blend_Func)( FT_Face face,
FT_UInt num_coords,
FT_Long* coords );
/*************************************************************************
*
* <Function>
* FT_Set_MM_Design_Coordinates
*
* <Description>
* For multiple masters fonts, choose an interpolated font design
* through design coordinates
*
* <Input>
* face :: handle to source face
* num_coords :: number of design coordinates (must be equal to the
* number of axis in the font).
* coords :: design coordinates
*
* <Return>
* Error code. 0 means success.
*
*/
FT_EXPORT_DEF(FT_Error) FT_Set_MM_Design_Coordinates( FT_Face face,
FT_UInt num_coords,
FT_Long* coords );
/*************************************************************************/
/* */
/* <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_DEF( FT_Error ) FT_Get_Multi_Master( FT_Face face,
FT_Multi_Master* master );
/*************************************************************************/
/* */
/* <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_DEF( FT_Error ) FT_Set_MM_Design_Coordinates(
FT_Face face,
FT_UInt num_coords,
FT_Long* coords );
/*************************************************************************/
/* */
/* <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_DEF( FT_Error ) FT_Set_MM_Blend_Coordinates(
FT_Face face,
FT_UInt num_coords,
FT_Fixed* coords );
/*************************************************************************
*
* <Function>
* FT_Set_MM_Blend_Coordinates
*
* <Description>
* For multiple masters fonts, choose an interpolated font design
* through normalized blend coordinates
*
* <Input>
* face :: handle to source face
* num_coords :: number of design coordinates (must be equal to the
* number of axis in the font).
* coords :: design coordinates (each one must be between 0 and 1.0)
*
* <Return>
* Error code. 0 means success.
*
*/
FT_EXPORT_DEF(FT_Error) FT_Set_MM_Blend_Coordinates( FT_Face face,
FT_UInt num_coords,
FT_Fixed* coords );
#ifdef __cplusplus
}
#endif
#endif /* FTMM_H */
/* END */

View File

@ -2,84 +2,90 @@
/* */
/* ftmodule.h */
/* */
/* FreeType modules public interface. */
/* FreeType modules public interface. */
/* */
/* Copyright 1996-2000 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 */
/* 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. */
/* */
/***************************************************************************/
#ifndef FTMODULE_H
#define FTMODULE_H
#include <freetype/freetype.h>
#ifdef __cplusplus
extern "C" {
#endif
/* module bit flags */
typedef enum FT_Module_Flags_
typedef enum FT_Module_Flags_
{
ft_module_font_driver = 1, /* this module is a font driver */
ft_module_renderer = 2, /* this module is a renderer */
ft_module_hinter = 4, /* this module is a glyph hinter */
ft_module_styler = 8, /* this module is a styler */
ft_module_font_driver = 1, /* this module is a font driver */
ft_module_renderer = 2, /* this module is a renderer */
ft_module_hinter = 4, /* this module is a glyph hinter */
ft_module_styler = 8, /* this module is a styler */
ft_module_driver_scalable = 0x100, /* the driver supports scalable fonts */
ft_module_driver_no_outlines = 0x200, /* the driver does not support vector outlines */
ft_module_driver_has_hinter = 0x400 /* the driver provides its own hinter */
ft_module_driver_scalable = 0x100, /* the driver supports scalable */
/* fonts */
ft_module_driver_no_outlines = 0x200, /* the driver does not support */
/* vector outlines */
ft_module_driver_has_hinter = 0x400 /* the driver provides its own */
/* hinter */
} FT_Module_Flags;
typedef void (*FT_Module_Interface)( void );
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 );
typedef FT_Module_Interface (*FT_Module_Requester)( FT_Module module,
const char* name );
/*************************************************************************
*
* <Struct>
* FT_Module_Class
*
* <Description>
* The module class descriptor.
*
* <Fields>
* module_flags :: bit flags describing the module
* module_size :: size of one module object/instance in bytes
* module_name :: name of the module
* module_version :: version, as a 16.16 fixed number (major.minor)
* module_requires :: the version of FreeType this module requires
* (starts at 2.0, a.k.a. 0x20000)
*
* module_init :: a function used to initialise (not create) a
* new module object
*
* module_done :: a function used to finalise (not destroy) a
* given module object
*
* get_interface :: queries a given module for a specific interface
* by name..
*
*************************************************************************/
/*************************************************************************/
/* */
/* <Struct> */
/* FT_Module_Class */
/* */
/* <Description> */
/* The module class descriptor. */
/* */
/* <Fields> */
/* module_flags :: Bit flags describing the module. */
/* */
/* module_size :: The size of one module object/instance in */
/* bytes. */
/* */
/* module_name :: The name of the module. */
/* */
/* module_version :: The version, as a 16.16 fixed number */
/* (major.minor). */
/* */
/* module_requires :: The version of FreeType this module requires */
/* (starts at version 2.0, i.e 0x20000) */
/* */
/* module_init :: A function used to initialize (not create) a */
/* 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_
{
FT_ULong module_flags;
@ -97,173 +103,173 @@
} FT_Module_Class;
/*************************************************************************/
/* */
/* <Function> */
/* FT_Add_Module */
/* */
/* <Description> */
/* Adds a new module to a given library instance. */
/* */
/* <Input> */
/* library :: A handle to the library object. */
/* */
/* clazz :: A pointer to class descriptor for the module. */
/* */
/* <Return> */
/* 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. */
/* */
FT_EXPORT_DEF( FT_Error ) FT_Add_Module( FT_Library library,
const FT_Module_Class* clazz );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Module */
/* */
/* <Description> */
/* Finds a module by its name. */
/* */
/* <Input> */
/* library :: A handle to the library object. */
/* */
/* module_name :: The module's name (as an ASCII string). */
/* */
/* <Return> */
/* A module handle. 0 if none was found. */
/* */
/* <Note> */
/* 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,
const char* module_name );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Get_Module_Interface */
/* */
/* <Description> */
/* Finds a module and returns its specific interface as a typeless */
/* pointer. */
/* */
/* <Input> */
/* library :: A handle to the library object. */
/* */
/* module_name :: The module's name (as an ASCII string). */
/* */
/* <Return> */
/* A module-specific interface if available, 0 otherwise. */
/* */
/* <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,
const char* mod_name );
/*************************************************************************/
/* */
/* <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_Module module );
/*************************************************************************/
/* */
/* <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. */
/* */
/* <Input> */
/* memory :: A handle to the original memory object. */
/* */
/* <Output> */
/* alibrary :: A pointer to handle of a new library object. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
FT_EXPORT_DEF( FT_Error ) FT_New_Library( FT_Memory memory,
FT_Library* library );
/*************************************************************************/
/* */
/* <Function> */
/* FT_Done_Library */
/* */
/* <Description> */
/* Discards a given library object. This closes all drivers and */
/* discards all resource objects. */
/* */
/* <Input> */
/* library :: A handle to the target library. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
FT_EXPORT_DEF( FT_Error ) FT_Done_Library( FT_Library library );
typedef void (*FT_DebugHook_Func)( void* arg );
/*************************************************************************
*
* <Function>
* FT_Add_Module
*
* <Description>
* Add a new module to a given library instance.
*
* <Input>
* library :: handle to library object
* clazz :: pointer to class descriptor for the module
*
* <Return>
* 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
*
*************************************************************************/
FT_EXPORT_DEF(FT_Error) FT_Add_Module( FT_Library library,
const FT_Module_Class* clazz );
/*************************************************************************
*
* <Function>
* FT_Get_Module
*
* <Description>
* Find a module by its name.
*
* <Input>
* library :: handle to library object
* module_name :: the module's ASCII name.
*
* <Return>
* Module handle, 0 if none was found.
*
* <Note>
* You'd better be familiar with FreeType internals to know which
* module to look for :-)
*
*************************************************************************/
FT_EXPORT_DEF(FT_Module) FT_Get_Module( FT_Library library,
const char* module_name );
/*************************************************************************
*
* <Function>
* FT_Get_Module_Interface
*
* <Description>
* Find a module and returns it's specific interface as a void*
*
* <Input>
* library :: handle to library object
* module_name :: the module's ASCII name.
*
* <Return>
* Module specific interface, if any
*
* <Note>
* You'd better be familiar with FreeType internals to know which
* module to look for, and what it's interface is :-)
*
*************************************************************************/
FT_EXPORT_DEF(const void*) FT_Get_Module_Interface( FT_Library library,
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
*
*************************************************************************/
FT_EXPORT_DEF(FT_Error) FT_Remove_Module( FT_Library library,
FT_Module module );
/*************************************************************************
*
* <Function>
* FT_New_Library
*
* <Description>
* Creates a new "virgin" library that uses a custom memory manager.
* The library has no registered driver, those can be added with a
* call to FT_Add_Default_Modules
*
* <Input>
* memory :: handle to custom memory manager
*
* <Output>
* library :: handle to fresh new library object
*
* <Return>
* Error code (module not listed)
*
*************************************************************************/
FT_EXPORT_DEF(FT_Error) FT_New_Library( FT_Memory memory,
FT_Library* library );
/*************************************************************************
*
* <Function>
* FT_Done_Library
*
* <Description>
* Destroys a given library, and all child objects, except the
* memory manager.
*
* <Input>
* library :: handle to target library object
*
* <Return>
* Error code (module not listed)
*
*************************************************************************/
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 );
FT_EXPORT_DEF(void) FT_Set_Debug_Hook( FT_Library library,
FT_UInt hook_index,
FT_DebugHook_Func debug_hook );
/*************************************************************************/
/* */
/* <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_UInt hook_index,
FT_DebugHook_Func debug_hook );
@ -273,14 +279,14 @@
/* FT_Add_Default_Modules */
/* */
/* <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 */
/* 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. */
/* */
FT_EXPORT_DEF(void) FT_Add_Default_Modules( FT_Library library );
FT_EXPORT_DEF( void ) FT_Add_Default_Modules( FT_Library library );
#ifdef __cplusplus

View File

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

View File

@ -30,6 +30,23 @@
#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_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_Face face,
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_Face face,
FT_UInt num_coords,

View File

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

View File

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