* src/truetype/ttobjs.h, src/truetype/ttobjs.c (tt_face_init, tt_face_done, tt_size_init, tt_size_done, tt_driver_init, tt_driver_done): Don't use TT_XXX but FT_XXX arguments which are typecast to the proper TT_XXX within the function. Update code accordingly. * src/truetype/ttdriver.c (Get_Kerning, Set_Char_Sizes, Set_Pixel_Sizes, Load_Glyph, tt_get_interface): Don't use TT_XXX but FT_XXX arguments which are typecast to the proper TT_XXX within the function. Update code accordingly. (tt_driver_class): Remove casts.
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 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321
diff --git a/ChangeLog b/ChangeLog
index 866c4ba..d9b6f1a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2004-05-03 Steve Hartwell <shspamsink@comcast.net>
+
+ * src/truetype/ttobjs.h, src/truetype/ttobjs.c (tt_face_init,
+ tt_face_done, tt_size_init, tt_size_done, tt_driver_init,
+ tt_driver_done): Don't use TT_XXX but FT_XXX arguments which are
+ typecast to the proper TT_XXX within the function.
+ Update code accordingly.
+
+ * src/truetype/ttdriver.c (Get_Kerning, Set_Char_Sizes,
+ Set_Pixel_Sizes, Load_Glyph, tt_get_interface): Don't use TT_XXX but
+ FT_XXX arguments which are typecast to the proper TT_XXX within the
+ function.
+ Update code accordingly.
+ (tt_driver_class): Remove casts.
+
2004-05-02 Werner Lemberg <wl@gnu.org>
* src/sfnt/ttload.c (tt_face_free_names): Check that `table->names'
diff --git a/builds/win32/visualc/index.html b/builds/win32/visualc/index.html
index 10e4cfc..9454d4c 100644
--- a/builds/win32/visualc/index.html
+++ b/builds/win32/visualc/index.html
@@ -12,7 +12,7 @@
<p>This directory contains a project files for Visual C++, named
<tt>freetype.dsp</tt>, and Visual Studio, called <tt>freetype.sln</tt>. It
-will compile the following libraries from the FreeType 2.1.8 sources:</p>
+will compile the following libraries from the FreeType 2.1.9 sources:</p>
<ul>
<pre>
diff --git a/src/truetype/ttdriver.c b/src/truetype/ttdriver.c
index acd6be0..30e5b6f 100644
--- a/src/truetype/ttdriver.c
+++ b/src/truetype/ttdriver.c
@@ -99,11 +99,12 @@
/* They can be implemented by format-specific interfaces. */
/* */
static FT_Error
- Get_Kerning( TT_Face face,
+ Get_Kerning( FT_Face ttface, /* TT_Face */
FT_UInt left_glyph,
FT_UInt right_glyph,
FT_Vector* kerning )
{
+ TT_Face face = (TT_Face)ttface;
TT_Kern0_Pair pair;
@@ -194,12 +195,13 @@
/* FreeType error code. 0 means success. */
/* */
static FT_Error
- Set_Char_Sizes( TT_Size size,
+ Set_Char_Sizes( FT_Size ttsize, /* TT_Size */
FT_F26Dot6 char_width,
FT_F26Dot6 char_height,
FT_UInt horz_resolution,
FT_UInt vert_resolution )
{
+ TT_Size size = (TT_Size)ttsize;
FT_Size_Metrics* metrics = &size->root.metrics;
FT_Size_Metrics* metrics2 = &size->metrics;
TT_Face face = (TT_Face)size->root.face;
@@ -259,8 +261,16 @@
/* FreeType error code. 0 means success. */
/* */
static FT_Error
- Set_Pixel_Sizes( TT_Size size )
+ Set_Pixel_Sizes( FT_Size ttsize, /* TT_Size */
+ FT_UInt pixel_width,
+ FT_UInt pixel_height )
{
+ TT_Size size = (TT_Size)ttsize;
+
+ FT_UNUSED( pixel_width );
+ FT_UNUSED( pixel_height );
+
+
/* many things have been pre-computed by the base layer */
size->metrics = size->root.metrics;
@@ -300,12 +310,14 @@
/* FreeType error code. 0 means success. */
/* */
static FT_Error
- Load_Glyph( TT_GlyphSlot slot,
- TT_Size size,
+ Load_Glyph( FT_GlyphSlot ttslot, /* TT_GlyphSlot */
+ FT_Size ttsize, /* TT_Size */
FT_UInt glyph_index,
FT_Int32 load_flags )
{
- FT_Error error;
+ TT_GlyphSlot slot = (TT_GlyphSlot)ttslot;
+ TT_Size size = (TT_Size)ttsize;
+ FT_Error error;
if ( !slot )
@@ -377,7 +389,7 @@
static FT_Module_Interface
- tt_get_interface( TT_Driver driver,
+ tt_get_interface( FT_Module driver, /* TT_Driver */
const char* tt_interface )
{
FT_Module_Interface result;
@@ -390,12 +402,12 @@
return result;
/* only return the default interface from the SFNT module */
- sfntd = FT_Get_Module( driver->root.root.library, "sfnt" );
+ sfntd = FT_Get_Module( driver->library, "sfnt" );
if ( sfntd )
{
sfnt = (SFNT_Service)( sfntd->clazz->module_interface );
if ( sfnt )
- return sfnt->get_interface( FT_MODULE( driver ), tt_interface );
+ return sfnt->get_interface( driver, tt_interface );
}
return 0;
@@ -424,30 +436,29 @@
(void*)0, /* driver specific interface */
- (FT_Module_Constructor)tt_driver_init,
- (FT_Module_Destructor) tt_driver_done,
- (FT_Module_Requester) tt_get_interface,
+ tt_driver_init,
+ tt_driver_done,
+ tt_get_interface,
},
sizeof ( TT_FaceRec ),
sizeof ( TT_SizeRec ),
sizeof ( FT_GlyphSlotRec ),
+ tt_face_init,
+ tt_face_done,
+ tt_size_init,
+ tt_size_done,
+ 0, /* FT_Slot_InitFunc */
+ 0, /* FT_Slot_DoneFunc */
- (FT_Face_InitFunc) tt_face_init,
- (FT_Face_DoneFunc) tt_face_done,
- (FT_Size_InitFunc) tt_size_init,
- (FT_Size_DoneFunc) tt_size_done,
- (FT_Slot_InitFunc) 0,
- (FT_Slot_DoneFunc) 0,
-
- (FT_Size_ResetPointsFunc)Set_Char_Sizes,
- (FT_Size_ResetPixelsFunc)Set_Pixel_Sizes,
- (FT_Slot_LoadFunc) Load_Glyph,
+ Set_Char_Sizes,
+ Set_Pixel_Sizes,
+ Load_Glyph,
- (FT_Face_GetKerningFunc) Get_Kerning,
- (FT_Face_AttachFunc) 0,
- (FT_Face_GetAdvancesFunc)0
+ Get_Kerning,
+ 0, /* FT_Face_AttachFunc */
+ 0 /* FT_Face_GetAdvancesFunc */
};
diff --git a/src/truetype/ttobjs.c b/src/truetype/ttobjs.c
index 579dc4a..89d7c88 100644
--- a/src/truetype/ttobjs.c
+++ b/src/truetype/ttobjs.c
@@ -165,7 +165,7 @@
/* */
FT_LOCAL_DEF( FT_Error )
tt_face_init( FT_Stream stream,
- TT_Face face,
+ FT_Face ttface, /* TT_Face */
FT_Int face_index,
FT_Int num_params,
FT_Parameter* params )
@@ -173,6 +173,7 @@
FT_Error error;
FT_Library library;
SFNT_Service sfnt;
+ TT_Face face = (TT_Face)ttface;
library = face->root.driver->root.library;
@@ -269,8 +270,9 @@
/* face :: A pointer to the face object to destroy. */
/* */
FT_LOCAL_DEF( void )
- tt_face_done( TT_Face face )
+ tt_face_done( FT_Face ttface ) /* TT_Face */
{
+ TT_Face face = (TT_Face)ttface;
FT_Memory memory = face->root.memory;
FT_Stream stream = face->root.stream;
@@ -327,8 +329,9 @@
/* FreeType error code. 0 means success. */
/* */
FT_LOCAL_DEF( FT_Error )
- tt_size_init( TT_Size size )
+ tt_size_init( FT_Size ttsize ) /* TT_Size */
{
+ TT_Size size = (TT_Size)ttsize;
FT_Error error = TT_Err_Ok;
@@ -485,7 +488,7 @@
Fail_Memory:
- tt_size_done( size );
+ tt_size_done( ttsize );
return error;
#endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */
@@ -505,8 +508,9 @@
/* size :: A handle to the target size object. */
/* */
FT_LOCAL_DEF( void )
- tt_size_done( TT_Size size )
+ tt_size_done( FT_Size ttsize ) /* TT_Size */
{
+ TT_Size size = (TT_Size)ttsize;
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
@@ -851,7 +855,7 @@
/* FreeType error code. 0 means success. */
/* */
FT_LOCAL_DEF( FT_Error )
- tt_driver_init( TT_Driver driver )
+ tt_driver_init( FT_Module driver ) /* TT_Driver */
{
FT_Error error;
@@ -875,9 +879,11 @@
/* driver :: A handle to the target TrueType driver. */
/* */
FT_LOCAL_DEF( void )
- tt_driver_done( TT_Driver driver )
+ tt_driver_done( FT_Module ttdriver ) /* TT_Driver */
{
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
+ TT_Driver driver = (TT_Driver)ttdriver;
+
/* destroy the execution context */
if ( driver->context )
diff --git a/src/truetype/ttobjs.h b/src/truetype/ttobjs.h
index 30cf1cb..423d3f0 100644
--- a/src/truetype/ttobjs.h
+++ b/src/truetype/ttobjs.h
@@ -380,19 +380,28 @@ FT_BEGIN_HEADER
} TT_DriverRec;
+ /* Note: All of the functions below (except tt_size_reset()) are used */
+ /* as function pointers in a FT_Driver_ClassRec. Therefore their */
+ /* parameters are of types FT_Face, FT_Size, etc., rather than TT_Face, */
+ /* TT_Size, etc., so that the compiler can confirm that the types and */
+ /* number of parameters are correct. In all cases the FT_xxx types are */
+ /* cast to their TT_xxx counterparts inside the functions since FreeType */
+ /* will always use the TT driver to create them. */
+
+
/*************************************************************************/
/* */
/* Face functions */
/* */
FT_LOCAL( FT_Error )
tt_face_init( FT_Stream stream,
- TT_Face face,
+ FT_Face ttface, /* TT_Face */
FT_Int face_index,
FT_Int num_params,
FT_Parameter* params );
FT_LOCAL( void )
- tt_face_done( TT_Face face );
+ tt_face_done( FT_Face ttface ); /* TT_Face */
/*************************************************************************/
@@ -400,10 +409,10 @@ FT_BEGIN_HEADER
/* Size functions */
/* */
FT_LOCAL( FT_Error )
- tt_size_init( TT_Size size );
+ tt_size_init( FT_Size ttsize ); /* TT_Size */
FT_LOCAL( void )
- tt_size_done( TT_Size size );
+ tt_size_done( FT_Size ttsize ); /* TT_Size */
FT_LOCAL( FT_Error )
tt_size_reset( TT_Size size );
@@ -414,10 +423,10 @@ FT_BEGIN_HEADER
/* Driver functions */
/* */
FT_LOCAL( FT_Error )
- tt_driver_init( TT_Driver driver );
+ tt_driver_init( FT_Module ttdriver ); /* TT_Driver */
FT_LOCAL( void )
- tt_driver_done( TT_Driver driver );
+ tt_driver_done( FT_Module ttdriver ); /* TT_Driver */
FT_END_HEADER