Formatting, fixing and adding documentation.

This commit is contained in:
Werner Lemberg 2000-05-31 06:55:12 +00:00
parent 0c8cde2e05
commit a3b6c6c290
4 changed files with 467 additions and 341 deletions

View File

@ -17,23 +17,19 @@
/*************************************************************************/
/* */
/* The purpose of this file is to implement the three following */
/* The purpose of this file is to implement the following two */
/* functions: */
/* */
/* FT_Default_Drivers: */
/* FT_Default_Drivers(): */
/* This function is used to add the set of default drivers to a */
/* fresh new library object. The set is computed at compile time */
/* from the Makefiles inclusions in Makefile.lib. See the document */
/* `FreeType Internals' for more info. */
/* fresh new library object. The set is taken from the header file */
/* `freetype/config/ftmodule.h'. See the document `FreeType 2.0 */
/* Build System' for more information. */
/* */
/* FT_Init_FreeType: */
/* FT_Init_FreeType(): */
/* This function creates a system object for the current platform, */
/* builds a library out of it, then calls FT_Default_Drivers(). */
/* */
/* FT_Done_FreeType: */
/* This function simply finalizes the library and the corresponding */
/* system object. */
/* */
/* Note that even if FT_Init_FreeType() uses the implementation of the */
/* system object defined at build time, client applications are still */
/* able to provide their own `ftsystem.c'. */
@ -76,7 +72,7 @@ const FT_DriverInterface* ft_default_drivers[] =
/* <InOut> */
/* library :: A handle to a new library object. */
/* */
FT_EXPORT_FUNC(void) FT_Default_Drivers( FT_Library library )
FT_EXPORT_FUNC( void ) FT_Default_Drivers( FT_Library library )
{
FT_Error error;
const FT_DriverInterface* *cur;
@ -89,7 +85,7 @@ const FT_DriverInterface* ft_default_drivers[] =
/* notify errors, but don't stop */
if ( error )
{
FT_ERROR(( "FT.Default_Drivers: Cannot install `%s', error = %x\n",
FT_ERROR(( "FT_Default_Drivers: Cannot install `%s', error = %x\n",
(*cur)->driver_name, error ));
}
cur++;
@ -112,13 +108,13 @@ const FT_DriverInterface* ft_default_drivers[] =
/* <Return> */
/* FreeTyoe error code. 0 means success. */
/* */
FT_EXPORT_FUNC(FT_Error) FT_Init_FreeType( FT_Library* library )
FT_EXPORT_FUNC( FT_Error ) FT_Init_FreeType( FT_Library* library )
{
FT_Error error;
FT_Memory memory;
/* First of all, allocate a new system object - -this function is part */
/* First of all, allocate a new system object -- this function is part */
/* of the system-specific component, i.e. `ftsystem.c'. */
memory = FT_New_Memory();

View File

@ -18,7 +18,7 @@
/*************************************************************************/
/* */
/* This file implements functions relative to list processing. Its */
/* data structures are defined in `freetype.h'. */
/* data structures are defined in `freetype/internal/ftlist.h'. */
/* */
/*************************************************************************/
@ -43,8 +43,8 @@
/* <Return> */
/* List node. NULL if it wasn't found. */
/* */
BASE_FUNC(FT_ListNode) FT_List_Find( FT_List list,
void* data )
BASE_FUNC( FT_ListNode ) FT_List_Find( FT_List list,
void* data )
{
FT_ListNode cur;
@ -74,8 +74,8 @@
/* list :: A pointer to the parent list. */
/* node :: The node to append. */
/* */
BASE_FUNC(void) FT_List_Add( FT_List list,
FT_ListNode node )
BASE_FUNC( void ) FT_List_Add( FT_List list,
FT_ListNode node )
{
FT_ListNode before = list->tail;
@ -104,8 +104,8 @@
/* list :: A pointer to parent list. */
/* node :: The node to insert. */
/* */
BASE_FUNC(void) FT_List_Insert( FT_List list,
FT_ListNode node )
BASE_FUNC( void ) FT_List_Insert( FT_List list,
FT_ListNode node )
{
FT_ListNode after = list->head;
@ -137,8 +137,8 @@
/* <InOut> */
/* list :: A pointer to the parent list. */
/* */
BASE_FUNC(void) FT_List_Remove( FT_List list,
FT_ListNode node )
BASE_FUNC( void ) FT_List_Remove( FT_List list,
FT_ListNode node )
{
FT_ListNode before, after;
@ -171,8 +171,8 @@
/* list :: A pointer to the parent list. */
/* node :: The node to move. */
/* */
BASE_FUNC(void) FT_List_Up( FT_List list,
FT_ListNode node )
BASE_FUNC( void ) FT_List_Up( FT_List list,
FT_ListNode node )
{
FT_ListNode before, after;
@ -180,7 +180,7 @@
before = node->prev;
after = node->next;
/* check wether we're already on top of the list */
/* check whether we are already on top of the list */
if ( !before )
return;
@ -216,11 +216,11 @@
/* argument to the iterator. */
/* */
/* <Return> */
/* The result (an error code) of the last iterator call. */
/* The result (a FreeType error code) of the last iterator call. */
/* */
BASE_FUNC(FT_Error) FT_List_Iterate( FT_List list,
FT_List_Iterator iterator,
void* user )
BASE_FUNC( FT_Error ) FT_List_Iterate( FT_List list,
FT_List_Iterator iterator,
void* user )
{
FT_ListNode cur = list->head;
FT_Error error = FT_Err_Ok;
@ -256,16 +256,15 @@
/* destroy :: A list destructor that will be applied to each element */
/* of the list. */
/* */
/* memory :: The current memory object where destructions take */
/* place. */
/* memory :: The current memory object which handles deallocation. */
/* */
/* user :: A user-supplied field which is passed as the last */
/* argument to the destructor. */
/* */
BASE_FUNC(void) FT_List_Finalize( FT_List list,
FT_List_Destructor destroy,
FT_Memory memory,
void* user )
BASE_FUNC( void ) FT_List_Finalize( FT_List list,
FT_List_Destructor destroy,
FT_Memory memory,
void* user )
{
FT_ListNode cur;

View File

@ -1,66 +1,97 @@
/***************************************************************************/
/* */
/* ftmm.c */
/* */
/* Multiple Master font support (body). */
/* */
/* 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 */
/* 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. */
/* */
/***************************************************************************/
#include <freetype/ftmm.h>
#include <freetype/internal/ftobjs.h>
FT_EXPORT_FUNC(FT_Error) FT_Get_Multi_Master( FT_Face face,
FT_Multi_Master* master )
FT_EXPORT_FUNC( FT_Error ) FT_Get_Multi_Master( FT_Face face,
FT_Multi_Master* master )
{
FT_Error error;
error = FT_Err_Invalid_Argument;
if (face && FT_HAS_MULTIPLE_MASTERS(face))
if ( face && FT_HAS_MULTIPLE_MASTERS( face ) )
{
FT_Driver driver = face->driver;
FT_Get_MM_Func func;
func = (FT_Get_MM_Func)driver->interface.get_interface(
driver, "get_mm" );
if (func)
error = func(face,master);
func = (FT_Get_MM_Func)driver->interface.get_interface(
driver, "get_mm" );
if ( func )
error = func( face, master );
}
return error;
}
FT_EXPORT_FUNC(FT_Error) FT_Set_MM_Design_Coordinates( FT_Face face,
FT_UInt num_coords,
FT_Long* coords )
FT_EXPORT_FUNC( FT_Error ) FT_Set_MM_Design_Coordinates(
FT_Face face,
FT_UInt num_coords,
FT_Long* coords )
{
FT_Error error;
error = FT_Err_Invalid_Argument;
if (face && FT_HAS_MULTIPLE_MASTERS(face))
if ( face && FT_HAS_MULTIPLE_MASTERS( face ) )
{
FT_Driver driver = face->driver;
FT_Set_MM_Design_Func func;
func = (FT_Set_MM_Design_Func)driver->interface.get_interface(
driver, "set_mm_design" );
if (func)
error = func(face,num_coords,coords);
if ( func )
error = func( face, num_coords, coords );
}
return error;
}
FT_EXPORT_FUNC(FT_Error) FT_Set_MM_Blend_Coordinates( FT_Face face,
FT_UInt num_coords,
FT_Fixed* coords )
FT_EXPORT_FUNC( FT_Error ) FT_Set_MM_Blend_Coordinates(
FT_Face face,
FT_UInt num_coords,
FT_Fixed* coords )
{
FT_Error error;
error = FT_Err_Invalid_Argument;
if (face && FT_HAS_MULTIPLE_MASTERS(face))
if ( face && FT_HAS_MULTIPLE_MASTERS( face ) )
{
FT_Driver driver = face->driver;
FT_Driver driver = face->driver;
FT_Set_MM_Blend_Func func;
func = (FT_Set_MM_Blend_Func)driver->interface.get_interface(
driver, "set_mm_blend" );
if (func)
error = func(face,num_coords,coords);
if ( func )
error = func( face, num_coords, coords );
}
return error;
}
/* END */

File diff suppressed because it is too large Load Diff