Making ftgrays.c compile stand-alone again.

* include/freetype/ftimage.h: Include ft2build.h only if _STANDALONE_
isn't defined.
* src/smooth/ftgrays.c [_STANDALONE_]: Define ft_memset,
FT_BEGIN_HEADER, FT_END_HEADER.
(FT_MEM_ZERO): Define.
(TRaster) [GRAYS_USE_GAMMA]: Use `unsigned char' instead of FT_Byte.
(gray_render_span, gray_init_gamma): Don't use `FT_UInt'.
Don't cast with `FT_Byte'.
(grays_init_gamma): Don't use `FT_UInt'.

* src/base/ftinit.c (FT_Add_Default_Modules): Improve error message.
* src/pcf/pcfdriver.c (PCF_Face_Done): Improve tracing message.
* include/freetype/config/ftoption.h (FT_MAX_MODULES): Increased
to 32.
This commit is contained in:
Werner Lemberg 2002-09-16 06:15:31 +00:00
parent 9bd0e4e8c3
commit 1313646d65
6 changed files with 49 additions and 16 deletions

View File

@ -1,3 +1,24 @@
2002-09-14 Werner Lemberg <wl@gnu.org>
Making ftgrays.c compile stand-alone again.
* include/freetype/ftimage.h: Include ft2build.h only if _STANDALONE_
isn't defined.
* src/smooth/ftgrays.c [_STANDALONE_]: Define ft_memset,
FT_BEGIN_HEADER, FT_END_HEADER.
(FT_MEM_ZERO): Define.
(TRaster) [GRAYS_USE_GAMMA]: Use `unsigned char' instead of FT_Byte.
(gray_render_span, gray_init_gamma): Don't use `FT_UInt'.
Don't cast with `FT_Byte'.
(grays_init_gamma): Don't use `FT_UInt'.
2002-09-14 Werner Lemberg <wl@gnu.org>
* src/base/ftinit.c (FT_Add_Default_Modules): Improve error message.
* src/pcf/pcfdriver.c (PCF_Face_Done): Improve tracing message.
* include/freetype/config/ftoption.h (FT_MAX_MODULES): Increased
to 32.
2002-09-10 Werner Lemberg <wl@gnu.org>
* builds/unix/configure.ac (version_info): Set to 9:2:3.

View File

@ -301,9 +301,9 @@ FT_BEGIN_HEADER
/* FT_MAX_MODULES */
/* */
/* The maximum number of modules that can be registered in a single */
/* FreeType library object. 16 is the default. */
/* FreeType library object. 32 is the default. */
/* */
#define FT_MAX_MODULES 16
#define FT_MAX_MODULES 32
/*************************************************************************/

View File

@ -28,7 +28,10 @@
#define __FTIMAGE_H__
/* _STANDALONE_ is from ftgrays.c */
#ifndef _STANDALONE_
#include <ft2build.h>
#endif
FT_BEGIN_HEADER

View File

@ -93,7 +93,7 @@
/* notify errors, but don't stop */
if ( error )
{
FT_ERROR(( "FT_Add_Default_Module: Cannot install `%s', error = %x\n",
FT_ERROR(( "FT_Add_Default_Module: Cannot install `%s', error = 0x%x\n",
(*cur)->module_name, error ));
}
cur++;

View File

@ -206,7 +206,7 @@ THE SOFTWARE.
FT_FREE( face->charset_encoding );
FT_FREE( face->charset_registry );
FT_TRACE4(( "DONE_FACE!!!\n" ));
FT_TRACE4(( "PCF_Face_Done: done face\n" ));
return PCF_Err_Ok;
}

View File

@ -22,10 +22,10 @@
/* put the files `ftgrays.h' and `ftimage.h' into the current */
/* compilation directory. Typically, you could do something like */
/* */
/* - copy `src/base/ftgrays.c' to your current directory */
/* - copy `src/smooth/ftgrays.c' (this file) to your current directory */
/* */
/* - copy `include/freetype/ftimage.h' and `include/freetype/ftgrays.h' */
/* to the same directory */
/* - copy `include/freetype/ftimage.h' and `src/smooth/ftgrays.h' to the */
/* same directory */
/* */
/* - compile `ftgrays' with the _STANDALONE_ macro defined, as in */
/* */
@ -106,14 +106,19 @@
#include <limits.h>
#define FT_UINT_MAX UINT_MAX
#define ft_setjmp setjmp
#define ft_longjmp longjmp
#define ft_jmp_buf jmp_buf
#define ft_memset memset
#define ft_setjmp setjmp
#define ft_longjmp longjmp
#define ft_jmp_buf jmp_buf
#define ErrRaster_Invalid_Mode -2
#define ErrRaster_Invalid_Outline -1
#define FT_BEGIN_HEADER
#define FT_END_HEADER
#include "ftimage.h"
#include "ftgrays.h"
@ -154,6 +159,10 @@
#ifndef FT_MEM_SET
#define FT_MEM_SET( d, s, c ) ft_memset( d, s, c )
#endif
#ifndef FT_MEM_ZERO
#define FT_MEM_ZERO( dest, count ) FT_MEM_SET( dest, 0, count )
#endif
/* define this to dump debugging information */
@ -210,7 +219,7 @@
/* increases the number of cells available in the render pool but slows */
/* down the rendering a bit. It is useful if you have a really tiny */
/* render pool. */
#undef GRAYS_COMPACT
#undef GRAYS_COMPACT
/*************************************************************************/
@ -316,7 +325,7 @@
ft_jmp_buf jump_buffer;
#ifdef GRAYS_USE_GAMMA
FT_Byte gamma[257];
unsigned char gamma[257];
#endif
} TRaster, *PRaster;
@ -1284,11 +1293,11 @@
for ( ; count > 0; count--, spans++ )
{
FT_UInt coverage = spans->coverage;
unsigned char coverage = spans->coverage;
#ifdef GRAYS_USE_GAMMA
coverage = raster->gamma[(FT_Byte)coverage];
coverage = raster->gamma[coverage];
#endif
if ( coverage )
@ -2033,7 +2042,7 @@
static void
grays_init_gamma( PRaster raster )
{
FT_UInt x, a;
unsigned int x, a;
for ( x = 0; x < 256; x++ )
@ -2044,7 +2053,7 @@
a = M_Y + ( ( x - M_X ) * ( M_MAX - M_Y ) +
( M_MAX - M_X ) / 2 ) / ( M_MAX - M_X );
raster->gamma[x] = (FT_Byte)a;
raster->gamma[x] = (unsigned char)a;
}
}