Formatting.

This commit is contained in:
Werner Lemberg 2001-06-19 23:03:41 +00:00
parent 0b3a99153a
commit 8eb0353fec
44 changed files with 348 additions and 285 deletions

View File

@ -1,20 +1,35 @@
2001-06-19 David Turner <david@freetype.org> 2001-06-19 David Turner <david@freetype.org>
* builds/win32/visualc/freetype.dsp, builds/win32/visualc/index.html: * builds/win32/visualc/freetype.dsp, builds/win32/visualc/index.html:
updated the Visual C++ project (for the 2.0.4 release) Updated the Visual C++ project (for the 2.0.4 release).
* builds/unix/detect.mk: added rule for AIX detection (which uses * builds/unix/detect.mk: Added rule for AIX detection (which uses
/usr/sbin/init instead of /sbin/init, go figure..) /usr/sbin/init instead of /sbin/init).
* include/freetype/fterrors.h: updated some of the error macros to * include/freetype/fterrors.h, src/*/*err*.h: Updated some of the
simplify Werner's latest tricks :o) error macros to simplify handling of new error scheme.
* include/freetype/freetype.h (FT_New_Memory_Face): updated docs 2001-06-19 Werner Lemberg <wl@gnu.org>
Removing _lots_ of compiler warnings when the most pedantic warning * include/freetype/fttypes.h (FT_ERROR_MODULE): New macro.
levels of Visual C++ and Borland C++ are used. Too many files to be
listed here.., but FT2 now compiles without warnings with VC++ and 2001-06-19 David Turner <david@freetype.org>
the "/W4" warning level (lint-style)
Removing _lots_ of compiler warnings when the most pedantic warning
levels of Visual C++ and Borland C++ are used. Too many files to be
listed here, but FT2 now compiles without warnings with VC++ and the
"/W4" warning level (lint-style).
* include/freetype/freetype.h (FT_New_Memory_Face): Updated
documentation.
* include/freetype/fttypes.h (FT_BOOL): New macro.
* include/freetype/internal/ftdebug.h: Add #pragma for Visual C++
to suppress warning.
* include/freetype/internal/ftstream.h (FT_GET_SHORT_{BE,LE},
FT_GET_OFF3_{BE,LE}, FT_GET_LONG_{BE,LE}): New macros.
(NEXT_*): Use them.
* src/autohint/ahglobal.c: Include FT_INTERNAL_DEBUG_H.
(FT_New_Memory_Face): Add `const' to function declaration.
2001-06-18 Werner Lemberg <wl@gnu.org> 2001-06-18 Werner Lemberg <wl@gnu.org>

View File

@ -1536,10 +1536,10 @@ FT_BEGIN_HEADER
/* FreeType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
/* <Note> */ /* <Note> */
/* the font data bytes are used _directly_ by the @FT_Face object. */ /* The font data bytes are used _directly_ by the @FT_Face object. */
/* this means that they're not copied, and that the client is */ /* This means that they are not copied, and that the client is */
/* responsible for releasing/destroying them _after_ the */ /* responsible for releasing/destroying them _after_ the */
/* corresponding call to @FT_Done_Face */ /* corresponding call to @FT_Done_Face . */
/* */ /* */
/* Unlike FreeType 1.x, this function automatically creates a glyph */ /* Unlike FreeType 1.x, this function automatically creates a glyph */
/* slot for the face object which can be accessed directly through */ /* slot for the face object which can be accessed directly through */

View File

@ -13,81 +13,88 @@
/* this file you indicate that you have read the license and */ /* this file you indicate that you have read the license and */
/* understand and accept it fully. */ /* understand and accept it fully. */
/* */ /* */
/* */
/* This special header file is used to define the FT2 enumeration */
/* constants. It can also be used to generate error message strings */
/* with a small macro trick explained below. */
/* */
/* I - Error Formats: */
/* ------------------ */
/* */
/* Since release 2.1, the error constants have changed. The lower byte */
/* of the error value gives the "generic" error code, while the higher */
/* bytes indicates in which module the error occured. */
/* */
/* You can use the macro FT_ERROR_BASE(x) macro to extract the */
/* generic error code from a FT_Error */
/* */
/* The configuration macro FT_CONFIG_OPTION_USE_MODULE_ERRORS can */
/* be undefined in ftoption.h in order to make the higher byte always */
/* zero, in case you'd need to be compatible with previous versions */
/* of FT2. */
/* */
/* */
/* II - Error Message strings: */
/* --------------------------- */
/* */
/* The error definitions below are made through special macros that */
/* allow client applications to build a table of error message strings */
/* if they need it. The strings are not included in a normal build of */
/* FT2 to save space (most client apps do not use them) */
/* */
/* To do so, you'll need to define the following macros before */
/* including this file: */
/* */
/* FT_ERROR_START_LIST :: */
/* this macro is called before anything else to define the */
/* start of the error list. It is followed by several */
/* FT_ERROR_DEF calls (see below) */
/* */
/* FT_ERROR_DEF( e, v, s ) :: */
/* this macro is called to define one single error. */
/* 'e' is the error code identifier (e.g. FT_Err_Invalid_Argument) */
/* 'v' is the error numerical value */
/* 's' is the corresponding error string */
/* */
/* FT_ERROR_END_LIST :: */
/* this macro is used to end the list. */
/* */
/* Additionally, you'll need to undefine __FTERRORS_H__ before */
/* #including this file. */
/* */
/* Here's a simple example: */
/* */
/* { */
/* #undef __FTERRORS_H__ */
/* #define FT_ERRORDEF( e, v, s ) { e, s }, */
/* #define FT_ERROR_START_LIST { */
/* #define FT_ERROR_END_LIST { 0, 0 } }; */
/* */
/* const struct */
/* { */
/* int err_code; */
/* const char* err_msg */
/* } ft_errors[] = */
/* */
/* #include FT_ERRORS_H */
/* } */
/* */
/* */
/***************************************************************************/ /***************************************************************************/
/*************************************************************************/
/* */
/* This special header file is used to define the FT2 enumeration */
/* constants. It can also be used to generate error message strings */
/* with a small macro trick explained below. */
/* */
/* I - Error Formats */
/* ----------------- */
/* */
/* Since release 2.1, the error constants have changed. The lower */
/* byte of the error value gives the "generic" error code, while the */
/* higher byte indicates in which module the error occured. */
/* */
/* You can use the macro FT_ERROR_BASE(x) macro to extract the generic */
/* error code from an FT_Error value. */
/* */
/* The configuration macro FT_CONFIG_OPTION_USE_MODULE_ERRORS can be */
/* undefined in ftoption.h in order to make the higher byte always */
/* zero, in case you need to be compatible with previous versions of */
/* FreeType 2. */
/* */
/* */
/* II - Error Message strings */
/* -------------------------- */
/* */
/* The error definitions below are made through special macros that */
/* allow client applications to build a table of error message strings */
/* if they need it. The strings are not included in a normal build of */
/* FreeType 2 to save space (most client applications do not use */
/* them). */
/* */
/* To do so, you have to define the following macros before including */
/* this file: */
/* */
/* FT_ERROR_START_LIST :: */
/* This macro is called before anything else to define the start of */
/* the error list. It is followed by several FT_ERROR_DEF calls */
/* (see below). */
/* */
/* FT_ERROR_DEF( e, v, s ) :: */
/* This macro is called to define one single error. */
/* `e' is the error code identifier (e.g. FT_Err_Invalid_Argument). */
/* `v' is the error numerical value. */
/* `s' is the corresponding error string. */
/* */
/* FT_ERROR_END_LIST :: */
/* This macro ends the list. */
/* */
/* Additionally, you have to undefine __FTERRORS_H__ before #including */
/* this file. */
/* */
/* Here is a simple example: */
/* */
/* { */
/* #undef __FTERRORS_H__ */
/* #define FT_ERRORDEF( e, v, s ) { e, s }, */
/* #define FT_ERROR_START_LIST { */
/* #define FT_ERROR_END_LIST { 0, 0 } }; */
/* */
/* const struct */
/* { */
/* int err_code; */
/* const char* err_msg */
/* } ft_errors[] = */
/* */
/* #include FT_ERRORS_H */
/* } */
/* */
/*************************************************************************/
#ifndef __FTERRORS_H__ #ifndef __FTERRORS_H__
#define __FTERRORS_H__ #define __FTERRORS_H__
/* include module base error codes */
/* include module base error codes */
#include FT_MODULE_ERRORS_H #include FT_MODULE_ERRORS_H
/*******************************************************************/ /*******************************************************************/
/*******************************************************************/ /*******************************************************************/
/***** *****/ /***** *****/
@ -95,73 +102,76 @@
/***** *****/ /***** *****/
/*******************************************************************/ /*******************************************************************/
/*******************************************************************/ /*******************************************************************/
#undef FT_NEED_EXTERN_C #undef FT_NEED_EXTERN_C
#define FT_ERR_XCAT(x,y) x ## y #define FT_ERR_XCAT( x, y ) x ## y
#define FT_ERR_CAT(x,y) FT_ERR_XCAT(x,y) #define FT_ERR_CAT( x, y ) FT_ERR_XCAT( x, y )
/* FT_ERR_PREFIX is used as a prefix for error identifiers */ /* FT_ERR_PREFIX is used as a prefix for error identifiers. */
/* by default, we use "FT_Err_" */ /* By default, we use `FT_Err_'. */
/* */ /* */
#ifndef FT_ERR_PREFIX #ifndef FT_ERR_PREFIX
# define FT_ERR_PREFIX FT_Err_ #define FT_ERR_PREFIX FT_Err_
#endif #endif
/* FT_ERR_BASE is used as the base for module-specific errors. */
/* FT_ERR_BASE is used as the base for module-specific errors */ /* */
/* */
#ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS #ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS
# ifndef FT_ERR_BASE
# define FT_ERR_BASE FT_Mod_Err_Base #ifndef FT_ERR_BASE
# endif #define FT_ERR_BASE FT_Mod_Err_Base
#else
# define FT_ERR_BASE 0
#endif #endif
#else
#define FT_ERR_BASE 0
#endif /* FT_CONFIG_OPTION_USE_MODULE_ERRORS */
/* if FT_ERRORDEF is not defined, we need to define a simple enumeration */ /* If FT_ERRORDEF is not defined, we need to define a simple */
/* type.. */ /* enumeration type. */
/* */ /* */
#ifndef FT_ERRORDEF #ifndef FT_ERRORDEF
# define FT_ERRORDEF( e, v, s ) e = v, #define FT_ERRORDEF( e, v, s ) e = v,
# define FT_ERROR_START_LIST enum { #define FT_ERROR_START_LIST enum {
# define FT_ERROR_END_LIST FT_ERR_CAT(FT_ERR_PREFIX,Max) }; #define FT_ERROR_END_LIST FT_ERR_CAT( FT_ERR_PREFIX, Max ) };
# ifdef __cplusplus #ifdef __cplusplus
# define FT_NEED_EXTERN_C #define FT_NEED_EXTERN_C
extern "C" { extern "C" {
# endif #endif
#endif /* !FT_ERRORDEF */ #endif /* !FT_ERRORDEF */
/* this macro is used to define an error */ /* this macro is used to define an error */
# define FT_ERRORDEF_( e, v, s ) \ #define FT_ERRORDEF_( e, v, s ) \
FT_ERRORDEF( FT_ERR_CAT(FT_ERR_PREFIX,e), v + FT_ERR_BASE, s ) FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v + FT_ERR_BASE, s )
/* this is only used for FT_Err_Ok, which must be 0 !! */
# define FT_NOERRORDEF_( e, v, s ) \
FT_ERRORDEF( FT_ERR_CAT(FT_ERR_PREFIX,e), v, s )
/* this is only used for FT_Err_Ok, which must be 0! */
#define FT_NOERRORDEF_( e, v, s ) \
FT_ERRORDEF( FT_ERR_CAT( FT_ERR_PREFIX, e ), v, s )
/*******************************************************************/ /*******************************************************************/
/*******************************************************************/ /*******************************************************************/
/***** *****/ /***** *****/
/***** LIST ERROR CODES/MESSAGES *****/ /***** LIST OF ERROR CODES/MESSAGES *****/
/***** *****/ /***** *****/
/*******************************************************************/ /*******************************************************************/
/*******************************************************************/ /*******************************************************************/
#ifdef FT_ERROR_START_LIST #ifdef FT_ERROR_START_LIST
FT_ERROR_START_LIST FT_ERROR_START_LIST
#endif #endif
/* generic errors */ /* generic errors */
FT_NOERRORDEF_( Ok, 0x00, \ FT_NOERRORDEF_( Ok, 0x00, \
@ -342,10 +352,11 @@
FT_ERROR_END_LIST FT_ERROR_END_LIST
#endif #endif
/*******************************************************************/ /*******************************************************************/
/*******************************************************************/ /*******************************************************************/
/***** *****/ /***** *****/
/***** SIMPLE CLEANUPP *****/ /***** SIMPLE CLEANUP *****/
/***** *****/ /***** *****/
/*******************************************************************/ /*******************************************************************/
/*******************************************************************/ /*******************************************************************/

View File

@ -66,25 +66,28 @@
/*******************************************************************/ /*******************************************************************/
/*******************************************************************/ /*******************************************************************/
#undef FT_NEED_EXTERN_C #undef FT_NEED_EXTERN_C
#ifndef FT_MODERRDEF #ifndef FT_MODERRDEF
# ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS #ifdef FT_CONFIG_OPTION_USE_MODULE_ERRORS
# define FT_MODERRDEF( e, v, s ) FT_Mod_Err_ ## e = v, #define FT_MODERRDEF( e, v, s ) FT_Mod_Err_ ## e = v,
# else #else
# define FT_MODERRDEF( e, v, s ) FT_Mod_Err_ ## e = 0, #define FT_MODERRDEF( e, v, s ) FT_Mod_Err_ ## e = 0,
# endif #endif
# define FT_MODERR_START_LIST enum { #define FT_MODERR_START_LIST enum {
# define FT_MODERR_END_LIST FT_Mod_Err_Max }; #define FT_MODERR_END_LIST FT_Mod_Err_Max };
# ifdef __cplusplus #ifdef __cplusplus
# define FT_NEED_EXTERN_C #define FT_NEED_EXTERN_C
extern "C" { extern "C" {
# endif #endif
#endif /* !FT_MODERRDEF */ #endif /* !FT_MODERRDEF */
/*******************************************************************/ /*******************************************************************/
/*******************************************************************/ /*******************************************************************/
/***** *****/ /***** *****/
@ -93,6 +96,7 @@
/*******************************************************************/ /*******************************************************************/
/*******************************************************************/ /*******************************************************************/
#ifdef FT_MODERR_START_LIST #ifdef FT_MODERR_START_LIST
FT_MODERR_START_LIST FT_MODERR_START_LIST
#endif #endif
@ -118,6 +122,7 @@
FT_MODERR_END_LIST FT_MODERR_END_LIST
#endif #endif
/*******************************************************************/ /*******************************************************************/
/*******************************************************************/ /*******************************************************************/
/***** *****/ /***** *****/
@ -126,6 +131,7 @@
/*******************************************************************/ /*******************************************************************/
/*******************************************************************/ /*******************************************************************/
#ifdef FT_NEED_EXTERN_C #ifdef FT_NEED_EXTERN_C
} }
#endif #endif

View File

@ -510,9 +510,12 @@ FT_BEGIN_HEADER
#define FT_IS_EMPTY( list ) ( (list).head == 0 ) #define FT_IS_EMPTY( list ) ( (list).head == 0 )
/* return base error code (without module-specific prefix) */ /* return base error code (without module-specific prefix) */
#define FT_ERROR_BASE( x ) ( (x) & 255 ) #define FT_ERROR_BASE( x ) ( (x) & 0xFF )
#define FT_BOOL(x) ((FT_Bool)(x)) /* return module error code */
#define FT_ERROR_MODULE( x ) ( (x) & 0xFF00U )
#define FT_BOOL( x ) ( (FT_Bool)( x ) )
FT_END_HEADER FT_END_HEADER

View File

@ -221,10 +221,11 @@ FT_BEGIN_HEADER
#define FT_TRACE6( varformat ) FT_TRACE( 6, varformat ) #define FT_TRACE6( varformat ) FT_TRACE( 6, varformat )
#define FT_TRACE7( varformat ) FT_TRACE( 7, varformat ) #define FT_TRACE7( varformat ) FT_TRACE( 7, varformat )
#if defined( _MSC_VER ) /* Visual C++ (and Intel C++) */ #if defined( _MSC_VER ) /* Visual C++ (and Intel C++) */
/* we disable the warnings "conditional expression is constant" here */ /* we disable the warning `conditional expression is constant' here */
/* in order to compile cleanly with the maximum level of warnings */ /* in order to compile cleanly with the maximum level of warnings */
#pragma warning( disable : 4127 ) #pragma warning( disable : 4127 )
#endif /* _MSC_VER */ #endif /* _MSC_VER */

View File

@ -144,35 +144,34 @@ FT_BEGIN_HEADER
/* type `char*' or equivalent (1-byte elements). */ /* type `char*' or equivalent (1-byte elements). */
/* */ /* */
#define FT_GET_SHORT_BE(p) \ #define FT_GET_SHORT_BE( p ) \
((short)( ((signed char)(p)[0] << 8) | \ ( (short)( ( (signed char)(p)[0] << 8 ) | \
(p)[1] )) (p)[1] ) )
#define FT_GET_OFF3_BE(p) \ #define FT_GET_OFF3_BE( p ) \
((long) ( ((signed char)(p)[0] << 16) | \ ( (long) ( ( (signed char)(p)[0] << 16 ) | \
((p)[1] << 8) | \ ( (p)[1] << 8 ) | \
(p)[2] )) (p)[2] ) )
#define FT_GET_LONG_BE(p) \ #define FT_GET_LONG_BE( p ) \
((long) ( ((signed char)(p)[0] << 24) | \ ( (long) ( ( (signed char)(p)[0] << 24 ) | \
((p)[1] << 16) | \ ( (p)[1] << 16 ) | \
((p)[2] << 8) | \ ( (p)[2] << 8 ) | \
(p)[3] )) (p)[3] ) )
#define FT_GET_SHORT_LE(p) \ #define FT_GET_SHORT_LE( p ) \
((short)( ((signed char)(p)[1] << 8) | \ ( (short)( ( (signed char)(p)[1] << 8 ) | \
(p)[0] )) (p)[0] ) )
#define FT_GET_OFF3_LE(p) \ #define FT_GET_OFF3_LE( p ) \
((long) ( ((signed char)(p)[2] << 16) | \ ( (long) ( ( (signed char)(p)[2] << 16 ) | \
((p)[1] << 8) | \ (p)[0] ) )
(p)[0] ))
#define FT_GET_LONG_LE(p) \ #define FT_GET_LONG_LE( p ) \
((long) ( ((signed char)(p)[3] << 24) | \ ( (long) ( ( (signed char)(p)[3] << 24 ) | \
((p)[2] << 16) | \ ( (p)[2] << 16 ) | \
((p)[1] << 8) | \ ( (p)[1] << 8 ) | \
(p)[0] )) (p)[0] ) )
#define NEXT_Char( buffer ) \ #define NEXT_Char( buffer ) \
( (signed char)*buffer++ ) ( (signed char)*buffer++ )
@ -180,42 +179,42 @@ FT_BEGIN_HEADER
#define NEXT_Byte( buffer ) \ #define NEXT_Byte( buffer ) \
( (unsigned char)*buffer++ ) ( (unsigned char)*buffer++ )
#define NEXT_Short( buffer ) \ #define NEXT_Short( buffer ) \
( (short)( buffer += 2, FT_GET_SHORT_BE(buffer-2) ) ) ( (short)( buffer += 2, FT_GET_SHORT_BE( buffer - 2 ) ) )
#define NEXT_UShort( buffer ) \ #define NEXT_UShort( buffer ) \
( (unsigned short)NEXT_Short( buffer ) ) ( (unsigned short)NEXT_Short( buffer ) )
#define NEXT_Offset( buffer ) \ #define NEXT_Offset( buffer ) \
( (long)( buffer += 3, FT_GET_OFF3_BE(buffer-3) ) ) ( (long)( buffer += 3, FT_GET_OFF3_BE( buffer - 3 ) ) )
#define NEXT_UOffset( buffer ) \ #define NEXT_UOffset( buffer ) \
( (unsigned long)NEXT_Offset( buffer ) ) ( (unsigned long)NEXT_Offset( buffer ) )
#define NEXT_Long( buffer ) \ #define NEXT_Long( buffer ) \
( (long)( buffer += 4, FT_GET_LONG_BE(buffer-4) ) ) ( (long)( buffer += 4, FT_GET_LONG_BE( buffer - 4 ) ) )
#define NEXT_ULong( buffer ) \ #define NEXT_ULong( buffer ) \
( (unsigned long)NEXT_Long( buffer ) ) ( (unsigned long)NEXT_Long( buffer ) )
#define NEXT_ShortLE( buffer ) \ #define NEXT_ShortLE( buffer ) \
( (short)( buffer += 2, FT_GET_SHORT_LE(buffer-2) ) ) ( (short)( buffer += 2, FT_GET_SHORT_LE( buffer - 2 ) ) )
#define NEXT_UShortLE( buffer ) \ #define NEXT_UShortLE( buffer ) \
( (unsigned short)NEXT_ShortLE( buffer ) ) ( (unsigned short)NEXT_ShortLE( buffer ) )
#define NEXT_OffsetLE( buffer ) \ #define NEXT_OffsetLE( buffer ) \
( (long)( buffer += 3, FT_GET_OFF3_LE(buffer-3) ) ) ( (long)( buffer += 3, FT_GET_OFF3_LE( buffer - 3 ) ) )
#define NEXT_UOffsetLE( buffer ) \ #define NEXT_UOffsetLE( buffer ) \
( (unsigned long)NEXT_OffsetLE( buffer ) ) ( (unsigned long)NEXT_OffsetLE( buffer ) )
#define NEXT_LongLE( buffer ) \ #define NEXT_LongLE( buffer ) \
( (long)( buffer += 4, FT_GET_LONG_LE(buffer-4) ) ) ( (long)( buffer += 4, FT_GET_LONG_LE( buffer - 4 ) ) )
#define NEXT_ULongLE( buffer ) \ #define NEXT_ULongLE( buffer ) \
( (unsigned long)NEXT_LongLE( buffer ) ) ( (unsigned long)NEXT_LongLE( buffer ) )

View File

@ -30,8 +30,8 @@
#undef __FTERRORS_H__ #undef __FTERRORS_H__
#define FT_ERR_PREFIX AH_Err_ #define FT_ERR_PREFIX AH_Err_
#define FT_ERR_BASE FT_Mod_Err_Autohint #define FT_ERR_BASE FT_Mod_Err_Autohint
#include FT_ERRORS_H #include FT_ERRORS_H

View File

@ -558,7 +558,7 @@
for ( ; contour < contour_limit; contour++, end++ ) for ( ; contour < contour_limit; contour++, end++ )
{ {
contour[0] = points + index; contour[0] = points + index;
index = (short)(end[0] + 1); index = (short)( end[0] + 1 );
} }
} }
@ -961,7 +961,7 @@
is_dir = (FT_Bool)( seg1->dir == outline->horz_major_dir || is_dir = (FT_Bool)( seg1->dir == outline->horz_major_dir ||
seg1->dir == outline->vert_major_dir ); seg1->dir == outline->vert_major_dir );
is_pos = (FT_Bool)(pos1 > pos2); is_pos = (FT_Bool)( pos1 > pos2 );
if ( pos1 == pos2 || !(is_dir ^ is_pos) ) if ( pos1 == pos2 || !(is_dir ^ is_pos) )
continue; continue;
@ -1199,7 +1199,7 @@
/* check for links -- if seg->serif is set, then seg->link must */ /* check for links -- if seg->serif is set, then seg->link must */
/* be ignored */ /* be ignored */
is_serif = (FT_Bool)(seg->serif && seg->serif->edge != edge); is_serif = (FT_Bool)( seg->serif && seg->serif->edge != edge );
if ( seg->link || is_serif ) if ( seg->link || is_serif )
{ {
@ -1371,8 +1371,10 @@
/* zone, check for left edges */ /* zone, check for left edges */
/* */ /* */
/* of course, that's for TrueType XXX */ /* of course, that's for TrueType XXX */
FT_Bool is_top_blue = FT_BOOL(AH_IS_TOP_BLUE( blue )); FT_Bool is_top_blue =
FT_Bool is_major_dir = FT_BOOL(edge->dir == outline->horz_major_dir); FT_BOOL( AH_IS_TOP_BLUE( blue ) );
FT_Bool is_major_dir =
FT_BOOL( edge->dir == outline->horz_major_dir );
if ( !blue_active[blue] ) if ( !blue_active[blue] )
continue; continue;

View File

@ -529,13 +529,17 @@
FT_UInt n; FT_UInt n;
base->outline.n_points = (short)( base->outline.n_points + current->outline.n_points ); base->outline.n_points =
base->outline.n_contours = (short)( base->outline.n_contours + current->outline.n_contours ); (short)( base->outline.n_points + current->outline.n_points );
base->num_subglyphs += current->num_subglyphs; base->outline.n_contours =
(short)( base->outline.n_contours + current->outline.n_contours );
base->num_subglyphs += current->num_subglyphs;
/* adjust contours count in newest outline */ /* adjust contours count in newest outline */
for ( n = 0; n < n_curr_contours; n++ ) for ( n = 0; n < n_curr_contours; n++ )
current->outline.contours[n] = (short)( current->outline.contours[n] + n_base_points ); current->outline.contours[n] =
(short)( current->outline.contours[n] + n_base_points );
/* prepare for another new glyph image */ /* prepare for another new glyph image */
FT_GlyphLoader_Prepare( loader ); FT_GlyphLoader_Prepare( loader );
@ -844,10 +848,11 @@
/* do we need to load the glyph through the auto-hinter? */ /* do we need to load the glyph through the auto-hinter? */
library = driver->root.library; library = driver->root.library;
hinter = library->auto_hinter; hinter = library->auto_hinter;
autohint = FT_BOOL( hinter && autohint =
FT_BOOL( hinter &&
!( load_flags & ( FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING ) ) && !( load_flags & ( FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING ) ) &&
FT_DRIVER_IS_SCALABLE(driver) && FT_DRIVER_IS_SCALABLE( driver ) &&
FT_DRIVER_USES_OUTLINES(driver) ); FT_DRIVER_USES_OUTLINES( driver ) );
if ( autohint ) if ( autohint )
{ {
if ( FT_DRIVER_HAS_HINTER( driver ) && if ( FT_DRIVER_HAS_HINTER( driver ) &&
@ -1172,7 +1177,8 @@
*aface = 0; *aface = 0;
external_stream = FT_BOOL(( args->flags & ft_open_stream ) && args->stream); external_stream = FT_BOOL( ( args->flags & ft_open_stream ) &&
args->stream );
/* create input stream */ /* create input stream */
error = ft_new_input_stream( library, args, &stream ); error = ft_new_input_stream( library, args, &stream );

View File

@ -31,10 +31,10 @@
#define FT_COMPONENT trace_stream #define FT_COMPONENT trace_stream
FT_BASE_DEF( void ) FT_New_Memory_Stream( FT_Library library, FT_BASE_DEF( void ) FT_New_Memory_Stream( FT_Library library,
FT_Byte* base, FT_Byte* base,
FT_ULong size, FT_ULong size,
FT_Stream stream ) FT_Stream stream )
{ {
stream->memory = library->memory; stream->memory = library->memory;
stream->base = base; stream->base = base;

View File

@ -50,9 +50,10 @@
data->ref_count = (FT_Short) 0; data->ref_count = (FT_Short) 0;
node->cset = cset; node->cset = cset;
node->cset_index = (FT_UShort)index; node->cset_index = (FT_UShort)index;
node->num_elements = (unsigned short)(( index + 1 < cset->num_chunks ) node->num_elements = (unsigned short)(
? cset->element_count ( index + 1 < cset->num_chunks )
: cset->element_max - cset->element_count*index ); ? cset->element_count
: cset->element_max - cset->element_count*index );
if ( alloc ) if ( alloc )
{ {
/* allocate elements array */ /* allocate elements array */

View File

@ -30,8 +30,8 @@
#undef __FTERRORS_H__ #undef __FTERRORS_H__
#define FT_ERR_PREFIX FTC_Err_ #define FT_ERR_PREFIX FTC_Err_
#define FT_ERR_BASE FT_Mod_Err_Cache #define FT_ERR_BASE FT_Mod_Err_Cache
#include FT_ERRORS_H #include FT_ERRORS_H

View File

@ -225,7 +225,7 @@
FT_Bool ftc_image_set_compare( FTC_ImageSet iset, FT_Bool ftc_image_set_compare( FTC_ImageSet iset,
FTC_Image_Desc* type ) FTC_Image_Desc* type )
{ {
return FT_BOOL(!memcmp( &iset->description, type, sizeof ( *type ) )); return FT_BOOL( !memcmp( &iset->description, type, sizeof ( *type ) ) );
} }

View File

@ -74,7 +74,7 @@
{ {
FT_UNUSED( lru ); FT_UNUSED( lru );
return FT_BOOL(((FT_Size)node->root.data)->face == (FT_Face)data); return FT_BOOL( ((FT_Size)node->root.data)->face == (FT_Face)data );
} }

View File

@ -317,7 +317,7 @@
FT_Bool ftc_sbit_chunk_set_compare( FTC_SBitSet sset, FT_Bool ftc_sbit_chunk_set_compare( FTC_SBitSet sset,
FTC_Image_Desc* type ) FTC_Image_Desc* type )
{ {
return FT_BOOL(!memcmp( &sset->desc, type, sizeof ( *type ) )); return FT_BOOL( !memcmp( &sset->desc, type, sizeof ( *type ) ) );
} }

View File

@ -29,8 +29,8 @@
#undef __FTERRORS_H__ #undef __FTERRORS_H__
#define FT_ERR_PREFIX CFF_Err_ #define FT_ERR_PREFIX CFF_Err_
#define FT_ERR_BASE FT_Mod_Err_CFF #define FT_ERR_BASE FT_Mod_Err_CFF
#include FT_ERRORS_H #include FT_ERRORS_H

View File

@ -409,7 +409,7 @@
point->x = x >> 16; point->x = x >> 16;
point->y = y >> 16; point->y = y >> 16;
*control = (FT_Byte)(flag ? FT_Curve_Tag_On : FT_Curve_Tag_Cubic); *control = (FT_Byte)( flag ? FT_Curve_Tag_On : FT_Curve_Tag_Cubic );
builder->last = *point; builder->last = *point;
} }
@ -452,7 +452,8 @@
if ( !error ) if ( !error )
{ {
if ( outline->n_contours > 0 ) if ( outline->n_contours > 0 )
outline->contours[outline->n_contours - 1] = (short)(outline->n_points - 1); outline->contours[outline->n_contours - 1] =
(short)( outline->n_points - 1 );
outline->n_contours++; outline->n_contours++;
} }
@ -512,7 +513,8 @@
} }
if ( outline->n_contours > 0 ) if ( outline->n_contours > 0 )
outline->contours[outline->n_contours - 1] = (short)(outline->n_points - 1); outline->contours[outline->n_contours - 1] =
(short)( outline->n_points - 1 );
} }
@ -655,7 +657,7 @@
FT_Outline dummy; FT_Outline dummy;
dummy.n_points = (short)(base->n_points - n_base_points); dummy.n_points = (short)( base->n_points - n_base_points );
dummy.points = base->points + n_base_points; dummy.points = base->points + n_base_points;
FT_Outline_Translate( &dummy, adx, ady ); FT_Outline_Translate( &dummy, adx, ady );

View File

@ -385,10 +385,11 @@
root->num_glyphs = cff->charstrings_index.count; root->num_glyphs = cff->charstrings_index.count;
/* set global bbox, as well as EM size */ /* set global bbox, as well as EM size */
root->bbox = dict->font_bbox; root->bbox = dict->font_bbox;
root->ascender = (FT_Short)( root->bbox.yMax >> 16 ); root->ascender = (FT_Short)( root->bbox.yMax >> 16 );
root->descender = (FT_Short)( root->bbox.yMin >> 16 ); root->descender = (FT_Short)( root->bbox.yMin >> 16 );
root->height = (FT_Short)(( ( root->ascender - root->descender ) * 12 ) / 10); root->height = (FT_Short)(
( ( root->ascender - root->descender ) * 12 ) / 10 );
if ( dict->units_per_em ) if ( dict->units_per_em )
root->units_per_EM = dict->units_per_em; root->units_per_EM = dict->units_per_em;

View File

@ -29,8 +29,8 @@
#undef __FTERRORS_H__ #undef __FTERRORS_H__
#define FT_ERR_PREFIX CID_Err_ #define FT_ERR_PREFIX CID_Err_
#define FT_ERR_BASE FT_Mod_Err_CID #define FT_ERR_BASE FT_Mod_Err_CID
#include FT_ERRORS_H #include FT_ERRORS_H

View File

@ -71,7 +71,7 @@
plain = (FT_Byte)( *buffer ^ ( seed >> 8 ) ); plain = (FT_Byte)( *buffer ^ ( seed >> 8 ) );
seed = (FT_UShort)(( *buffer + seed ) * 52845 + 22719); seed = (FT_UShort)( ( *buffer + seed ) * 52845 + 22719 );
*buffer++ = plain; *buffer++ = plain;
length--; length--;
} }

View File

@ -223,14 +223,14 @@
root->num_fixed_sizes = 0; root->num_fixed_sizes = 0;
root->available_sizes = 0; root->available_sizes = 0;
root->bbox = face->cid.font_bbox; root->bbox = face->cid.font_bbox;
if ( !root->units_per_EM ) if ( !root->units_per_EM )
root->units_per_EM = 1000; root->units_per_EM = 1000;
root->ascender = (FT_Short)( face->cid.font_bbox.yMax >> 16 ); root->ascender = (FT_Short)( face->cid.font_bbox.yMax >> 16 );
root->descender = (FT_Short)( face->cid.font_bbox.yMin >> 16 ); root->descender = (FT_Short)( face->cid.font_bbox.yMin >> 16 );
root->height = (FT_Short)( (( root->ascender + root->descender ) * 12 ) root->height = (FT_Short)(
/ 10 ); ( ( root->ascender + root->descender ) * 12 ) / 10 );
#if 0 #if 0

View File

@ -29,8 +29,8 @@
#undef __FTERRORS_H__ #undef __FTERRORS_H__
#define FT_ERR_PREFIX PCF_Err_ #define FT_ERR_PREFIX PCF_Err_
#define FT_ERR_BASE FT_Mod_Err_PCF #define FT_ERR_BASE FT_Mod_Err_PCF
#include FT_ERRORS_H #include FT_ERRORS_H

View File

@ -224,12 +224,17 @@ THE SOFTWARE.
if ( READ_Fields( pcf_compressed_metric_header, &compr_metric ) ) if ( READ_Fields( pcf_compressed_metric_header, &compr_metric ) )
return error; return error;
metric->leftSideBearing = (FT_Short)(compr_metric.leftSideBearing - 0x80); metric->leftSideBearing =
metric->rightSideBearing = (FT_Short)(compr_metric.rightSideBearing - 0x80); (FT_Short)( compr_metric.leftSideBearing - 0x80 );
metric->characterWidth = (FT_Short)(compr_metric.characterWidth - 0x80); metric->rightSideBearing =
metric->ascent = (FT_Short)(compr_metric.ascent - 0x80); (FT_Short)( compr_metric.rightSideBearing - 0x80 );
metric->descent = (FT_Short)(compr_metric.descent - 0x80); metric->characterWidth =
metric->attributes = 0; (FT_Short)( compr_metric.characterWidth - 0x80 );
metric->ascent =
(FT_Short)( compr_metric.ascent - 0x80 );
metric->descent =
(FT_Short)( compr_metric.descent - 0x80 );
metric->attributes = 0;
return PCF_Err_Ok; return PCF_Err_Ok;
} }

View File

@ -30,8 +30,8 @@
#undef __FTERRORS_H__ #undef __FTERRORS_H__
#define FT_ERR_PREFIX PSaux_Err_ #define FT_ERR_PREFIX PSaux_Err_
#define FT_ERR_BASE FT_Mod_Err_PSaux #define FT_ERR_BASE FT_Mod_Err_PSaux
#include FT_ERRORS_H #include FT_ERRORS_H

View File

@ -925,7 +925,8 @@
old_limit = parser->limit; old_limit = parser->limit;
/* we store the elements count */ /* we store the elements count */
*(FT_Byte*)( (FT_Byte*)objects[0] + field->count_offset ) = (FT_Byte)num_elements; *(FT_Byte*)( (FT_Byte*)objects[0] + field->count_offset ) =
(FT_Byte)num_elements;
/* we now load each element, adjusting the field.offset on each one */ /* we now load each element, adjusting the field.offset on each one */
token = elements; token = elements;
@ -1156,7 +1157,7 @@
} }
point->x = x; point->x = x;
point->y = y; point->y = y;
*control = (FT_Byte)(flag ? FT_Curve_Tag_On : FT_Curve_Tag_Cubic); *control = (FT_Byte)( flag ? FT_Curve_Tag_On : FT_Curve_Tag_Cubic );
builder->last = *point; builder->last = *point;
} }
@ -1199,7 +1200,8 @@
if ( !error ) if ( !error )
{ {
if ( outline->n_contours > 0 ) if ( outline->n_contours > 0 )
outline->contours[outline->n_contours - 1] = (short)(outline->n_points - 1); outline->contours[outline->n_contours - 1] =
(short)( outline->n_points - 1 );
outline->n_contours++; outline->n_contours++;
} }
@ -1260,7 +1262,8 @@
} }
if ( outline->n_contours > 0 ) if ( outline->n_contours > 0 )
outline->contours[outline->n_contours - 1] = (short)(outline->n_points - 1); outline->contours[outline->n_contours - 1] =
(short)( outline->n_points - 1 );
} }
@ -1282,8 +1285,8 @@
FT_Byte plain; FT_Byte plain;
plain = (FT_Byte) ( *buffer ^ ( seed >> 8 ) ); plain = (FT_Byte)( *buffer ^ ( seed >> 8 ) );
seed = (FT_UShort)(( *buffer + seed ) * 52845 + 22719 ); seed = (FT_UShort)( ( *buffer + seed ) * 52845 + 22719 );
*buffer++ = plain; *buffer++ = plain;
length--; length--;
} }

View File

@ -284,8 +284,8 @@
FT_Outline dummy; FT_Outline dummy;
dummy.n_points = (short)(base->n_points - n_base_points); dummy.n_points = (short)( base->n_points - n_base_points );
dummy.points = base->points + n_base_points; dummy.points = base->points + n_base_points;
FT_Outline_Translate( &dummy, adx - asb, ady ); FT_Outline_Translate( &dummy, adx - asb, ady );
} }

View File

@ -30,8 +30,8 @@
#undef __FTERRORS_H__ #undef __FTERRORS_H__
#define FT_ERR_PREFIX PSnames_Err_ #define FT_ERR_PREFIX PSnames_Err_
#define FT_ERR_BASE FT_Mod_Err_PSnames #define FT_ERR_BASE FT_Mod_Err_PSnames
#include FT_ERRORS_H #include FT_ERRORS_H

View File

@ -1833,7 +1833,9 @@
ras.state = Unknown; ras.state = Unknown;
ras.gProfile = NULL; ras.gProfile = NULL;
if ( Decompose_Curve( RAS_VARS (unsigned short)start, ras.outline.contours[i], flipped ) ) if ( Decompose_Curve( RAS_VARS (unsigned short)start,
ras.outline.contours[i],
flipped ) )
return FAILURE; return FAILURE;
start = ras.outline.contours[i] + 1; start = ras.outline.contours[i] + 1;
@ -2755,7 +2757,7 @@
Sort( &draw_right ); Sort( &draw_right );
y_change = (Short)ras.sizeBuff[-ras.numTurns--]; y_change = (Short)ras.sizeBuff[-ras.numTurns--];
y_height = (Short)(y_change - y); y_height = (Short)( y_change - y );
while ( y < y_change ) while ( y < y_change )
{ {
@ -2929,7 +2931,7 @@
i = ras.band_stack[ras.band_top].y_min; i = ras.band_stack[ras.band_top].y_min;
j = ras.band_stack[ras.band_top].y_max; j = ras.band_stack[ras.band_top].y_max;
k = (Short)(( i + j ) / 2); k = (Short)( ( i + j ) / 2 );
if ( ras.band_top >= 7 || k < i ) if ( ras.band_top >= 7 || k < i )
{ {
@ -2942,7 +2944,7 @@
ras.band_stack[ras.band_top + 1].y_min = k; ras.band_stack[ras.band_top + 1].y_min = k;
ras.band_stack[ras.band_top + 1].y_max = j; ras.band_stack[ras.band_top + 1].y_max = j;
ras.band_stack[ras.band_top].y_max = (Short)(k - 1); ras.band_stack[ras.band_top].y_max = (Short)( k - 1 );
ras.band_top++; ras.band_top++;
} }
@ -2980,7 +2982,8 @@
ft_outline_high_precision ); ft_outline_high_precision );
ras.scale_shift = ras.precision_shift; ras.scale_shift = ras.precision_shift;
ras.dropOutControl = 2; ras.dropOutControl = 2;
ras.second_pass = (FT_Byte)(!( ras.outline.flags & ft_outline_single_pass )); ras.second_pass = (FT_Byte)( !( ras.outline.flags &
ft_outline_single_pass ) );
/* Vertical Sweep */ /* Vertical Sweep */
ras.Proc_Sweep_Init = Vertical_Sweep_Init; ras.Proc_Sweep_Init = Vertical_Sweep_Init;
@ -2990,7 +2993,7 @@
ras.band_top = 0; ras.band_top = 0;
ras.band_stack[0].y_min = 0; ras.band_stack[0].y_min = 0;
ras.band_stack[0].y_max = (short)(ras.target.rows - 1); ras.band_stack[0].y_max = (short)( ras.target.rows - 1 );
ras.bWidth = (unsigned short)ras.target.width; ras.bWidth = (unsigned short)ras.target.width;
ras.bTarget = (Byte*)ras.target.buffer; ras.bTarget = (Byte*)ras.target.buffer;
@ -3008,7 +3011,7 @@
ras.band_top = 0; ras.band_top = 0;
ras.band_stack[0].y_min = 0; ras.band_stack[0].y_min = 0;
ras.band_stack[0].y_max = (short)(ras.target.width - 1); ras.band_stack[0].y_max = (short)( ras.target.width - 1 );
if ( ( error = Render_Single_Pass( RAS_VARS 1 ) ) != 0 ) if ( ( error = Render_Single_Pass( RAS_VARS 1 ) ) != 0 )
return error; return error;

View File

@ -30,8 +30,8 @@
#undef __FTERRORS_H__ #undef __FTERRORS_H__
#define FT_ERR_PREFIX Raster_Err_ #define FT_ERR_PREFIX Raster_Err_
#define FT_ERR_BASE FT_Mod_Err_Raster #define FT_ERR_BASE FT_Mod_Err_Raster
#include FT_ERRORS_H #include FT_ERRORS_H

View File

@ -29,8 +29,8 @@
#undef __FTERRORS_H__ #undef __FTERRORS_H__
#define FT_ERR_PREFIX SFNT_Err_ #define FT_ERR_PREFIX SFNT_Err_
#define FT_ERR_BASE FT_Mod_Err_SFNT #define FT_ERR_BASE FT_Mod_Err_SFNT
#include FT_ERRORS_H #include FT_ERRORS_H

View File

@ -286,7 +286,7 @@
/* if this font doesn't contain outlines, we try to load */ /* if this font doesn't contain outlines, we try to load */
/* a `bhed' table */ /* a `bhed' table */
if ( !has_outline ) if ( !has_outline )
is_apple_sbit = FT_BOOL(!LOAD_( bitmap_header )); is_apple_sbit = FT_BOOL( !LOAD_( bitmap_header ) );
#endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */ #endif /* TT_CONFIG_OPTION_EMBEDDED_BITMAPS */
@ -544,7 +544,7 @@
/* if the line_gap is 0, we add an extra 15% to the text height -- */ /* if the line_gap is 0, we add an extra 15% to the text height -- */
/* this computation is based on various versions of Times New Roman */ /* this computation is based on various versions of Times New Roman */
if ( face->horizontal.Line_Gap == 0 ) if ( face->horizontal.Line_Gap == 0 )
root->height = (FT_Short)(( root->height * 115 + 50 ) / 100 ); root->height = (FT_Short)( ( root->height * 115 + 50 ) / 100 );
#if 0 #if 0

View File

@ -123,7 +123,7 @@
for ( i = 0; i < 256; i++ ) for ( i = 0; i < 256; i++ )
{ {
u = (FT_UShort)(GET_UShort() / 8); u = (FT_UShort)( GET_UShort() / 8 );
cmap2->subHeaderKeys[i] = u; cmap2->subHeaderKeys[i] = u;
if ( num_SH < u ) if ( num_SH < u )
@ -151,7 +151,8 @@
cmap2sub->entryCount = GET_UShort(); cmap2sub->entryCount = GET_UShort();
cmap2sub->idDelta = GET_Short(); cmap2sub->idDelta = GET_Short();
/* we apply the location offset immediately */ /* we apply the location offset immediately */
cmap2sub->idRangeOffset = (FT_UShort)( GET_UShort() - ( num_SH - i ) * 8 - 2 ); cmap2sub->idRangeOffset = (FT_UShort)(
GET_UShort() - ( num_SH - i ) * 8 - 2 );
cmap2sub++; cmap2sub++;
} }
@ -185,7 +186,7 @@
cmap4->entrySelector = GET_UShort(); cmap4->entrySelector = GET_UShort();
cmap4->rangeShift = GET_UShort(); cmap4->rangeShift = GET_UShort();
num_Seg = (FT_UShort)(cmap4->segCountX2 / 2); num_Seg = (FT_UShort)( cmap4->segCountX2 / 2 );
FORGET_Frame(); FORGET_Frame();

View File

@ -604,11 +604,13 @@
face->root.num_glyphs = maxProfile->numGlyphs; face->root.num_glyphs = maxProfile->numGlyphs;
face->root.internal->max_points = (FT_UShort)MAX( maxProfile->maxCompositePoints, face->root.internal->max_points =
maxProfile->maxPoints ); (FT_UShort)MAX( maxProfile->maxCompositePoints,
maxProfile->maxPoints );
face->root.internal->max_contours = (FT_Short)MAX( maxProfile->maxCompositeContours, face->root.internal->max_contours =
maxProfile->maxContours ); (FT_Short)MAX( maxProfile->maxCompositeContours,
maxProfile->maxContours );
face->max_components = (FT_ULong)maxProfile->maxComponentElements + face->max_components = (FT_ULong)maxProfile->maxComponentElements +
maxProfile->maxComponentDepth; maxProfile->maxComponentDepth;

View File

@ -104,10 +104,10 @@
for ( height = target->rows; height > 0; height-- ) for ( height = target->rows; height > 0; height-- )
{ {
FT_Byte* cur = line_buff; /* current write cursor */ FT_Byte* cur = line_buff; /* current write cursor */
FT_Int count = line_bits; /* # of bits to extract per line */ FT_Int count = line_bits; /* # of bits to extract per line */
FT_Byte shift = (FT_Byte)(x_offset & 7); /* current write shift */ FT_Byte shift = (FT_Byte)( x_offset & 7 ); /* current write shift */
FT_Byte space = (FT_Byte)(8 - shift); FT_Byte space = (FT_Byte)( 8 - shift );
/* first of all, read individual source bytes */ /* first of all, read individual source bytes */
@ -163,7 +163,7 @@
} }
/* now write remaining bits */ /* now write remaining bits */
val = (FT_Byte)(( (FT_Byte)( acc >> 8 ) ) & ~( 0xFF >> count )); val = (FT_Byte)( ( (FT_Byte)( acc >> 8 ) ) & ~( 0xFF >> count ) );
cur[0] |= val >> shift; cur[0] |= val >> shift;
if ( count > space ) if ( count > space )
@ -699,7 +699,7 @@
if ( glyph_index >= (FT_UInt)range->first_glyph && if ( glyph_index >= (FT_UInt)range->first_glyph &&
glyph_index <= (FT_UInt)range->last_glyph ) glyph_index <= (FT_UInt)range->last_glyph )
{ {
FT_UShort delta = (FT_UShort)(glyph_index - range->first_glyph); FT_UShort delta = (FT_UShort)( glyph_index - range->first_glyph );
switch ( range->index_format ) switch ( range->index_format )
@ -1068,8 +1068,8 @@
val = cur[1]; val = cur[1];
cur[0] = (FT_Byte)(old | ( val >> 7 )); cur[0] = (FT_Byte)( old | ( val >> 7 ) );
old = (FT_Byte)(val << 1); old = (FT_Byte)( val << 1 );
cur++; cur++;
} }
cur[0] = old; cur[0] = old;
@ -1098,7 +1098,7 @@
line = (FT_Byte*)map->buffer + ( right >> 3 ); line = (FT_Byte*)map->buffer + ( right >> 3 );
limit = line + rows * line_len; limit = line + rows * line_len;
mask = (FT_Byte)(0x80 >> ( right & 7 )); mask = (FT_Byte)( 0x80 >> ( right & 7 ) );
for ( ; line < limit; line += line_len ) for ( ; line < limit; line += line_len )
if ( line[0] & mask ) if ( line[0] & mask )
@ -1452,7 +1452,7 @@
/* some heuristic values */ /* some heuristic values */
metrics->vertBearingX = (FT_Char)(-metrics->width / 2); metrics->vertBearingX = (FT_Char)(-metrics->width / 2 );
metrics->vertBearingY = (FT_Char)( advance / 10 ); metrics->vertBearingY = (FT_Char)( advance / 10 );
metrics->vertAdvance = (FT_Char)( advance * 12 / 10 ); metrics->vertAdvance = (FT_Char)( advance * 12 / 10 );
} }

View File

@ -1308,7 +1308,7 @@
(int)span->x + span->len == (int)x && (int)span->x + span->len == (int)x &&
span->coverage == coverage ) span->coverage == coverage )
{ {
span->len = (unsigned short)(span->len + acount); span->len = (unsigned short)( span->len + acount );
return; return;
} }

View File

@ -30,8 +30,8 @@
#undef __FTERRORS_H__ #undef __FTERRORS_H__
#define FT_ERR_PREFIX Smooth_Err_ #define FT_ERR_PREFIX Smooth_Err_
#define FT_ERR_BASE FT_Mod_Err_Smooth #define FT_ERR_BASE FT_Mod_Err_Smooth
#include FT_ERRORS_H #include FT_ERRORS_H

View File

@ -30,8 +30,8 @@
#undef __FTERRORS_H__ #undef __FTERRORS_H__
#define FT_ERR_PREFIX TT_Err_ #define FT_ERR_PREFIX TT_Err_
#define FT_ERR_BASE FT_Mod_Err_TrueType #define FT_ERR_BASE FT_Mod_Err_TrueType
#include FT_ERRORS_H #include FT_ERRORS_H

View File

@ -180,8 +180,8 @@
FT_UInt start_point, FT_UInt start_point,
FT_UInt start_contour ) FT_UInt start_contour )
{ {
zone->n_points = (FT_UShort)(load->outline.n_points - start_point); zone->n_points = (FT_UShort)( load->outline.n_points - start_point );
zone->n_contours = (FT_Short) (load->outline.n_contours - start_contour); zone->n_contours = (FT_Short) ( load->outline.n_contours - start_contour );
zone->org = load->extra_points + start_point; zone->org = load->extra_points + start_point;
zone->cur = load->outline.points + start_point; zone->cur = load->outline.points + start_point;
zone->tags = (FT_Byte*)load->outline.tags + start_point; zone->tags = (FT_Byte*)load->outline.tags + start_point;
@ -1215,14 +1215,14 @@
/* */ /* */
if ( face->os2.version != 0xFFFF ) if ( face->os2.version != 0xFFFF )
{ {
top_bearing = (FT_Short)(face->os2.sTypoLineGap / 2); top_bearing = (FT_Short)( face->os2.sTypoLineGap / 2 );
advance_height = (FT_UShort)( face->os2.sTypoAscender - advance_height = (FT_UShort)( face->os2.sTypoAscender -
face->os2.sTypoDescender + face->os2.sTypoDescender +
face->os2.sTypoLineGap ); face->os2.sTypoLineGap );
} }
else else
{ {
top_bearing = (FT_Short)(face->horizontal.Line_Gap / 2); top_bearing = (FT_Short)( face->horizontal.Line_Gap / 2 );
advance_height = (FT_UShort)( face->horizontal.Ascender + advance_height = (FT_UShort)( face->horizontal.Ascender +
face->horizontal.Descender + face->horizontal.Descender +
face->horizontal.Line_Gap ); face->horizontal.Line_Gap );

View File

@ -29,8 +29,8 @@
#undef __FTERRORS_H__ #undef __FTERRORS_H__
#define FT_ERR_PREFIX T1_Err_ #define FT_ERR_PREFIX T1_Err_
#define FT_ERR_BASE FT_Mod_Err_Type1 #define FT_ERR_BASE FT_Mod_Err_Type1
#include FT_ERRORS_H #include FT_ERRORS_H

View File

@ -176,7 +176,8 @@
if ( error ) if ( error )
goto Exit; goto Exit;
decoder.builder.no_recurse = FT_BOOL( ( load_flags & FT_LOAD_NO_RECURSE ) != 0 ); decoder.builder.no_recurse = FT_BOOL(
( load_flags & FT_LOAD_NO_RECURSE ) != 0 );
decoder.num_subrs = type1->num_subrs; decoder.num_subrs = type1->num_subrs;
decoder.subrs = type1->subrs; decoder.subrs = type1->subrs;

View File

@ -278,7 +278,8 @@
root->ascender = (FT_Short)( face->type1.font_bbox.yMax >> 16 ); root->ascender = (FT_Short)( face->type1.font_bbox.yMax >> 16 );
root->descender = (FT_Short)( face->type1.font_bbox.yMin >> 16 ); root->descender = (FT_Short)( face->type1.font_bbox.yMin >> 16 );
root->height = (FT_Short)(( ( root->ascender - root->descender ) * 12 ) / 10 ); root->height = (FT_Short)(
( ( root->ascender - root->descender ) * 12 ) / 10 );
/* now compute the maximum advance width */ /* now compute the maximum advance width */
root->max_advance_width = root->max_advance_width =

View File

@ -436,7 +436,7 @@
break; break;
/* otherwise, store byte */ /* otherwise, store byte */
*write++ = (FT_Byte)(( hex1 << 4 ) | hexa_value( cur[1] )); *write++ = (FT_Byte)( ( hex1 << 4 ) | hexa_value( cur[1] ) );
count++; count++;
cur++; cur++;
} }

View File

@ -30,8 +30,8 @@
#undef __FTERRORS_H__ #undef __FTERRORS_H__
#define FT_ERR_PREFIX FNT_Err_ #define FT_ERR_PREFIX FNT_Err_
#define FT_ERR_BASE FT_Mod_Err_Winfonts #define FT_ERR_BASE FT_Mod_Err_Winfonts
#include FT_ERRORS_H #include FT_ERRORS_H