Some formatting.

Fixed some data types/added header files to remove compiler warnings.

Added trivial input data check to FT_Outline_Get_BBox().

Fixed type1z -> type1 file inclusions.
This commit is contained in:
Werner Lemberg 2000-10-26 10:04:16 +00:00
parent 205fc3faf2
commit ddbb8e7b6a
18 changed files with 54 additions and 49 deletions

View File

@ -56,10 +56,10 @@
/* bbox :: The outline's exact bounding box. */ /* bbox :: The outline's exact bounding box. */
/* */ /* */
/* <Return> */ /* <Return> */
/* Error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
FT_EXPORT_DEF(FT_Error) FT_Outline_Get_BBox( FT_Outline* outline, FT_EXPORT_DEF( FT_Error ) FT_Outline_Get_BBox( FT_Outline* outline,
FT_BBox *abbox ); FT_BBox* bbox );
#ifdef __cplusplus #ifdef __cplusplus

View File

@ -1399,7 +1399,7 @@
FT_Bool vertical_info; FT_Bool vertical_info;
TT_VertHeader vertical; /* TT Vertical header, if present */ TT_VertHeader vertical; /* TT Vertical header, if present */
FT_Int num_names; /* number of name records */ FT_UShort num_names; /* number of name records */
TT_NameTable name_table; /* name table */ TT_NameTable name_table; /* name table */
TT_OS2 os2; /* TrueType OS/2 table */ TT_OS2 os2; /* TrueType OS/2 table */
@ -1437,7 +1437,7 @@
TT_Gasp gasp; /* the `gasp' table */ TT_Gasp gasp; /* the `gasp' table */
/* PCL 5 table */ /* PCL 5 table */
TT_PCLT pclt; TT_PCLT pclt;
/* embedded bitmaps support */ /* embedded bitmaps support */
FT_Int num_sbit_strikes; FT_Int num_sbit_strikes;

View File

@ -15,14 +15,12 @@
/* */ /* */
/***************************************************************************/ /***************************************************************************/
/*************************************************************************/ /*************************************************************************/
/* */ /* */
/* This component has a _single_ role: to compute exact outline bounding */ /* This component has a _single_ role: to compute exact outline bounding */
/* boxes. */ /* boxes. */
/* */ /* */
/* It is separated from the rest of the engine for various technical */
/* reasons. It may well be integrated in `ftoutln' later. */
/* */
/*************************************************************************/ /*************************************************************************/
@ -30,6 +28,7 @@
#include <freetype/ftimage.h> #include <freetype/ftimage.h>
#include <freetype/ftoutln.h> #include <freetype/ftoutln.h>
typedef struct TBBox_Rec_ typedef struct TBBox_Rec_
{ {
FT_Vector last; FT_Vector last;
@ -45,8 +44,8 @@
/* */ /* */
/* <Description> */ /* <Description> */
/* This function is used as a `move_to' and `line_to' emitter during */ /* This function is used as a `move_to' and `line_to' emitter during */
/* FT_Outline_Decompose. It simply records the destination point in */ /* FT_Outline_Decompose(). It simply records the destination point */
/* `user->last'. */ /* in `user->last'. */
/* */ /* */
/* <Input> */ /* <Input> */
/* to :: A pointer to the destination vector. */ /* to :: A pointer to the destination vector. */
@ -55,7 +54,7 @@
/* user :: A pointer to the current walk context. */ /* user :: A pointer to the current walk context. */
/* */ /* */
/* <Return> */ /* <Return> */
/* Error code. 0 means success. */ /* Always 0. Needed for the interface only. */
/* */ /* */
static static
int BBox_Move_To( FT_Vector* to, int BBox_Move_To( FT_Vector* to,
@ -151,7 +150,7 @@
/* user :: The address of the current walk context. */ /* user :: The address of the current walk context. */
/* */ /* */
/* <Return> */ /* <Return> */
/* Error code. 0 means success. */ /* Always 0. Needed for the interface only. */
/* */ /* */
/* <Note> */ /* <Note> */
/* In the case of a non-monotonous arc, we compute directly the */ /* In the case of a non-monotonous arc, we compute directly the */
@ -273,7 +272,7 @@
Suite: Suite:
; ;
} while (arc >= stack); } while ( arc >= stack );
} }
@ -297,7 +296,7 @@
/* user :: The address of the current walk context. */ /* user :: The address of the current walk context. */
/* */ /* */
/* <Return> */ /* <Return> */
/* Error code. 0 means success. */ /* Always 0. Needed for the interface only. */
/* */ /* */
/* <Note> */ /* <Note> */
/* In the case of a non-monotonous arc, we don't compute directly */ /* In the case of a non-monotonous arc, we don't compute directly */
@ -354,21 +353,24 @@
/* abbox :: A pointer to the outline's exact bounding box. */ /* abbox :: A pointer to the outline's exact bounding box. */
/* */ /* */
/* <Return> */ /* <Return> */
/* Error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
FT_EXPORT_FUNC( FT_Error ) FT_Outline_Get_BBox( FT_Outline* outline, FT_EXPORT_FUNC( FT_Error ) FT_Outline_Get_BBox( FT_Outline* outline,
FT_BBox* abbox ) FT_BBox* abbox )
{ {
FT_BBox cbox; FT_BBox cbox;
FT_BBox bbox; FT_BBox bbox;
FT_Vector* vec; FT_Vector* vec;
FT_UShort n; FT_UShort n;
/* if outline is empty, return (0,0,0,0) */ if ( !abbox )
return FT_Err_Invalid_Argument;
if ( !outline ) if ( !outline )
return FT_Err_Invalid_Outline; return FT_Err_Invalid_Outline;
/* if outline is empty, return (0,0,0,0) */
if ( outline->n_points == 0 || outline->n_contours <= 0 ) if ( outline->n_points == 0 || outline->n_contours <= 0 )
{ {
abbox->xMin = abbox->xMax = 0; abbox->xMin = abbox->xMax = 0;

View File

@ -48,7 +48,7 @@ BASE_SRC := $(BASE_)ftcalc.c \
# #
BASE_EXT_SRC := $(BASE_)ftglyph.c \ BASE_EXT_SRC := $(BASE_)ftglyph.c \
$(BASE_)ftmm.c \ $(BASE_)ftmm.c \
$(BASE_)ftbbox.c $(BASE_)ftbbox.c
# Default extensions objects # Default extensions objects
# #

View File

@ -24,6 +24,8 @@
#include <string.h> #include <string.h>
#include <freetype/internal/ftmemory.h>
/*************************************************************************/ /*************************************************************************/
/*************************************************************************/ /*************************************************************************/

View File

@ -68,7 +68,7 @@
}; };
LOCAL_FUNC static
const PSAux_Interface psaux_interface = const PSAux_Interface psaux_interface =
{ {
&ps_table_funcs, &ps_table_funcs,

View File

@ -269,7 +269,8 @@
} }
static const PSNames_Interface psnames_interface = static
const PSNames_Interface psnames_interface =
{ {
#ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST #ifdef FT_CONFIG_OPTION_ADOBE_GLYPH_LIST

View File

@ -169,7 +169,7 @@
FT_Error error; FT_Error error;
FT_Int num_glyphs; FT_Int num_glyphs;
FT_Int num_names; FT_UShort num_names;
FT_UShort* glyph_indices = 0; FT_UShort* glyph_indices = 0;
FT_Char** name_strings = 0; FT_Char** name_strings = 0;
@ -229,7 +229,7 @@
/* now load the name strings */ /* now load the name strings */
{ {
FT_Int n; FT_UShort n;
if ( ALLOC_ARRAY( name_strings, num_names, FT_Char* ) ) if ( ALLOC_ARRAY( name_strings, num_names, FT_Char* ) )
@ -264,7 +264,7 @@
Fail1: Fail1:
{ {
FT_Int n; FT_UShort n;
for ( n = 0; n < num_names; n++ ) for ( n = 0; n < num_names; n++ )
@ -401,7 +401,7 @@
case 0x00020000L: case 0x00020000L:
{ {
TT_Post_20* table = &names->names.format_20; TT_Post_20* table = &names->names.format_20;
FT_UInt n; FT_UShort n;
FREE( table->glyph_indices ); FREE( table->glyph_indices );

View File

@ -1,6 +1,6 @@
/***************************************************************************/ /***************************************************************************/
/* */ /* */
/* type1z.c */ /* type1.c */
/* */ /* */
/* FreeType experimental Type 1 driver component (body only). */ /* FreeType experimental Type 1 driver component (body only). */
/* */ /* */
@ -33,14 +33,14 @@
#else /* FT_FLAT_COMPILE */ #else /* FT_FLAT_COMPILE */
#include <type1z/z1parse.c> #include <type1/z1parse.c>
#include <type1z/z1load.c> #include <type1/z1load.c>
#include <type1z/z1objs.c> #include <type1/z1objs.c>
#include <type1z/z1driver.c> #include <type1/z1driver.c>
#include <type1z/z1gload.c> #include <type1/z1gload.c>
#ifndef Z1_CONFIG_OPTION_NO_AFM #ifndef Z1_CONFIG_OPTION_NO_AFM
#include <type1z/z1afm.c> #include <type1/z1afm.c>
#endif #endif
#endif /* FT_FLAT_COMPILE */ #endif /* FT_FLAT_COMPILE */

View File

@ -22,7 +22,7 @@
#else #else
#include <type1z/z1afm.h> #include <type1/z1afm.h>
#endif #endif

View File

@ -26,7 +26,7 @@
#else #else
#include <type1z/z1objs.h> #include <type1/z1objs.h>
#endif #endif

View File

@ -25,10 +25,10 @@
#else #else
#include <type1z/z1driver.h> #include <type1/z1driver.h>
#include <type1z/z1gload.h> #include <type1/z1gload.h>
#include <type1z/z1load.h> #include <type1/z1load.h>
#include <type1z/z1afm.h> #include <type1/z1afm.h>
#endif #endif

View File

@ -22,7 +22,7 @@
#else #else
#include <type1z/z1gload.h> #include <type1/z1gload.h>
#endif #endif

View File

@ -26,7 +26,7 @@
#else #else
#include <type1z/z1objs.h> #include <type1/z1objs.h>
#endif #endif

View File

@ -75,7 +75,7 @@
#else #else
#include <type1z/z1load.h> #include <type1/z1load.h>
#endif #endif
@ -1388,7 +1388,7 @@
#else #else
#include <type1z/z1tokens.h> #include <type1/z1tokens.h>
#endif #endif

View File

@ -30,7 +30,7 @@
#else #else
#include <type1z/z1parse.h> #include <type1/z1parse.h>
#endif #endif

View File

@ -28,9 +28,9 @@
#else #else
#include <type1z/z1gload.h> #include <type1/z1gload.h>
#include <type1z/z1load.h> #include <type1/z1load.h>
#include <type1z/z1afm.h> #include <type1/z1afm.h>
#endif #endif

View File

@ -46,7 +46,7 @@
#else #else
#include <type1z/z1parse.h> #include <type1/z1parse.h>
#endif #endif