ref: 90a03301421ee470aea404955c4069ebac324173
parent: 4b68007b4f5581a13a5d117e15dac377f8b2a37f
author: Werner Lemberg <[email protected]>
date: Tue Nov 7 12:21:11 EST 2000
All function comments are now removed from source files (and moved to the header files if necessary). Some minor fixes to have `make multi' run successfully (with gcc and g++). Fixing compiler warnings.
--- a/include/freetype/freetype.h
+++ b/include/freetype/freetype.h
@@ -319,7 +319,7 @@
/* */
/* <Description> */
/* An enumeration used to specify encodings supported by charmaps. */
- /* Used in the FT_Select_CharMap() API function. */
+ /* Used in the FT_Select_Charmap() API function. */
/* */
/* <Note> */
/* Because of 32-bit charcodes defined in Unicode (i.e., surrogates), */
@@ -1590,6 +1590,22 @@
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
+ /* */
+ /* <Note> */
+ /* The values of `pixel_width' and `pixel_height' correspond to the */
+ /* pixel values of the _typographic_ character size, which are NOT */
+ /* necessarily the same as the dimensions of the glyph `bitmap */
+ /* cells'. */
+ /* */
+ /* The `character size' is really the size of an abstract square */
+ /* called the `EM', used to design the font. However, depending */
+ /* on the font design, glyphs will be smaller or greater than the */
+ /* EM. */
+ /* */
+ /* This means that setting the pixel size to, say, 8x8 doesn't */
+ /* guarantee in any way that you will get glyph bitmaps that all fit */
+ /* within an 8x8 cell (sometimes even far from it). */
+ /* */
FT_EXPORT( FT_Error ) FT_Set_Pixel_Sizes( FT_Face face,
FT_UInt pixel_width,
FT_UInt pixel_height );
@@ -1624,7 +1640,7 @@
/* If the glyph image is not a bitmap, and if the bit flag */
/* FT_LOAD_IGNORE_TRANSFORM is unset, the glyph image will be */
/* transformed with the information passed to a previous call to */
- /* FT_Set_Transform. */
+ /* FT_Set_Transform(). */
/* */
/* Note that this also transforms the `face.glyph.advance' field, but */
/* *not* the values in `face.glyph.metrics'. */
@@ -2123,10 +2139,10 @@
/* decoding. */
/* */
/* <InOut> */
- /* face :: A handle to the source face object. */
+ /* face :: A handle to the source face object. */
/* */
/* <Input> */
- /* charmap :: A handle to the selected charmap. */
+ /* charmap :: A handle to the selected charmap. */
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
@@ -2262,9 +2278,6 @@
/* */
/* <Input> */
/* matrix :: A pointer to the source 2x2 matrix. */
- /* */
- /* <MT-Note> */
- /* Yes. */
/* */
/* <Note> */
/* The result is undefined if either `vector' or `matrix' is invalid. */
--- a/include/freetype/ftglyph.h
+++ b/include/freetype/ftglyph.h
@@ -402,9 +402,6 @@
/* <InOut> */
/* b :: A pointer to matrix `b'. */
/* */
- /* <MT-Note> */
- /* Yes. */
- /* */
/* <Note> */
/* The result is undefined if either `a' or `b' is zero. */
/* */
@@ -426,9 +423,6 @@
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
- /* */
- /* <MT-Note> */
- /* Yes. */
/* */
FT_EXPORT( FT_Error ) FT_Matrix_Invert( FT_Matrix* matrix );
--- a/include/freetype/ftmac.h
+++ b/include/freetype/ftmac.h
@@ -48,8 +48,8 @@
/* <Input> */
/* fond :: An FOND resource. */
/* */
- /* face_index :: only supported for the -1 `sanity check' */
- /* special case. */
+ /* face_index :: Only supported for the -1 `sanity check' special */
+ /* case. */
/* */
/* <Output> */
/* aface :: A handle to a new face object. */
@@ -60,6 +60,7 @@
/* <Notes> */
/* This function can be used to create FT_Face abjects from fonts */
/* that are installed in the system like so: */
+ /* */
/* fond = GetResource( 'FOND', fontName ); */
/* error = FT_New_Face_From_FOND( library, fond, 0, &face ); */
/* */
--- a/include/freetype/ftmodule.h
+++ b/include/freetype/ftmodule.h
@@ -236,7 +236,7 @@
/* <Input> */
/* hook_index :: The index of the debug hook. You should use the */
/* values defined in ftobjs.h, e.g. */
- /* FT_DEBUG_HOOK_TRUETYPE */
+ /* FT_DEBUG_HOOK_TRUETYPE. */
/* */
/* debug_hook :: The function used to debug the interpreter. */
/* */
--- a/include/freetype/ftnames.h
+++ b/include/freetype/ftnames.h
@@ -81,7 +81,7 @@
/* Retrieves the number of name strings in the SFNT `name' table. */
/* */
/* <Input> */
- /* face :: A handle to the source face. */
+ /* face :: A handle to the source face. */
/* */
/* <Return> */
/* The number of strings in the `name' table. */
--- a/include/freetype/ftoutln.h
+++ b/include/freetype/ftoutln.h
@@ -84,9 +84,6 @@
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
- /* <MT-Note> */
- /* No. */
- /* */
/* <Note> */
/* The reason why this function takes a `library' parameter is simply */
/* to use the library's memory allocator. */
@@ -121,9 +118,6 @@
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
- /* <MT-Note> */
- /* No. */
- /* */
/* <Note> */
/* If the outline's `owner' field is not set, only the outline */
/* descriptor will be released. */
@@ -162,9 +156,6 @@
/* <Output> */
/* acbox :: The outline's control box. */
/* */
- /* <MT-Note> */
- /* Yes. */
- /* */
FT_EXPORT( void ) FT_Outline_Get_CBox( FT_Outline* outline,
FT_BBox *acbox );
@@ -185,9 +176,6 @@
/* */
/* yOffset :: The vertical offset. */
/* */
- /* <MT-Note> */
- /* Yes. */
- /* */
FT_EXPORT( void ) FT_Outline_Translate( FT_Outline* outline,
FT_Pos xOffset,
FT_Pos yOffset );
@@ -219,22 +207,21 @@
/*************************************************************************/
/* */
/* <Function> */
- /* FT_Vector_Transform */
+ /* FT_Outline_Transform */
/* */
/* <Description> */
- /* Transforms a single vector through a 2x2 matrix. */
+ /* Applies a simple 2x2 matrix to all of an outline's points. Useful */
+ /* for applying rotations, slanting, flipping, etc. */
/* */
/* <InOut> */
- /* vector :: The target vector to transform. */
+ /* outline :: A pointer to the target outline descriptor. */
/* */
/* <Input> */
- /* matrix :: A pointer to the source 2x2 matrix. */
+ /* matrix :: A pointer to the transformation matrix. */
/* */
- /* <MT-Note> */
- /* Yes. */
- /* */
/* <Note> */
- /* The result is undefined if either `vector' or `matrix' is invalid. */
+ /* You can use FT_Outline_Translate() if you need to translate the */
+ /* outline's points. */
/* */
FT_EXPORT( void ) FT_Outline_Transform( FT_Outline* outline,
FT_Matrix* matrix );
@@ -282,10 +269,6 @@
/* <Return> */
/* FreeType error code. 0 means success. */
/* */
- /* <MT-Note> */
- /* YES. Rendering is synchronized, so that concurrent calls to the */
- /* scan-line converter will be serialized. */
- /* */
/* <Note> */
/* This function does NOT CREATE the bitmap, it only renders an */
/* outline image within the one you pass to it! */
@@ -319,10 +302,6 @@
/* */
/* <Return> */
/* FreeType error code. 0 means success. */
- /* */
- /* <MT-Note> */
- /* YES. Rendering is synchronized, so that concurrent calls to the */
- /* scan-line converter will be serialized. */
/* */
/* <Note> */
/* You should know what you are doing and how FT_Raster_Params works */
--- a/include/freetype/internal/ftcalc.h
+++ b/include/freetype/internal/ftcalc.h
@@ -40,6 +40,22 @@
#define SQRT_64( z ) FT_Sqrt64( z )
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Sqrt64 */
+ /* */
+ /* <Description> */
+ /* Computes the square root of a 64-bit value. That sounds stupid, */
+ /* but it is needed to obtain maximal accuracy in the TrueType */
+ /* bytecode interpreter. */
+ /* */
+ /* <Input> */
+ /* l :: A 64-bit integer. */
+ /* */
+ /* <Return> */
+ /* The 32-bit square-root. */
+ /* */
FT_EXPORT( FT_Int32 ) FT_Sqrt64( FT_Int64 l );
#endif /* FT_CONFIG_OPTION_OLD_CALCS */
@@ -60,14 +76,72 @@
#define MUL_64( x, y, z ) FT_MulTo64( x, y, &z )
#define DIV_64( x, y ) FT_Div64by32( &x, y )
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Add64 */
+ /* */
+ /* <Description> */
+ /* Add two Int64 values. */
+ /* */
+ /* <Input> */
+ /* x :: A pointer to the first value to be added. */
+ /* y :: A pointer to the second value to be added. */
+ /* */
+ /* <Output> */
+ /* z :: A pointer to the result of `x + y'. */
+ /* */
+ /* <Note> */
+ /* Will be wrapped by the ADD_64() macro. */
+ /* */
FT_EXPORT( void ) FT_Add64( FT_Int64* x,
FT_Int64* y,
FT_Int64 *z );
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_MulTo64 */
+ /* */
+ /* <Description> */
+ /* Multiplies two Int32 integers. Returns an Int64 integer. */
+ /* */
+ /* <Input> */
+ /* x :: The first multiplier. */
+ /* y :: The second multiplier. */
+ /* */
+ /* <Output> */
+ /* z :: A pointer to the result of `x * y'. */
+ /* */
+ /* <Note> */
+ /* Will be wrapped by the MUL_64() macro. */
+ /* */
FT_EXPORT( void ) FT_MulTo64( FT_Int32 x,
FT_Int32 y,
FT_Int64 *z );
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Div64by32 */
+ /* */
+ /* <Description> */
+ /* Divides an Int64 value by an Int32 value. Returns an Int32 */
+ /* integer. */
+ /* */
+ /* <Input> */
+ /* x :: A pointer to the dividend. */
+ /* y :: The divisor. */
+ /* */
+ /* <Return> */
+ /* The result of `x / y'. */
+ /* */
+ /* <Note> */
+ /* Will be wrapped by the DIV_64() macro. */
+ /* */
FT_EXPORT( FT_Int32 ) FT_Div64by32( FT_Int64* x,
FT_Int32 y );
@@ -78,6 +152,22 @@
#define SQRT_64( z ) FT_Sqrt64( &z )
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Sqrt64 */
+ /* */
+ /* <Description> */
+ /* Computes the square root of a 64-bits value. That sounds stupid, */
+ /* but it is needed to obtain maximal accuracy in the TrueType */
+ /* bytecode interpreter. */
+ /* */
+ /* <Input> */
+ /* z :: A pointer to a 64-bit integer. */
+ /* */
+ /* <Return> */
+ /* The 32-bit square-root. */
+ /* */
FT_EXPORT( FT_Int32 ) FT_Sqrt64( FT_Int64* x );
#endif /* FT_CONFIG_OPTION_OLD_CALCS */
@@ -90,7 +180,22 @@
#define SQRT_32( x ) FT_Sqrt32( x )
- FT_BASE( FT_Int32 ) FT_Sqrt32( FT_Int32 x );
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Sqrt32 */
+ /* */
+ /* <Description> */
+ /* Computes the square root of an Int32 integer (which will be */
+ /* handled as an unsigned long value). */
+ /* */
+ /* <Input> */
+ /* x :: The value to compute the root for. */
+ /* */
+ /* <Return> */
+ /* The result of `sqrt(x)'. */
+ /* */
+ FT_EXPORT( FT_Int32 ) FT_Sqrt32( FT_Int32 x );
#endif /* !FT_CONFIG_OPTION_OLD_CALCS */
--- a/include/freetype/internal/ftdebug.h
+++ b/include/freetype/internal/ftdebug.h
@@ -138,6 +138,21 @@
} while ( 0 )
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_SetTraceLevel */
+ /* */
+ /* <Description> */
+ /* Sets the trace level for debugging. */
+ /* */
+ /* <Input> */
+ /* component :: The component which should be traced. See above for */
+ /* a complete list. If set to `trace_any', all */
+ /* components will be traced. */
+ /* */
+ /* level :: The tracing level. */
+ /* */
FT_EXPORT( void ) FT_SetTraceLevel( FT_Trace component,
char level );
--- a/include/freetype/internal/ftextend.h
+++ b/include/freetype/internal/ftextend.h
@@ -130,6 +130,22 @@
} FT_Extension_Class;
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Register_Extension */
+ /* */
+ /* <Description> */
+ /* Registers a new extension. */
+ /* */
+ /* <InOut> */
+ /* driver :: A handle to the driver object. */
+ /* */
+ /* class :: A pointer to a class describing the extension. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
FT_EXPORT( FT_Error ) FT_Register_Extension( FT_Driver driver,
FT_Extension_Class* clazz );
@@ -159,7 +175,26 @@
#endif
- /* return an extension's data & interface according to its ID */
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Get_Extension */
+ /* */
+ /* <Description> */
+ /* Queries an extension block by an extension ID string. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to the face object. */
+ /* extension_id :: An ID string identifying the extension. */
+ /* */
+ /* <Output> */
+ /* extension_interface :: A generic pointer, usually pointing to a */
+ /* table of functions implementing the */
+ /* extension interface. */
+ /* */
+ /* <Return> */
+ /* A generic pointer to the extension block. */
+ /* */
FT_EXPORT( void* ) FT_Get_Extension( FT_Face face,
const char* extension_id,
void** extension_interface );
--- a/include/freetype/internal/ftobjs.h
+++ b/include/freetype/internal/ftobjs.h
@@ -299,13 +299,45 @@
/* this must be kept exported -- it is used by the cache manager */
/* even though it shouldn't be considered public for now */
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_New_Size */
+ /* */
+ /* <Description> */
+ /* Creates a new size object from a given face object. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to a parent face object. */
+ /* */
+ /* <Output> */
+ /* asize :: A handle to a new size object. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
FT_EXPORT( FT_Error ) FT_New_Size( FT_Face face,
FT_Size* size );
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Done_Size */
+ /* */
+ /* <Description> */
+ /* Discards a given size object. */
+ /* */
+ /* <Input> */
+ /* size :: A handle to a target size object. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
FT_EXPORT( FT_Error ) FT_Done_Size( FT_Size size );
-
FT_BASE( FT_Error ) FT_New_GlyphSlot( FT_Face face,
FT_GlyphSlot* aslot );
@@ -429,7 +461,7 @@
FT_ModuleRec root;
FT_Renderer_Class* clazz;
FT_Glyph_Format glyph_format;
- const FT_Glyph_Class glyph_class;
+ FT_Glyph_Class glyph_class;
FT_Raster raster;
FT_Raster_Render_Func raster_render;
@@ -597,13 +629,66 @@
#ifndef FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_New_Stream */
+ /* */
+ /* <Description> */
+ /* Creates a new stream object. */
+ /* */
+ /* <Input> */
+ /* filepathname :: The name of the stream (usually a file) to be */
+ /* opened. */
+ /* */
+ /* stream :: A pointer to the stream object. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
FT_EXPORT( FT_Error ) FT_New_Stream( const char* filepathname,
FT_Stream astream );
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Done_Stream */
+ /* */
+ /* <Description> */
+ /* Closes and destroys a stream object. */
+ /* */
+ /* <Input> */
+ /* stream :: The stream to be closed and destroyed. */
+ /* */
FT_EXPORT( void ) FT_Done_Stream( FT_Stream stream );
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_New_Memory */
+ /* */
+ /* <Description> */
+ /* Creates a new memory object. */
+ /* */
+ /* <Return> */
+ /* A pointer to the new memory object. 0 in case of error. */
+ /* */
FT_EXPORT( FT_Memory ) FT_New_Memory( void );
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* FT_Done_Memory */
+ /* */
+ /* <Description> */
+ /* Discards memory manager. */
+ /* */
+ /* <Input> */
+ /* memory :: A handle to the memory manager. */
+ /* */
FT_EXPORT( void ) FT_Done_Memory( FT_Memory memory );
#endif /* !FT_CONFIG_OPTION_NO_DEFAULT_SYSTEM */
--- a/include/freetype/internal/tttypes.h
+++ b/include/freetype/internal/tttypes.h
@@ -22,6 +22,7 @@
#include <freetype/tttables.h>
+#include <freetype/internal/ftobjs.h>
#ifdef __cplusplus
--- a/src/base/ftbbox.c
+++ b/src/base/ftbbox.c
@@ -335,27 +335,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Outline_Get_BBox */
- /* */
- /* <Description> */
- /* Computes the exact bounding box of an outline. This is slower */
- /* than computing the control box. However, it uses an advanced */
- /* algorithm which returns _very_ quickly when the two boxes */
- /* coincide. Otherwise, the outline Bezier arcs are walked over to */
- /* extract their extrema. */
- /* */
- /* <Input> */
- /* outline :: A pointer to the source outline. */
- /* */
- /* <Output> */
- /* abbox :: A pointer to the outline's exact bounding box. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /* documentation is in ftbbox.h */
+
FT_EXPORT_DEF( FT_Error ) FT_Outline_Get_BBox( FT_Outline* outline,
FT_BBox *abbox )
{
--- a/src/base/ftcalc.c
+++ b/src/base/ftcalc.c
@@ -67,21 +67,8 @@
#else
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Sqrt32 */
- /* */
- /* <Description> */
- /* Computes the square root of an Int32 integer (which will be */
- /* handled as an unsigned long value). */
- /* */
- /* <Input> */
- /* x :: The value to compute the root for. */
- /* */
- /* <Return> */
- /* The result of `sqrt(x)'. */
- /* */
+ /* documentation is in ftcalc.h */
+
FT_EXPORT_DEF( FT_Int32 ) FT_Sqrt32( FT_Int32 x )
{
FT_ULong val, root, newroot, mask;
@@ -113,29 +100,8 @@
#ifdef FT_LONG64
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_MulDiv */
- /* */
- /* <Description> */
- /* A very simple function used to perform the computation `(a*b)/c' */
- /* with maximal accuracy (it uses a 64-bit intermediate integer */
- /* whenever necessary). */
- /* */
- /* This function isn't necessarily as fast as some processor specific */
- /* operations, but is at least completely portable. */
- /* */
- /* <Input> */
- /* a :: The first multiplier. */
- /* b :: The second multiplier. */
- /* c :: The divisor. */
- /* */
- /* <Return> */
- /* The result of `(a*b)/c'. This function never traps when trying to */
- /* divide by zero; it simply returns `MaxInt' or `MinInt' depending */
- /* on the signs of `a' and `b'. */
- /* */
+ /* documentation is in freetype.h */
+
FT_EXPORT_DEF( FT_Long ) FT_MulDiv( FT_Long a,
FT_Long b,
FT_Long c )
@@ -153,35 +119,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_MulFix */
- /* */
- /* <Description> */
- /* A very simple function used to perform the computation */
- /* `(a*b)/0x10000' with maximal accuracy. Most of the time this is */
- /* used to multiply a given value by a 16.16 fixed float factor. */
- /* */
- /* <Input> */
- /* a :: The first multiplier. */
- /* b :: The second multiplier. Use a 16.16 factor here whenever */
- /* possible (see note below). */
- /* */
- /* <Return> */
- /* The result of `(a*b)/0x10000'. */
- /* */
- /* <Note> */
- /* This function has been optimized for the case where the absolute */
- /* value of `a' is less than 2048, and `b' is a 16.16 scaling factor. */
- /* As this happens mainly when scaling from notional units to */
- /* fractional pixels in FreeType, it resulted in noticeable speed */
- /* improvements between versions 2.x and 1.x. */
- /* */
- /* As a conclusion, always try to place a 16.16 factor as the */
- /* _second_ argument of this function; this can make a great */
- /* difference. */
- /* */
+ /* documentation is in freetype.h */
+
FT_EXPORT_DEF( FT_Long ) FT_MulFix( FT_Long a,
FT_Long b )
{
@@ -196,29 +135,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_DivFix */
- /* */
- /* <Description> */
- /* A very simple function used to perform the computation */
- /* `(a*0x10000)/b' with maximal accuracy. Most of the time, this is */
- /* used to divide a given value by a 16.16 fixed float factor. */
- /* */
- /* <Input> */
- /* a :: The first multiplier. */
- /* b :: The second multiplier. Use a 16.16 factor here whenever */
- /* possible (see note below). */
- /* */
- /* <Return> */
- /* The result of `(a*0x10000)/b'. */
- /* */
- /* <Note> */
- /* The optimization for FT_DivFix() is simple: If (a << 16) fits in */
- /* 32 bits, then the division is computed directly. Otherwise, we */
- /* use a specialized version of the old FT_MulDiv64(). */
- /* */
+ /* documentation is in freetype.h */
+
FT_EXPORT_DEF( FT_Long ) FT_DivFix( FT_Long a,
FT_Long b )
{
@@ -259,22 +177,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Sqrt64 */
- /* */
- /* <Description> */
- /* Computes the square root of a 64-bit value. That sounds stupid, */
- /* but it is needed to obtain maximal accuracy in the TrueType */
- /* bytecode interpreter. */
- /* */
- /* <Input> */
- /* l :: A 64-bit integer. */
- /* */
- /* <Return> */
- /* The 32-bit square-root. */
- /* */
+ /* documentation is in ftcalc.h */
+
FT_EXPORT_DEF( FT_Int32 ) FT_Sqrt64( FT_Int64 l )
{
FT_Int64 r, s;
@@ -301,6 +205,7 @@
FT_Int64 z;
+
z = (FT_Int64)(x) << 16;
return FT_Sqrt64( z );
}
@@ -311,46 +216,8 @@
#else /* FT_LONG64 */
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_MulDiv */
- /* */
- /* <Description> */
- /* A very simple function used to perform the computation `(a*b)/c' */
- /* with maximal accuracy (it uses a 64-bit intermediate integer */
- /* whenever necessary). */
- /* */
- /* This function isn't necessarily as fast as some processor specific */
- /* operations, but is at least completely portable. */
- /* */
- /* <Input> */
- /* a :: The first multiplier. */
- /* b :: The second multiplier. */
- /* c :: The divisor. */
- /* */
- /* <Return> */
- /* The result of `(a*b)/c'. This function never traps when trying to */
- /* divide by zero; it simply returns `MaxInt' or `MinInt' depending */
- /* on the signs of `a' and `b'. */
- /* */
- /* <Note> */
- /* The FT_MulDiv() function has been optimized thanks to ideas from */
- /* Graham Asher. The trick is to optimize computation if everything */
- /* fits within 32 bits (a rather common case). */
- /* */
- /* We compute `a*b+c/2', then divide it by `c' (positive values). */
- /* */
- /* 46340 is FLOOR(SQRT(2^31-1)). */
- /* */
- /* if ( a <= 46340 && b <= 46340 ) then ( a*b <= 0x7FFEA810 ) */
- /* */
- /* 0x7FFFFFFF - 0x7FFEA810 = 0x157F0 */
- /* */
- /* if ( c < 0x157F0*2 ) then ( a*b+c/2 <= 0x7FFFFFFF ) */
- /* */
- /* and 2*0x157F0 = 176096. */
- /* */
+ /* documentation is in freetype.h */
+
FT_EXPORT_DEF( FT_Long ) FT_MulDiv( FT_Long a,
FT_Long b,
FT_Long c )
@@ -387,37 +254,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_MulFix */
- /* */
- /* <Description> */
- /* A very simple function used to perform the computation */
- /* `(a*b)/0x10000' with maximal accuracy. Most of the time, this is */
- /* used to multiply a given value by a 16.16 fixed float factor. */
- /* */
- /* <Input> */
- /* a :: The first multiplier. */
- /* b :: The second multiplier. Use a 16.16 factor here whenever */
- /* possible (see note below). */
- /* */
- /* <Return> */
- /* The result of `(a*b)/0x10000'. */
- /* */
- /* <Note> */
- /* The optimization for FT_MulFix() is different. We could simply be */
- /* happy by applying the same principles as with FT_MulDiv(), because */
- /* */
- /* c = 0x10000 < 176096 */
- /* */
- /* However, in most cases, we have a `b' with a value around 0x10000 */
- /* which is greater than 46340. */
- /* */
- /* According to some testing, most cases have `a' < 2048, so a good */
- /* idea is to use bounds like 2048 and 1048576 (=floor((2^31-1)/2048) */
- /* for `a' and `b', respectively. */
- /* */
+ /* documentation is in freetype.h */
+
FT_EXPORT_DEF( FT_Long ) FT_MulFix( FT_Long a,
FT_Long b )
{
@@ -452,29 +290,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_DivFix */
- /* */
- /* <Description> */
- /* A very simple function used to perform the computation */
- /* `(a*0x10000)/b' with maximal accuracy. Most of the time, this is */
- /* used to divide a given value by a 16.16 fixed float factor. */
- /* */
- /* <Input> */
- /* a :: The first multiplier. */
- /* b :: The second multiplier. Use a 16.16 factor here whenever */
- /* possible (see note below). */
- /* */
- /* <Return> */
- /* The result of `(a*0x10000)/b'. */
- /* */
- /* <Note> */
- /* The optimization for FT_DivFix() is simple: If (a << 16) fits into */
- /* 32 bits, then the division is computed directly. Otherwise, we */
- /* use a specialized version of the old FT_MulDiv64(). */
- /* */
+ /* documentation is in freetype.h */
+
FT_EXPORT_DEF( FT_Long ) FT_DivFix( FT_Long a,
FT_Long b )
{
@@ -512,24 +329,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Add64 */
- /* */
- /* <Description> */
- /* Add two Int64 values. */
- /* */
- /* <Input> */
- /* x :: A pointer to the first value to be added. */
- /* y :: A pointer to the second value to be added. */
- /* */
- /* <Output> */
- /* z :: A pointer to the result of `x + y'. */
- /* */
- /* <Note> */
- /* Will be wrapped by the ADD_64() macro. */
- /* */
+ /* documentation is in ftcalc.h */
+
FT_EXPORT_DEF( void ) FT_Add64( FT_Int64* x,
FT_Int64* y,
FT_Int64 *z )
@@ -545,24 +346,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_MulTo64 */
- /* */
- /* <Description> */
- /* Multiplies two Int32 integers. Returns an Int64 integer. */
- /* */
- /* <Input> */
- /* x :: The first multiplier. */
- /* y :: The second multiplier. */
- /* */
- /* <Output> */
- /* z :: A pointer to the result of `x * y'. */
- /* */
- /* <Note> */
- /* Will be wrapped by the MUL_64() macro. */
- /* */
+ /* documentation is in ftcalc.h */
+
FT_EXPORT_DEF( void ) FT_MulTo64( FT_Int32 x,
FT_Int32 y,
FT_Int64 *z )
@@ -609,25 +394,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Div64by32 */
- /* */
- /* <Description> */
- /* Divides an Int64 value by an Int32 value. Returns an Int32 */
- /* integer. */
- /* */
- /* <Input> */
- /* x :: A pointer to the dividend. */
- /* y :: The divisor. */
- /* */
- /* <Return> */
- /* The result of `x / y'. */
- /* */
- /* <Note> */
- /* Will be wrapped by the DIV_64() macro. */
- /* */
+ /* documentation is in ftcalc.h */
+
FT_EXPORT_DEF( FT_Int32 ) FT_Div64by32( FT_Int64* x,
FT_Int32 y )
{
@@ -725,22 +493,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Sqrt64 */
- /* */
- /* <Description> */
- /* Computes the square root of a 64-bits value. That sounds stupid, */
- /* but it is needed to obtain maximal accuracy in the TrueType */
- /* bytecode interpreter. */
- /* */
- /* <Input> */
- /* z :: A pointer to a 64-bit integer. */
- /* */
- /* <Return> */
- /* The 32-bit square-root. */
- /* */
+ /* documentation is in ftcalc.h */
+
FT_EXPORT_DEF( FT_Int32 ) FT_Sqrt64( FT_Int64* l )
{
FT_Int64 l2;
@@ -769,7 +523,7 @@
}
- FT_EXPORT( FT_Int32 ) FT_SqrtFixed( FT_Int32 x )
+ FT_EXPORT( FT_Int32 ) FT_SqrtFixed( FT_Int32 x )
{
FT_Int64 z;
--- a/src/base/ftdebug.c
+++ b/src/base/ftdebug.c
@@ -82,21 +82,6 @@
#ifdef FT_DEBUG_LEVEL_TRACE
-
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_SetTraceLevel */
- /* */
- /* <Description> */
- /* Sets the trace level for debugging. */
- /* */
- /* <Input> */
- /* component :: The component which should be traced. See ftdebug.h */
- /* for a complete list. If set to `trace_any', all */
- /* components will be traced. */
- /* level :: The tracing level. */
- /* */
FT_EXPORT_DEF( void ) FT_SetTraceLevel( FT_Trace component,
char level )
{
--- a/src/base/ftextend.c
+++ b/src/base/ftextend.c
@@ -109,22 +109,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Register_Extension */
- /* */
- /* <Description> */
- /* Registers a new extension. */
- /* */
- /* <InOut> */
- /* driver :: A handle to the driver object. */
- /* */
- /* class :: A pointer to a class describing the extension. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /* documentation is in ftextend.h */
+
FT_EXPORT_DEF( FT_Error ) FT_Register_Extension(
FT_Driver driver,
FT_Extension_Class* clazz )
@@ -164,26 +150,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_Extension */
- /* */
- /* <Description> */
- /* Queries an extension block by an extension ID string. */
- /* */
- /* <Input> */
- /* face :: A handle to the face object. */
- /* extension_id :: An ID string identifying the extension. */
- /* */
- /* <Output> */
- /* extension_interface :: A generic pointer, usually pointing to a */
- /* table of functions implementing the */
- /* extension interface. */
- /* */
- /* <Return> */
- /* A generic pointer to the extension block. */
- /* */
+ /* documentation is in ftextend.h */
+
FT_EXPORT_DEF( void* ) FT_Get_Extension(
FT_Face face,
const char* extension_id,
--- a/src/base/ftglyph.c
+++ b/src/base/ftglyph.c
@@ -52,26 +52,8 @@
/*************************************************************************/
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Matrix_Multiply */
- /* */
- /* <Description> */
- /* Performs the matrix operation `b = a*b'. */
- /* */
- /* <Input> */
- /* a :: A pointer to matrix `a'. */
- /* */
- /* <InOut> */
- /* b :: A pointer to matrix `b'. */
- /* */
- /* <MT-Note> */
- /* Yes. */
- /* */
- /* <Note> */
- /* The result is undefined if either `a' or `b' is zero. */
- /* */
+ /* documentation is in ftglyph.h */
+
FT_EXPORT_DEF( void ) FT_Matrix_Multiply( FT_Matrix* a,
FT_Matrix* b )
{
@@ -91,24 +73,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Matrix_Invert */
- /* */
- /* <Description> */
- /* Inverts a 2x2 matrix. Returns an error if it can't be inverted. */
- /* */
- /* <InOut> */
- /* matrix :: A pointer to the target matrix. Remains untouched in */
- /* case of error. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <MT-Note> */
- /* Yes. */
- /* */
+ /* documentation is in ftglyph.h */
+
FT_EXPORT_DEF( FT_Error ) FT_Matrix_Invert( FT_Matrix* matrix )
{
FT_Pos delta, xx, yy;
@@ -405,24 +371,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Glyph_Copy */
- /* */
- /* <Description> */
- /* A function used to copy a glyph image. */
- /* */
- /* <Input> */
- /* source :: A handle to the source glyph object. */
- /* */
- /* <Output> */
- /* target :: A handle to the target glyph object. 0 in case of */
- /* error. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /* documentation is in ftglyph.h */
+
FT_EXPORT_DEF( FT_Error ) FT_Glyph_Copy( FT_Glyph source,
FT_Glyph *target )
{
@@ -458,23 +408,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_Glyph */
- /* */
- /* <Description> */
- /* A function used to extract a glyph image from a slot. */
- /* */
- /* <Input> */
- /* slot :: A handle to the source glyph slot. */
- /* */
- /* <Output> */
- /* aglyph :: A handle to the glyph object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /* documentation is in ftglyph.h */
+
FT_EXPORT_DEF( FT_Error ) FT_Get_Glyph( FT_GlyphSlot slot,
FT_Glyph *aglyph )
{
@@ -538,30 +473,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Glyph_Transform */
- /* */
- /* <Description> */
- /* Transforms a glyph image if its format is scalable. */
- /* */
- /* <Input> */
- /* glyph :: A handle to the target glyph object. */
- /* */
- /* matrix :: A pointer to a 2x2 matrix to apply. */
- /* */
- /* delta :: A pointer to a 2d vector to apply. Coordinates are */
- /* expressed in 1/64th of a pixel. */
- /* */
- /* <Return> */
- /* FreeType error code (the glyph format is not scalable if it is */
- /* not zero). */
- /* */
- /* <Note> */
- /* The 2x2 transformation matrix is also applied to the glyph's */
- /* advance vector. */
- /* */
+ /* documentation is in ftglyph.h */
+
FT_EXPORT_DEF( FT_Error ) FT_Glyph_Transform( FT_Glyph glyph,
FT_Matrix* matrix,
FT_Vector* delta )
@@ -591,59 +504,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Glyph_Get_CBox */
- /* */
- /* <Description> */
- /* Returns the glyph image's bounding box. */
- /* */
- /* <Input> */
- /* glyph :: A handle to the source glyph object. */
- /* */
- /* mode :: The mode which indicates how to interpret the returned */
- /* bounding box values. */
- /* */
- /* <Output> */
- /* box :: The glyph bounding box. Coordinates are expressed in */
- /* 1/64th of pixels if it is grid-fitted. */
- /* */
- /* <Note> */
- /* Coordinates are relative to the glyph origin, using the Y-upwards */
- /* convention. */
- /* */
- /* If the glyph has been loaded with FT_LOAD_NO_SCALE, `bbox_mode' */
- /* must be set to `ft_glyph_bbox_unscaled' to get unscaled font */
- /* units. */
- /* */
- /* If `bbox_mode' is set to `ft_glyph_bbox_subpixels' the bbox */
- /* coordinates are returned in 26.6 pixels (i.e. 1/64th of pixels). */
- /* */
- /* Note that the maximum coordinates are exclusive, which means that */
- /* one can compute the width and height of the glyph image (be it in */
- /* integer or 26.6 pixels) as: */
- /* */
- /* width = bbox.xMax - bbox.xMin; */
- /* height = bbox.yMax - bbox.yMin; */
- /* */
- /* Note also that for 26.6 coordinates, if `bbox_mode' is set to */
- /* `ft_glyph_bbox_gridfit', the coordinates will also be grid-fitted, */
- /* which corresponds to: */
- /* */
- /* bbox.xMin = FLOOR(bbox.xMin); */
- /* bbox.yMin = FLOOR(bbox.yMin); */
- /* bbox.xMax = CEILING(bbox.xMax); */
- /* bbox.yMax = CEILING(bbox.yMax); */
- /* */
- /* To get the bbox in pixel coordinates, set `bbox_mode' to */
- /* `ft_glyph_bbox_truncate'. */
- /* */
- /* To get the bbox in grid-fitted pixel coordinates, set `bbox_mode' */
- /* to `ft_glyph_bbox_pixels'. */
- /* */
- /* The default value for `bbox_mode' is `ft_glyph_bbox_pixels'. */
- /* */
+ /* documentation is in ftglyph.h */
+
FT_EXPORT_DEF( void ) FT_Glyph_Get_CBox( FT_Glyph glyph,
FT_UInt bbox_mode,
FT_BBox *acbox )
@@ -687,77 +549,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Glyph_To_Bitmap */
- /* */
- /* <Description> */
- /* Converts a given glyph object to a bitmap glyph object. */
- /* */
- /* <InOut> */
- /* glyph :: A pointer to a handle to the target glyph. */
- /* */
- /* <Input> */
- /* render_mode :: A set of bit flags that describe how the data is */
- /* */
- /* */
- /* origin :: A pointer to a vector used to translate the glyph */
- /* image before rendering. Can be 0 (if no */
- /* translation). The origin is expressed in */
- /* 26.6 pixels. */
- /* */
- /* destroy :: A boolean that indicates that the original glyph */
- /* image should be destroyed by this function. It is */
- /* never destroyed in case of error. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <Note> */
- /* The glyph image is translated with the `origin' vector before */
- /* rendering. In case of error, it it translated back to its */
- /* original position and the glyph is left untouched. */
- /* */
- /* The first parameter is a pointer to a FT_Glyph handle, that will */
- /* be replaced by this function. Typically, you would use (omitting */
- /* error handling): */
- /* */
- /* */
- /* { */
- /* FT_Glyph glyph; */
- /* FT_BitmapGlyph glyph_bitmap; */
- /* */
- /* */
- /* // load glyph */
- /* error = FT_Load_Char( face, glyph_index, FT_LOAD_DEFAUT ); */
- /* */
- /* // extract glyph image */
- /* error = FT_Get_Glyph( face->glyph, &glyph ); */
- /* */
- /* // convert to a bitmap (default render mode + destroy old) */
- /* if ( glyph->format != ft_glyph_format_bitmap ) */
- /* { */
- /* error = FT_Glyph_To_Bitmap( &glyph, ft_render_mode_default, */
- /* 0, 1 ); */
- /* if ( error ) // glyph unchanged */
- /* ... */
- /* } */
- /* */
- /* // access bitmap content by typecasting */
- /* glyph_bitmap = (FT_BitmapGlyph)glyph; */
- /* */
- /* // do funny stuff with it, like blitting/drawing */
- /* ... */
- /* */
- /* // discard glyph image (bitmap or not) */
- /* FT_Done_Glyph( glyph ); */
- /* } */
- /* */
- /* */
- /* This function will always fail if the glyph's format isn't */
- /* scalable. */
- /* */
+ /* documentation is in ftglyph.h */
+
FT_EXPORT_DEF( FT_Error ) FT_Glyph_To_Bitmap( FT_Glyph* the_glyph,
FT_ULong render_mode,
FT_Vector* origin,
@@ -844,17 +637,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Done_Glyph */
- /* */
- /* <Description> */
- /* Destroys a given glyph. */
- /* */
- /* <Input> */
- /* glyph :: A handle to the target glyph object. */
- /* */
+ /* documentation is in ftglyph.h */
+
FT_EXPORT_DEF( void ) FT_Done_Glyph( FT_Glyph glyph )
{
if ( glyph )
--- a/src/base/ftinit.c
+++ b/src/base/ftinit.c
@@ -72,19 +72,8 @@
};
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Add_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. */
- /* */
+ /* documentation is in ftmodule.h */
+
FT_EXPORT_DEF( void ) FT_Add_Default_Modules( FT_Library library )
{
FT_Error error;
@@ -108,21 +97,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Init_FreeType */
- /* */
- /* <Description> */
- /* Initializes a new FreeType library object. The set of drivers */
- /* that are registered by this function is determined at build time. */
- /* */
- /* <Output> */
- /* library :: A handle to a new library object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /* documentation is in freetype.h */
+
FT_EXPORT_DEF( FT_Error ) FT_Init_FreeType( FT_Library *alibrary )
{
FT_Error error;
@@ -150,21 +126,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Done_FreeType */
- /* */
- /* <Description> */
- /* Destroys a given FreeType library object and all of its childs, */
- /* including resources, drivers, faces, sizes, etc. */
- /* */
- /* <Input> */
- /* library :: A handle to the target library object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /* documentation is in freetype.h */
+
FT_EXPORT_DEF( FT_Error ) FT_Done_FreeType( FT_Library library )
{
if ( library )
--- a/src/base/ftmac.c
+++ b/src/base/ftmac.c
@@ -614,36 +614,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_New_Face_From_FOND */
- /* */
- /* <Description> */
- /* Creates a new face object from an FOND resource. */
- /* */
- /* <InOut> */
- /* library :: A handle to the library resource. */
- /* */
- /* <Input> */
- /* fond :: An FOND resource. */
- /* */
- /* face_index :: Only supported for the -1 `sanity check' special */
- /* case. */
- /* */
- /* <Output> */
- /* aface :: A handle to a new face object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <Notes> */
- /* This function can be used to create FT_Face objects from fonts */
- /* that are installed in the system like so: */
- /* */
- /* fond = GetResource( 'FOND', fontName ); */
- /* error = FT_New_Face_From_FOND( library, fond, 0, &face ); */
- /* */
+ /* documentation in ftmac.h */
+
FT_EXPORT_DEF( FT_Error ) FT_New_Face_From_FOND( FT_Library library,
Handle fond,
FT_Long face_index,
@@ -698,7 +670,7 @@
/* This is the Mac-specific implementation of FT_New_Face. In */
/* addition to the standard FT_New_Face() functionality, it also */
/* accepts pathnames to Mac suitcase files. For further */
- /* documentation see the original FT_New_Face() in ftobjs.c. */
+ /* documentation see the original FT_New_Face() in freetype.h. */
/* */
FT_EXPORT_DEF( FT_Error ) FT_New_Face( FT_Library library,
const char* pathname,
--- a/src/base/ftmm.c
+++ b/src/base/ftmm.c
@@ -30,23 +30,8 @@
#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. */
- /* */
+ /* documentation is in ftmm.h */
+
FT_EXPORT_DEF( FT_Error ) FT_Get_Multi_Master( FT_Face face,
FT_Multi_Master *amaster )
{
@@ -74,26 +59,8 @@
}
- /*************************************************************************/
- /* */
- /* <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. */
- /* */
+ /* documentation is in ftmm.h */
+
FT_EXPORT_DEF( FT_Error ) FT_Set_MM_Design_Coordinates(
FT_Face face,
FT_UInt num_coords,
@@ -123,27 +90,8 @@
}
- /*************************************************************************/
- /* */
- /* <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. */
- /* */
+ /* documentation is in ftmm.h */
+
FT_EXPORT_DEF( FT_Error ) FT_Set_MM_Blend_Coordinates(
FT_Face face,
FT_UInt num_coords,
--- a/src/base/ftnames.c
+++ b/src/base/ftnames.c
@@ -26,20 +26,8 @@
#ifdef TT_CONFIG_OPTION_SFNT_NAMES
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_Sfnt_Name_Count */
- /* */
- /* <Description> */
- /* Retrieves the number of name strings in the SFNT `name' table. */
- /* */
- /* <Input> */
- /* face :: A handle to the source face. */
- /* */
- /* <Return> */
- /* The number of strings in the `name' table. */
- /* */
+ /* documentation is in ftnames.h */
+
FT_EXPORT_DEF( FT_UInt ) FT_Get_Sfnt_Name_Count( FT_Face face )
{
return face && ( FT_IS_SFNT( face ) ? ((TT_Face)face)->num_names : 0 );
@@ -46,33 +34,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_Sfnt_Name */
- /* */
- /* <Description> */
- /* Retrieves a string of the SFNT `name' table for a given index. */
- /* */
- /* <Input> */
- /* face :: A handle to the source face. */
- /* */
- /* index :: The index of the `name' string. */
- /* */
- /* <Output> */
- /* aname :: The indexed FT_SfntName structure. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <Note> */
- /* The `string' array returned in the `aname' structure is not */
- /* null-terminated. */
- /* */
- /* Use FT_Get_Sfnt_Name_Count() to get the total number of available */
- /* `name' table entries, then do a loop until you get the right */
- /* platform, encoding, and name ID. */
- /* */
+ /* documentation is in ftnames.h */
+
FT_EXPORT_DEF( FT_Error ) FT_Get_Sfnt_Name( FT_Face face,
FT_UInt index,
FT_SfntName *aname )
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -283,17 +283,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Done_Stream */
- /* */
- /* <Description> */
- /* Closes and destroys a stream object. */
- /* */
- /* <Input> */
- /* stream :: The stream to be closed and destroyed. */
- /* */
+ /* documentation is in ftobjs.h */
+
FT_EXPORT_DEF( void ) FT_Done_Stream( FT_Stream stream )
{
if ( stream && stream->close )
@@ -857,31 +848,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Set_Transform */
- /* */
- /* <Description> */
- /* A function used to set the transformation that is applied to glyph */
- /* images just before they are converted to bitmaps in a glyph slot */
- /* when FT_Render_Glyph() is called. */
- /* */
- /* <InOut> */
- /* face :: A handle to the source face object. */
- /* */
- /* <Input> */
- /* matrix :: A pointer to the transformation's 2x2 matrix. Use 0 for */
- /* the identity matrix. */
- /* delta :: A pointer to the translation vector. Use 0 for the null */
- /* vector. */
- /* */
- /* <Note> */
- /* The transformation is only applied to scalable image formats after */
- /* the glyph has been loaded. It means that hinting is unaltered by */
- /* the transformation and is performed on the character size given in */
- /* the last call to FT_Set_Char_Sizes() or FT_Set_Pixel_Sizes(). */
- /* */
+ /* documentation is in freetype.h */
+
FT_EXPORT_DEF( void ) FT_Set_Transform( FT_Face face,
FT_Matrix* matrix,
FT_Vector* delta )
@@ -931,39 +899,8 @@
static FT_Renderer ft_lookup_glyph_renderer( FT_GlyphSlot slot );
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Load_Glyph */
- /* */
- /* <Description> */
- /* A function used to load a single glyph within a given glyph slot, */
- /* for a given size. */
- /* */
- /* <Input> */
- /* face :: A handle to the target face object where the glyph */
- /* will be loaded. */
- /* */
- /* glyph_index :: The index of the glyph in the font file. */
- /* */
- /* load_flags :: A flag indicating what to load for this glyph. The */
- /* FT_LOAD_XXX constants can be used to control the */
- /* glyph loading process (e.g., whether the outline */
- /* should be scaled, whether to load bitmaps or not, */
- /* whether to hint the outline, etc). */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <Note> */
- /* If the glyph image is not a bitmap, and if the bit flag */
- /* FT_LOAD_IGNORE_TRANSFORM is unset, the glyph image will be */
- /* transformed with the information passed to a previous call to */
- /* FT_Set_Transform. */
- /* */
- /* Note that this also transforms the `face.glyph.advance' field, but */
- /* *not* the values in `face.glyph.metrics'. */
- /* */
+ /* documentation is in freetype.h */
+
FT_EXPORT_DEF( FT_Error ) FT_Load_Glyph( FT_Face face,
FT_UInt glyph_index,
FT_Int load_flags )
@@ -1096,44 +1033,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Load_Char */
- /* */
- /* <Description> */
- /* A function used to load a single glyph within a given glyph slot, */
- /* for a given size, according to its character code. */
- /* */
- /* <Input> */
- /* face :: A handle to a target face object where the glyph */
- /* will be loaded. */
- /* */
- /* char_code :: The glyph's character code, according to the */
- /* current charmap used in the face. */
- /* */
- /* load_flags :: A flag indicating what to load for this glyph. The */
- /* FT_LOAD_XXX constants can be used to control the */
- /* glyph loading process (e.g., whether the outline */
- /* should be scaled, whether to load bitmaps or not, */
- /* whether to hint the outline, etc). */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <Note> */
- /* If the face has no current charmap, or if the character code */
- /* is not defined in the charmap, this function will return an */
- /* error. */
- /* */
- /* If the glyph image is not a bitmap, and if the bit flag */
- /* FT_LOAD_IGNORE_TRANSFORM is unset, the glyph image will be */
- /* transformed with the information passed to a previous call to */
- /* FT_Set_Transform(). */
- /* */
- /* Note that this also transforms the `face.glyph.advance' field, but */
- /* *not* the values in `face.glyph.metrics'. */
- /* */
+ /* documentation is in freetype.h */
+
FT_EXPORT_DEF( FT_Error ) FT_Load_Char( FT_Face face,
FT_ULong char_code,
FT_Int load_flags )
@@ -1296,44 +1197,8 @@
#ifndef macintosh
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_New_Face */
- /* */
- /* <Description> */
- /* Creates a new face object from a given resource and typeface index */
- /* using a pathname to the font file. */
- /* */
- /* <InOut> */
- /* library :: A handle to the library resource. */
- /* */
- /* <Input> */
- /* pathname :: A path to the font file. */
- /* */
- /* face_index :: The index of the face within the resource. The */
- /* first face has index 0. */
- /* <Output> */
- /* aface :: A handle to a new face object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <Note> */
- /* Unlike FreeType 1.x, this function automatically creates a glyph */
- /* slot for the face object which can be accessed directly through */
- /* `face->glyph'. */
- /* */
- /* Note that additional slots can be added to each face with the */
- /* FT_New_GlyphSlot() API function. Slots are linked in a single */
- /* list through their `next' field. */
- /* */
- /* FT_New_Face() can be used to determine and/or check the font */
- /* format of a given font resource. If the `face_index' field is */
- /* negative, the function will _not_ return any face handle in */
- /* `*face'. Its return value should be 0 if the resource is */
- /* recognized, or non-zero if not. */
- /* */
+ /* documentation is in freetype.h */
+
FT_EXPORT_DEF( FT_Error ) FT_New_Face( FT_Library library,
const char* pathname,
FT_Long face_index,
@@ -1355,46 +1220,8 @@
#endif /* !macintosh */
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_New_Memory_Face */
- /* */
- /* <Description> */
- /* Creates a new face object from a given resource and typeface index */
- /* using a font file already loaded into memory. */
- /* */
- /* <InOut> */
- /* library :: A handle to the library resource. */
- /* */
- /* <Input> */
- /* file_base :: A pointer to the beginning of the font data. */
- /* */
- /* file_size :: The size of the memory chunk used by the font data. */
- /* */
- /* face_index :: The index of the face within the resource. The */
- /* first face has index 0. */
- /* <Output> */
- /* face :: A handle to a new face object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <Note> */
- /* Unlike FreeType 1.x, this function automatically creates a glyph */
- /* slot for the face object which can be accessed directly through */
- /* `face->glyph'. */
- /* */
- /* Note that additional slots can be added to each face with the */
- /* FT_New_GlyphSlot() API function. Slots are linked in a single */
- /* list through their `next' field. */
- /* */
- /* FT_New_Memory_Face() can be used to determine and/or check the */
- /* font format of a given font resource. If the `face_index' field */
- /* is negative, the function will _not_ return any face handle in */
- /* `*face'. Its return value should be 0 if the resource is */
- /* recognized, or non-zero if not. */
- /* */
+ /* documentation is in freetype.h */
+
FT_EXPORT_DEF( FT_Error ) FT_New_Memory_Face( FT_Library library,
FT_Byte* file_base,
FT_Long file_size,
@@ -1416,46 +1243,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Open_Face */
- /* */
- /* <Description> */
- /* Opens a face object from a given resource and typeface index using */
- /* an `FT_Open_Args' structure. If the face object doesn't exist, it */
- /* will be created. */
- /* */
- /* <InOut> */
- /* library :: A handle to the library resource. */
- /* */
- /* <Input> */
- /* args :: A pointer to an `FT_Open_Args' structure which must */
- /* be filled by the caller. */
- /* */
- /* face_index :: The index of the face within the resource. The */
- /* first face has index 0. */
- /* <Output> */
- /* aface :: A handle to a new face object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <Note> */
- /* Unlike FreeType 1.x, this function automatically creates a glyph */
- /* slot for the face object which can be accessed directly through */
- /* `face->glyph'. */
- /* */
- /* Note that additional slots can be added to each face with the */
- /* FT_New_GlyphSlot() API function. Slots are linked in a single */
- /* list through their `next' field. */
- /* */
- /* FT_Open_Face() can be used to determine and/or check the font */
- /* format of a given font resource. If the `face_index' field is */
- /* negative, the function will _not_ return any face handle in */
- /* `*face'. Its return value should be 0 if the resource is */
- /* recognized, or non-zero if not. */
- /* */
+ /* documentation is in freetype.h */
+
FT_EXPORT_DEF( FT_Error ) FT_Open_Face( FT_Library library,
FT_Open_Args* args,
FT_Long face_index,
@@ -1629,38 +1418,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Attach_File */
- /* */
- /* <Description> */
- /* `Attaches' a given font file to an existing face. This is usually */
- /* to read additional information for a single face object. For */
- /* example, it is used to read the AFM files that come with Type 1 */
- /* fonts in order to add kerning data and other metrics. */
- /* */
- /* <InOut> */
- /* face :: The target face object. */
- /* */
- /* <Input> */
- /* filepathname :: An 8-bit pathname naming the `metrics' file. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <Note> */
- /* If your font file is in memory, or if you want to provide your */
- /* own input stream object, use FT_Attach_Stream(). */
- /* */
- /* The meaning of the `attach' action (i.e., what really happens when */
- /* the new file is read) is not fixed by FreeType itself. It really */
- /* depends on the font format (and thus the font driver). */
- /* */
- /* Client applications are expected to know what they are doing */
- /* when invoking this function. Most drivers simply do not implement */
- /* file attachments. */
- /* */
+ /* documentation is in freetype.h */
+
FT_EXPORT_DEF( FT_Error ) FT_Attach_File( FT_Face face,
const char* filepathname )
{
@@ -1679,32 +1438,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Attach_Stream */
- /* */
- /* <Description> */
- /* This function is similar to FT_Attach_File() with the exception */
- /* that it reads the attachment from an arbitrary stream. */
- /* */
- /* <Input> */
- /* face :: The target face object. */
- /* */
- /* parameters :: A pointer to an FT_Open_Args structure used to */
- /* describe the input stream to FreeType. */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <Note> */
- /* The meaning of the `attach' (i.e. what really happens when the */
- /* new file is read) is not fixed by FreeType itself. It really */
- /* depends on the font format (and thus the font driver). */
- /* */
- /* Client applications are expected to know what they are doing */
- /* when invoking this function. Most drivers simply do not implement */
- /* file attachments. */
- /* */
+ /* documentation is in freetype.h */
+
FT_EXPORT_DEF( FT_Error ) FT_Attach_Stream( FT_Face face,
FT_Open_Args* parameters )
{
@@ -1746,21 +1481,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Done_Face */
- /* */
- /* <Description> */
- /* Discards a given face object, as well as all of its child slots */
- /* and sizes. */
- /* */
- /* <Input> */
- /* face :: A handle to a target face object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /* documentation is in freetype.h */
+
FT_EXPORT_DEF( FT_Error ) FT_Done_Face( FT_Face face )
{
FT_Error error;
@@ -1792,23 +1514,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_New_Size */
- /* */
- /* <Description> */
- /* Creates a new size object from a given face object. */
- /* */
- /* <Input> */
- /* face :: A handle to a parent face object. */
- /* */
- /* <Output> */
- /* asize :: A handle to a new size object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /* documentation is in ftobjs.h */
+
FT_EXPORT_DEF( FT_Error ) FT_New_Size( FT_Face face,
FT_Size *asize )
{
@@ -1868,20 +1575,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Done_Size */
- /* */
- /* <Description> */
- /* Discards a given size object. */
- /* */
- /* <Input> */
- /* size :: A handle to a target size object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /* documentation is in ftobjs.h */
+
FT_EXPORT_DEF( FT_Error ) FT_Done_Size( FT_Size size )
{
FT_Error error;
@@ -1947,40 +1642,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Set_Char_Size */
- /* */
- /* <Description> */
- /* Sets the character dimensions of a given face object. The */
- /* `char_width' and `char_height' values are used for the width and */
- /* height, respectively, expressed in 26.6 fractional points. */
- /* */
- /* If the horizontal or vertical resolution values are zero, a */
- /* default value of 72dpi is used. Similarly, if one of the */
- /* character dimensions is zero, its value is set equal to the other. */
- /* */
- /* <InOut> */
- /* size :: A handle to a target size object. */
- /* */
- /* <Input> */
- /* char_width :: The character width, in 26.6 fractional points. */
- /* */
- /* char_height :: The character height, in 26.6 fractional */
- /* points. */
- /* */
- /* horz_resolution :: The horizontal resolution. */
- /* */
- /* vert_resolution :: The vertical resolution. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <Note> */
- /* When dealing with fixed-size faces (i.e., non-scalable formats), */
- /* use the function FT_Set_Pixel_Sizes(). */
- /* */
+ /* documentation is in freetype.h */
+
FT_EXPORT_DEF( FT_Error ) FT_Set_Char_Size( FT_Face face,
FT_F26Dot6 char_width,
FT_F26Dot6 char_height,
@@ -2051,44 +1714,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Set_Pixel_Sizes */
- /* */
- /* <Description> */
- /* Sets the character dimensions of a given face object. The width */
- /* and height are expressed in integer pixels. */
- /* */
- /* If one of the character dimensions is zero, its value is set equal */
- /* to the other. */
- /* */
- /* <InOut> */
- /* face :: A handle to the target face object. */
- /* */
- /* <Input> */
- /* pixel_width :: The character width, in integer pixels. */
- /* */
- /* pixel_height :: The character height, in integer pixels. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <Note> */
- /* The values of `pixel_width' and `pixel_height' correspond to the */
- /* pixel values of the _typographic_ character size, which are NOT */
- /* necessarily the same as the dimensions of the glyph `bitmap */
- /* cells". */
- /* */
- /* The `character size' is really the size of an abstract square */
- /* called the `EM', used to design the font. However, depending */
- /* on the font design, glyphs will be smaller or greater than the */
- /* EM. */
- /* */
- /* This means that setting the pixel size to, say, 8x8 doesn't */
- /* guarantee in any way that you will get glyph bitmaps that all fit */
- /* within an 8x8 cell (sometimes even far from it). */
- /* */
+ /* documentation is in freetype.h */
+
FT_EXPORT_DEF( FT_Error ) FT_Set_Pixel_Sizes( FT_Face face,
FT_UInt pixel_width,
FT_UInt pixel_height )
@@ -2141,39 +1768,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_Kerning */
- /* */
- /* <Description> */
- /* Returns the kerning vector between two glyphs of a same face. */
- /* */
- /* <Input> */
- /* face :: A handle to a source face object. */
- /* */
- /* left_glyph :: The index of the left glyph in the kern pair. */
- /* */
- /* right_glyph :: The index of the right glyph in the kern pair. */
- /* */
- /* kern_mode :: See FT_Kerning_Mode() for more information. */
- /* Determines the scale/dimension of the returned */
- /* kerning vector. */
- /* */
- /* <Output> */
- /* kerning :: The kerning vector. This is in font units for */
- /* scalable formats, and in pixels for fixed-sizes */
- /* formats. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <Note> */
- /* Only horizontal layouts (left-to-right & right-to-left) are */
- /* supported by this method. Other layouts, or more sophisticated */
- /* kernings, are out of the scope of this API function -- they can be */
- /* implemented through format-specific interfaces. */
- /* */
+ /* documentation is in freetype.h */
+
FT_EXPORT_DEF( FT_Error ) FT_Get_Kerning( FT_Face face,
FT_UInt left_glyph,
FT_UInt right_glyph,
@@ -2223,27 +1819,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Select_Charmap */
- /* */
- /* <Description> */
- /* Selects a given charmap by its encoding tag (as listed in */
- /* `freetype.h'). */
- /* */
- /* <Input> */
- /* face :: A handle to the source face object. */
- /* */
- /* encoding :: A handle to the selected charmap. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <Note> */
- /* This function will return an error if no charmap in the face */
- /* corresponds to the encoding queried here. */
- /* */
+ /* documentation is in freetype.h */
+
FT_EXPORT_DEF( FT_Error ) FT_Select_Charmap( FT_Face face,
FT_Encoding encoding )
{
@@ -2273,27 +1850,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Set_Charmap */
- /* */
- /* <Description> */
- /* Selects a given charmap for character code to glyph index */
- /* decoding. */
- /* */
- /* <Input> */
- /* face :: A handle to the source face object. */
- /* charmap :: A handle to the selected charmap. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <Note> */
- /* This function will return an error if the charmap is not part of */
- /* the face (i.e., if it is not listed in the face->charmaps[] */
- /* table). */
- /* */
+ /* documentation is in freetype.h */
+
FT_EXPORT_DEF( FT_Error ) FT_Set_Charmap( FT_Face face,
FT_CharMap charmap )
{
@@ -2322,23 +1880,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_Char_Index */
- /* */
- /* <Description> */
- /* Returns the glyph index of a given character code. This function */
- /* uses a charmap object to do the translation. */
- /* */
- /* <Input> */
- /* face :: A handle to the source face object. */
- /* */
- /* charcode :: The character code. */
- /* */
- /* <Return> */
- /* The glyph index. 0 means `undefined character code'. */
- /* */
+ /* documentation is in freetype.h */
+
FT_EXPORT_DEF( FT_UInt ) FT_Get_Char_Index( FT_Face face,
FT_ULong charcode )
{
@@ -2356,41 +1899,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_Glyph_Name */
- /* */
- /* <Description> */
- /* Retrieves the ASCII name of a given glyph in a face. This only */
- /* works for those faces where FT_HAS_GLYPH_NAME(face) returns true. */
- /* */
- /* <Input> */
- /* face :: A handle to a source face object. */
- /* */
- /* glyph_index :: The glyph index. */
- /* */
- /* buffer :: A pointer to a target buffer where the name will be */
- /* copied to. */
- /* */
- /* buffer_max :: The maximal number of bytes available in the */
- /* buffer. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <Note> */
- /* An error is returned if the face doesn't provide glyph names or if */
- /* the glyph index is invalid. In all cases of failure, the first */
- /* byte of `buffer' will be set to 0 to indicate an empty name. */
- /* */
- /* The glyph name is truncated to fit within the buffer if it is too */
- /* long. The returned string is always zero-terminated. */
- /* */
- /* This function is not compiled within the library if the config */
- /* macro FT_CONFIG_OPTION_NO_GLYPH_NAMES is defined in */
- /* `include/freetype/config/ftoptions.h' */
- /* */
+ /* documentation is in freetype.h */
+
FT_EXPORT_DEF( FT_Error ) FT_Get_Glyph_Name( FT_Face face,
FT_UInt glyph_index,
FT_Pointer buffer,
@@ -2428,32 +1938,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_Sfnt_Table */
- /* */
- /* <Description> */
- /* Returns a pointer to a given SFNT table within a face. */
- /* */
- /* <Input> */
- /* face :: A handle to the source face object. */
- /* tag :: An index of an SFNT table. */
- /* */
- /* <Return> */
- /* A type-less pointer to the table. This will be 0 in case of */
- /* error, or if the corresponding table was not found *OR* loaded */
- /* from the file. */
- /* */
- /* <Note> */
- /* The table is owned by the face object, and disappears with it. */
- /* */
- /* This function is only useful to access SFNT tables that are loaded */
- /* by the sfnt/truetype/opentype drivers. See the FT_Sfnt_Tag */
- /* enumeration in `tttables.h' for a list. */
- /* */
- /* You can load any table with a different function.. XXX */
- /* */
+ /* documentation is in tttables.h */
+
FT_EXPORT_DEF( void* ) FT_Get_Sfnt_Table( FT_Face face,
FT_Sfnt_Tag tag )
{
@@ -2631,29 +2117,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Get_Renderer */
- /* */
- /* <Description> */
- /* Retrieves the current renderer for a given glyph format. */
- /* */
- /* <Input> */
- /* library :: A handle to the library object. */
- /* */
- /* format :: The glyph format. */
- /* */
- /* <Return> */
- /* A renderer handle. 0 if none found. */
- /* */
- /* <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. */
- /* */
- /* To add a new renderer, simply use FT_Add_Module(). To retrieve a */
- /* renderer by its name, use FT_Get_Module(). */
- /* */
+ /* documentation is in ftrender.h */
+
FT_EXPORT_DEF( FT_Renderer ) FT_Get_Renderer( FT_Library library,
FT_Glyph_Format format )
{
@@ -2663,32 +2128,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Set_Renderer */
- /* */
- /* <Description> */
- /* Sets the current renderer to use, and set additional mode. */
- /* */
- /* <Input> */
- /* library :: A handle to the library object. */
- /* */
- /* renderer :: A handle to the renderer object. */
- /* */
- /* num_params :: The number of additional parameters. */
- /* */
- /* parameters :: Additional parameters. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <Note> */
- /* In case of success, the renderer will be used to convert glyph */
- /* images in the renderer's known format into bitmaps. */
- /* */
- /* This doesn't change the current renderer for other formats. */
- /* */
+ /* documentation is in ftrender.h */
+
FT_EXPORT( FT_Error ) FT_Set_Renderer( FT_Library library,
FT_Renderer renderer,
FT_UInt num_params,
@@ -2792,27 +2233,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Render_Glyph */
- /* */
- /* <Description> */
- /* Converts a given glyph image to a bitmap. It does so by */
- /* inspecting the glyph image format, find the relevant renderer, and */
- /* invoke it. */
- /* */
- /* <Input> */
- /* slot :: A handle to the glyph slot containing the image to */
- /* convert. */
- /* */
- /* render_mode :: This is the render mode used to render the glyph */
- /* image into a bitmap. See FT_Render_Mode for a list */
- /* of possible values. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /* documentation is in freetype.h */
+
FT_EXPORT_DEF( FT_Error ) FT_Render_Glyph( FT_GlyphSlot slot,
FT_UInt render_mode )
{
@@ -2888,26 +2310,8 @@
}
- /*************************************************************************/
- /* */
- /* <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. */
- /* */
+ /* documentation is in ftmodule.h */
+
FT_EXPORT_DEF( FT_Error ) FT_Add_Module( FT_Library library,
const FT_Module_Class* clazz )
{
@@ -3032,26 +2436,8 @@
}
- /*************************************************************************/
- /* */
- /* <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 :-) */
- /* */
+ /* documentation is in ftmodule.h */
+
FT_EXPORT_DEF( FT_Module ) FT_Get_Module( FT_Library library,
const char* module_name )
{
@@ -3112,25 +2498,8 @@
}
- /*************************************************************************/
- /* */
- /* <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. */
- /* */
+ /* documentation is in ftmodule.h */
+
FT_EXPORT_DEF( FT_Error ) FT_Remove_Module( FT_Library library,
FT_Module module )
{
@@ -3183,25 +2552,8 @@
/*************************************************************************/
- /*************************************************************************/
- /* */
- /* <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. */
- /* */
+ /* documentation is in ftmodule.h */
+
FT_EXPORT_DEF( FT_Error ) FT_New_Library( FT_Memory memory,
FT_Library *alibrary )
{
@@ -3234,21 +2586,8 @@
}
- /*************************************************************************/
- /* */
- /* <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. */
- /* */
+ /* documentation is in ftmodule.h */
+
FT_EXPORT_DEF( FT_Error ) FT_Done_Library( FT_Library library )
{
FT_Memory memory;
@@ -3286,28 +2625,8 @@
}
- /*************************************************************************/
- /* */
- /* <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. */
- /* */
+ /* documentation is in ftmodule.h */
+
FT_EXPORT_DEF( void ) FT_Set_Debug_Hook( FT_Library library,
FT_UInt hook_index,
FT_DebugHook_Func debug_hook )
--- a/src/base/ftoutln.c
+++ b/src/base/ftoutln.c
@@ -41,30 +41,8 @@
const FT_Outline null_outline = { 0, 0, 0, 0, 0, 0 };
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Outline_Decompose */
- /* */
- /* <Description> */
- /* Walks over an outline's structure to decompose it into individual */
- /* segments and Bezier arcs. This function is also able to emit */
- /* `move to' and `close to' operations to indicate the start and end */
- /* of new contours in the outline. */
- /* */
- /* <Input> */
- /* outline :: A pointer to the source target. */
- /* */
- /* interface :: A table of `emitters', i.e,. function pointers called */
- /* during decomposition to indicate path operations. */
- /* */
- /* user :: A typeless pointer which is passed to each emitter */
- /* during the decomposition. It can be used to store */
- /* the state during the decomposition. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means sucess. */
- /* */
+ /* documentation is in ftoutln.h */
+
FT_EXPORT_DEF( FT_Error ) FT_Outline_Decompose(
FT_Outline* outline,
const FT_Outline_Funcs* interface,
@@ -303,38 +281,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Outline_New */
- /* */
- /* <Description> */
- /* Creates a new outline of a given size. */
- /* */
- /* <Input> */
- /* library :: A handle to the library object from where the */
- /* outline is allocated. Note however that the new */
- /* outline will NOT necessarily be FREED, when */
- /* destroying the library, by FT_Done_FreeType(). */
- /* */
- /* numPoints :: The maximal number of points within the outline. */
- /* */
- /* numContours :: The maximal number of contours within the outline. */
- /* */
- /* <Output> */
- /* outline :: A handle to the new outline. NULL in case of */
- /* error. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <MT-Note> */
- /* No. */
- /* */
- /* <Note> */
- /* The reason why this function takes a `library' parameter is simply */
- /* to use the library's memory allocator. */
- /* */
+ /* documentation is in ftoutln.h */
+
FT_EXPORT_DEF( FT_Error ) FT_Outline_New( FT_Library library,
FT_UInt numPoints,
FT_Int numContours,
@@ -348,25 +296,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Outline_Copy */
- /* */
- /* <Description> */
- /* Copies an outline into another one. Both objects must have the */
- /* same sizes (number of points & number of contours) when this */
- /* function is called. */
- /* */
- /* <Input> */
- /* source :: A handle to the source outline. */
- /* */
- /* <Output> */
- /* target :: A handle to the target outline. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /* documentation is in ftoutln.h */
+
FT_EXPORT_DEF( FT_Error ) FT_Outline_Copy( FT_Outline* source,
FT_Outline *target )
{
@@ -418,33 +349,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Outline_Done */
- /* */
- /* <Description> */
- /* Destroys an outline created with FT_Outline_New(). */
- /* */
- /* <Input> */
- /* library :: A handle of the library object used to allocate the */
- /* outline. */
- /* */
- /* outline :: A pointer to the outline object to be discarded. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <MT-Note> */
- /* No. */
- /* */
- /* <Note> */
- /* If the outline's `owner' field is not set, only the outline */
- /* descriptor will be released. */
- /* */
- /* The reason why this function takes an `outline' parameter is */
- /* simply to use FT_Free(). */
- /* */
+ /* documentation is in ftoutln.h */
+
FT_EXPORT_DEF( FT_Error ) FT_Outline_Done( FT_Library library,
FT_Outline* outline )
{
@@ -457,32 +363,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Outline_Get_CBox */
- /* */
- /* <Description> */
- /* Returns an outline's `control box'. The control box encloses all */
- /* the outline's points, including Bezier control points. Though it */
- /* coincides with the exact bounding box for most glyphs, it can be */
- /* slightly larger in some situations (like when rotating an outline */
- /* which contains Bezier outside arcs). */
- /* */
- /* Computing the control box is very fast, while getting the bounding */
- /* box can take much more time as it needs to walk over all segments */
- /* and arcs in the outline. To get the latter, you can use the */
- /* `ftbbox' component which is dedicated to this single task. */
- /* */
- /* <Input> */
- /* outline :: A pointer to the source outline descriptor. */
- /* */
- /* <Output> */
- /* cbox :: The outline's control box. */
- /* */
- /* <MT-Note> */
- /* Yes. */
- /* */
+ /* documentation is in ftoutln.h */
+
FT_EXPORT_DEF( void ) FT_Outline_Get_CBox( FT_Outline* outline,
FT_BBox *acbox )
{
@@ -530,24 +412,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Outline_Translate */
- /* */
- /* <Description> */
- /* Applies a simple translation to the points of an outline. */
- /* */
- /* <Input> */
- /* outline :: A pointer to the target outline descriptor. */
- /* */
- /* xOffset :: The horizontal offset. */
- /* */
- /* yOffset :: The vertical offset. */
- /* */
- /* <MT-Note> */
- /* Yes. */
- /* */
+ /* documentation is in ftoutln.h */
+
FT_EXPORT_DEF( void ) FT_Outline_Translate( FT_Outline* outline,
FT_Pos xOffset,
FT_Pos yOffset )
@@ -565,22 +431,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Outline_Reverse */
- /* */
- /* <Description> */
- /* Reverses the drawing direction of an outline. This is used to */
- /* ensure consistent fill conventions for mirrored glyphs. */
- /* */
- /* <Input> */
- /* outline :: A pointer to the target outline descriptor. */
- /* */
- /* <Note> */
- /* This functions toggles the bit flag `ft_outline_reverse_fill' in */
- /* the outline's `flags' field. */
- /* */
+ /* documentation is in ftoutln.h */
+
FT_EXPORT_DEF( void ) FT_Outline_Reverse( FT_Outline* outline )
{
FT_UShort n;
@@ -634,40 +486,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Outline_Render */
- /* */
- /* <Description> */
- /* Renders an outline within a bitmap using the current scan-convert. */
- /* This functions uses an FT_Raster_Params structure as an argument, */
- /* allowing advanced features like direct composition, translucency, */
- /* etc. */
- /* */
- /* <Input> */
- /* library :: A handle to a FreeType library object. */
- /* */
- /* outline :: A pointer to the source outline descriptor. */
- /* */
- /* params :: A pointer to a FT_Raster_Params structure used to */
- /* describe the rendering operation. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <MT-Note> */
- /* YES. Rendering is synchronized, so that concurrent calls to the */
- /* scan-line converter will be serialized. */
- /* */
- /* <Note> */
- /* You should know what you are doing and how FT_Raster_Params works */
- /* to use this function. */
- /* */
- /* The field `params.source' will be set to `outline' before the scan */
- /* converter is called, which means that the value you give to it is */
- /* actually ignored. */
- /* */
+ /* documentation is in ftoutln.h */
+
FT_EXPORT_DEF( FT_Error ) FT_Outline_Render( FT_Library library,
FT_Outline* outline,
FT_Raster_Params* params )
@@ -716,35 +536,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Outline_Get_Bitmap */
- /* */
- /* <Description> */
- /* Renders an outline within a bitmap. The outline's image is simply */
- /* OR-ed to the target bitmap. */
- /* */
- /* <Input> */
- /* library :: A handle to a FreeType library object. */
- /* */
- /* outline :: A pointer to the source outline descriptor. */
- /* */
- /* map :: A pointer to the target bitmap descriptor. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <MT-Note> */
- /* YES. Rendering is synchronized, so that concurrent calls to the */
- /* scan-line converter will be serialized. */
- /* */
- /* <Note> */
- /* This function does NOT CREATE the bitmap, it only renders an */
- /* outline image within the one you pass to it! */
- /* */
- /* It will use the raster correponding to the default glyph format. */
- /* */
+ /* documentation is in ftoutln.h */
+
FT_EXPORT_DEF( FT_Error ) FT_Outline_Get_Bitmap( FT_Library library,
FT_Outline* outline,
FT_Bitmap *abitmap )
@@ -767,26 +560,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Vector_Transform */
- /* */
- /* <Description> */
- /* Transforms a single vector through a 2x2 matrix. */
- /* */
- /* <InOut> */
- /* vector :: The target vector to transform. */
- /* */
- /* <Input> */
- /* matrix :: A pointer to the source 2x2 matrix. */
- /* */
- /* <MT-Note> */
- /* Yes. */
- /* */
- /* <Note> */
- /* The result is undefined if either `vector' or `matrix' is invalid. */
- /* */
+ /* documentation is in ftoutln.h */
+
FT_EXPORT_DEF( void ) FT_Vector_Transform( FT_Vector* vector,
FT_Matrix* matrix )
{
@@ -807,27 +582,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Outline_Transform */
- /* */
- /* <Description> */
- /* Applies a simple 2x2 matrix to all of an outline's points. Useful */
- /* for applying rotations, slanting, flipping, etc. */
- /* */
- /* <Input> */
- /* outline :: A pointer to the target outline descriptor. */
- /* */
- /* matrix :: A pointer to the transformation matrix. */
- /* */
- /* <MT-Note> */
- /* Yes. */
- /* */
- /* <Note> */
- /* You can use FT_Outline_Translate() if you need to translate the */
- /* outline's points. */
- /* */
+ /* documentation is in ftoutln.h */
+
FT_EXPORT_DEF( void ) FT_Outline_Transform( FT_Outline* outline,
FT_Matrix* matrix )
{
@@ -838,5 +594,6 @@
for ( ; vec < limit; vec++ )
FT_Vector_Transform( vec, matrix );
}
+
/* END */
--- a/src/base/ftsystem.c
+++ b/src/base/ftsystem.c
@@ -213,23 +213,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_New_Stream */
- /* */
- /* <Description> */
- /* Creates a new stream object. */
- /* */
- /* <Input> */
- /* filepathname :: The name of the stream (usually a file) to be */
- /* opened. */
- /* */
- /* stream :: A pointer to the stream object. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
+ /* documentation is in ftobjs.h */
+
FT_EXPORT_DEF( FT_Error ) FT_New_Stream( const char* filepathname,
FT_Stream astream )
{
@@ -267,17 +252,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_New_Memory */
- /* */
- /* <Description> */
- /* Creates a new memory object. */
- /* */
- /* <Return> */
- /* A pointer to the new memory object. 0 in case of error. */
- /* */
+ /* documentation is in ftobjs.h */
+
FT_EXPORT_DEF( FT_Memory ) FT_New_Memory( void )
{
FT_Memory memory;
@@ -296,17 +272,8 @@
}
- /*************************************************************************/
- /* */
- /* <Function> */
- /* FT_Done_Memory */
- /* */
- /* <Description> */
- /* Discards memory manager. */
- /* */
- /* <Input> */
- /* memory :: A handle to the memory manager. */
- /* */
+ /* documentation is in ftobjs.h */
+
FT_EXPORT_DEF( void ) FT_Done_Memory( FT_Memory memory )
{
free( memory );
--- a/src/sfnt/sfobjs.c
+++ b/src/sfnt/sfobjs.c
@@ -19,10 +19,12 @@
#ifdef FT_FLAT_COMPILE
#include "sfobjs.h"
+#include "ttload.h"
#else
#include <sfnt/sfobjs.h>
+#include <sfnt/ttload.h>
#endif
@@ -30,6 +32,7 @@
#include <freetype/internal/sfnt.h>
#include <freetype/internal/psnames.h>
#include <freetype/ttnameid.h>
+#include <freetype/tttags.h>
#include <freetype/internal/tterrors.h>
--- a/src/smooth/ftgrays.h
+++ b/src/smooth/ftgrays.h
@@ -31,7 +31,7 @@
/*************************************************************************/
/* */
/* To make ftgrays.h independent from configuration files we check */
- /* whether FT_EXPORT has been defined already. */
+ /* whether FT_EXPORT_VAR has been defined already. */
/* */
/* On some systems and compilers (Win32 mostly), an extra keyword is */
/* necessary to compile the library as a DLL. */
--- a/src/truetype/ttinterp.c
+++ b/src/truetype/ttinterp.c
@@ -765,25 +765,8 @@
};
- /*************************************************************************/
- /* */
- /* <Function> */
- /* TT_New_Context */
- /* */
- /* <Description> */
- /* Queries the face context for a given font. Note that there is */
- /* now a _single_ execution context in the TrueType driver which is */
- /* shared among faces. */
- /* */
- /* <Input> */
- /* face :: A handle to the source face object. */
- /* */
- /* <Return> */
- /* A handle to the execution context. Initialized for `face'. */
- /* */
- /* <Note> */
- /* Only the glyph loader and debugger should call this function. */
- /* */
+ /* documentation is in ttinterp.h */
+
FT_EXPORT_DEF( TT_ExecContext ) TT_New_Context( TT_Face face )
{
TT_Driver driver;
@@ -6794,27 +6777,8 @@
/*************************************************************************/
- /*************************************************************************/
- /* */
- /* <Function> */
- /* TT_RunIns */
- /* */
- /* <Description> */
- /* Executes one or more instruction in the execution context. This */
- /* is the main function of the TrueType opcode interpreter. */
- /* */
- /* <Input> */
- /* exec :: A handle to the target execution context. */
- /* */
- /* <Return> */
- /* FreeType error code. 0 means success. */
- /* */
- /* <Note> */
- /* Only the object manager and debugger should call this function. */
- /* */
- /* This function is publicly exported because it is directly */
- /* invoked by the TrueType debugger. */
- /* */
+ /* documentation is in ttinterp.h */
+
FT_EXPORT_DEF( FT_Error ) TT_RunIns( TT_ExecContext exc )
{
FT_Long ins_counter = 0; /* executed instructions counter */
--- a/src/truetype/ttinterp.h
+++ b/src/truetype/ttinterp.h
@@ -243,8 +243,29 @@
FT_Error TT_Clear_CodeRange( TT_ExecContext exec,
FT_Int range );
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* TT_New_Context */
+ /* */
+ /* <Description> */
+ /* Queries the face context for a given font. Note that there is */
+ /* now a _single_ execution context in the TrueType driver which is */
+ /* shared among faces. */
+ /* */
+ /* <Input> */
+ /* face :: A handle to the source face object. */
+ /* */
+ /* <Return> */
+ /* A handle to the execution context. Initialized for `face'. */
+ /* */
+ /* <Note> */
+ /* Only the glyph loader and debugger should call this function. */
+ /* */
FT_EXPORT( TT_ExecContext ) TT_New_Context( TT_Face face );
+
FT_LOCAL
FT_Error TT_Done_Context( TT_ExecContext exec );
@@ -265,6 +286,28 @@
FT_Error TT_Run_Context( TT_ExecContext exec,
FT_Bool debug );
+
+ /*************************************************************************/
+ /* */
+ /* <Function> */
+ /* TT_RunIns */
+ /* */
+ /* <Description> */
+ /* Executes one or more instruction in the execution context. This */
+ /* is the main function of the TrueType opcode interpreter. */
+ /* */
+ /* <Input> */
+ /* exec :: A handle to the target execution context. */
+ /* */
+ /* <Return> */
+ /* FreeType error code. 0 means success. */
+ /* */
+ /* <Note> */
+ /* Only the object manager and debugger should call this function. */
+ /* */
+ /* This function is publicly exported because it is directly */
+ /* invoked by the TrueType debugger. */
+ /* */
FT_EXPORT( FT_Error ) TT_RunIns( TT_ExecContext exec );
--- a/src/type1/t1driver.h
+++ b/src/type1/t1driver.h
@@ -26,7 +26,7 @@
#endif
- FT_EXPORT_VAR( const FT_Driver_Class ) t1_driver_class;
+ FT_EXPORT_VAR( const FT_Driver_Class ) t1_driver_class;
#ifdef __cplusplus
}