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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188
diff --git a/ChangeLog b/ChangeLog
index acee223..a858f24 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
diff --git a/include/freetype/config/ftoption.h b/include/freetype/config/ftoption.h
index 4659025..e4d8e47 100644
--- a/include/freetype/config/ftoption.h
+++ b/include/freetype/config/ftoption.h
@@ -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
/*************************************************************************/
diff --git a/include/freetype/ftimage.h b/include/freetype/ftimage.h
index 85dc88b..67d80b3 100644
--- a/include/freetype/ftimage.h
+++ b/include/freetype/ftimage.h
@@ -28,7 +28,10 @@
#define __FTIMAGE_H__
+/* _STANDALONE_ is from ftgrays.c */
+#ifndef _STANDALONE_
#include <ft2build.h>
+#endif
FT_BEGIN_HEADER
diff --git a/src/base/ftinit.c b/src/base/ftinit.c
index 7b92dc4..79ba9f0 100644
--- a/src/base/ftinit.c
+++ b/src/base/ftinit.c
@@ -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++;
diff --git a/src/pcf/pcfdriver.c b/src/pcf/pcfdriver.c
index 74e96ba..ec478cd 100644
--- a/src/pcf/pcfdriver.c
+++ b/src/pcf/pcfdriver.c
@@ -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;
}
diff --git a/src/smooth/ftgrays.c b/src/smooth/ftgrays.c
index 3d6dad8..f519d31 100644
--- a/src/smooth/ftgrays.c
+++ b/src/smooth/ftgrays.c
@@ -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"
@@ -156,6 +161,10 @@
#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 */
#define xxxDEBUG_GRAYS
@@ -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;
}
}