* 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.
This commit is contained in:
Werner Lemberg 2004-05-04 16:53:45 +00:00
parent 44005cd358
commit 86ae11cf87
5 changed files with 80 additions and 39 deletions

View File

@ -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> 2004-05-02 Werner Lemberg <wl@gnu.org>
* src/sfnt/ttload.c (tt_face_free_names): Check that `table->names' * src/sfnt/ttload.c (tt_face_free_names): Check that `table->names'

View File

@ -12,7 +12,7 @@
<p>This directory contains a project files for Visual C++, named <p>This directory contains a project files for Visual C++, named
<tt>freetype.dsp</tt>, and Visual Studio, called <tt>freetype.sln</tt>. It <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> <ul>
<pre> <pre>

View File

@ -99,11 +99,12 @@
/* They can be implemented by format-specific interfaces. */ /* They can be implemented by format-specific interfaces. */
/* */ /* */
static FT_Error static FT_Error
Get_Kerning( TT_Face face, Get_Kerning( FT_Face ttface, /* TT_Face */
FT_UInt left_glyph, FT_UInt left_glyph,
FT_UInt right_glyph, FT_UInt right_glyph,
FT_Vector* kerning ) FT_Vector* kerning )
{ {
TT_Face face = (TT_Face)ttface;
TT_Kern0_Pair pair; TT_Kern0_Pair pair;
@ -194,12 +195,13 @@
/* FreeType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
static FT_Error static FT_Error
Set_Char_Sizes( TT_Size size, Set_Char_Sizes( FT_Size ttsize, /* TT_Size */
FT_F26Dot6 char_width, FT_F26Dot6 char_width,
FT_F26Dot6 char_height, FT_F26Dot6 char_height,
FT_UInt horz_resolution, FT_UInt horz_resolution,
FT_UInt vert_resolution ) FT_UInt vert_resolution )
{ {
TT_Size size = (TT_Size)ttsize;
FT_Size_Metrics* metrics = &size->root.metrics; FT_Size_Metrics* metrics = &size->root.metrics;
FT_Size_Metrics* metrics2 = &size->metrics; FT_Size_Metrics* metrics2 = &size->metrics;
TT_Face face = (TT_Face)size->root.face; TT_Face face = (TT_Face)size->root.face;
@ -259,8 +261,16 @@
/* FreeType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
static FT_Error 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 */ /* many things have been pre-computed by the base layer */
size->metrics = size->root.metrics; size->metrics = size->root.metrics;
@ -300,12 +310,14 @@
/* FreeType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
static FT_Error static FT_Error
Load_Glyph( TT_GlyphSlot slot, Load_Glyph( FT_GlyphSlot ttslot, /* TT_GlyphSlot */
TT_Size size, FT_Size ttsize, /* TT_Size */
FT_UInt glyph_index, FT_UInt glyph_index,
FT_Int32 load_flags ) FT_Int32 load_flags )
{ {
FT_Error error; TT_GlyphSlot slot = (TT_GlyphSlot)ttslot;
TT_Size size = (TT_Size)ttsize;
FT_Error error;
if ( !slot ) if ( !slot )
@ -377,7 +389,7 @@
static FT_Module_Interface static FT_Module_Interface
tt_get_interface( TT_Driver driver, tt_get_interface( FT_Module driver, /* TT_Driver */
const char* tt_interface ) const char* tt_interface )
{ {
FT_Module_Interface result; FT_Module_Interface result;
@ -390,12 +402,12 @@
return result; return result;
/* only return the default interface from the SFNT module */ /* 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 ) if ( sfntd )
{ {
sfnt = (SFNT_Service)( sfntd->clazz->module_interface ); sfnt = (SFNT_Service)( sfntd->clazz->module_interface );
if ( sfnt ) if ( sfnt )
return sfnt->get_interface( FT_MODULE( driver ), tt_interface ); return sfnt->get_interface( driver, tt_interface );
} }
return 0; return 0;
@ -424,30 +436,29 @@
(void*)0, /* driver specific interface */ (void*)0, /* driver specific interface */
(FT_Module_Constructor)tt_driver_init, tt_driver_init,
(FT_Module_Destructor) tt_driver_done, tt_driver_done,
(FT_Module_Requester) tt_get_interface, tt_get_interface,
}, },
sizeof ( TT_FaceRec ), sizeof ( TT_FaceRec ),
sizeof ( TT_SizeRec ), sizeof ( TT_SizeRec ),
sizeof ( FT_GlyphSlotRec ), 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, Set_Char_Sizes,
(FT_Face_DoneFunc) tt_face_done, Set_Pixel_Sizes,
(FT_Size_InitFunc) tt_size_init, Load_Glyph,
(FT_Size_DoneFunc) tt_size_done,
(FT_Slot_InitFunc) 0,
(FT_Slot_DoneFunc) 0,
(FT_Size_ResetPointsFunc)Set_Char_Sizes, Get_Kerning,
(FT_Size_ResetPixelsFunc)Set_Pixel_Sizes, 0, /* FT_Face_AttachFunc */
(FT_Slot_LoadFunc) Load_Glyph, 0 /* FT_Face_GetAdvancesFunc */
(FT_Face_GetKerningFunc) Get_Kerning,
(FT_Face_AttachFunc) 0,
(FT_Face_GetAdvancesFunc)0
}; };

View File

@ -165,7 +165,7 @@
/* */ /* */
FT_LOCAL_DEF( FT_Error ) FT_LOCAL_DEF( FT_Error )
tt_face_init( FT_Stream stream, tt_face_init( FT_Stream stream,
TT_Face face, FT_Face ttface, /* TT_Face */
FT_Int face_index, FT_Int face_index,
FT_Int num_params, FT_Int num_params,
FT_Parameter* params ) FT_Parameter* params )
@ -173,6 +173,7 @@
FT_Error error; FT_Error error;
FT_Library library; FT_Library library;
SFNT_Service sfnt; SFNT_Service sfnt;
TT_Face face = (TT_Face)ttface;
library = face->root.driver->root.library; library = face->root.driver->root.library;
@ -269,8 +270,9 @@
/* face :: A pointer to the face object to destroy. */ /* face :: A pointer to the face object to destroy. */
/* */ /* */
FT_LOCAL_DEF( void ) 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_Memory memory = face->root.memory;
FT_Stream stream = face->root.stream; FT_Stream stream = face->root.stream;
@ -327,8 +329,9 @@
/* FreeType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
FT_LOCAL_DEF( FT_Error ) 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; FT_Error error = TT_Err_Ok;
@ -485,7 +488,7 @@
Fail_Memory: Fail_Memory:
tt_size_done( size ); tt_size_done( ttsize );
return error; return error;
#endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */ #endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */
@ -505,8 +508,9 @@
/* size :: A handle to the target size object. */ /* size :: A handle to the target size object. */
/* */ /* */
FT_LOCAL_DEF( void ) 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 #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
@ -851,7 +855,7 @@
/* FreeType error code. 0 means success. */ /* FreeType error code. 0 means success. */
/* */ /* */
FT_LOCAL_DEF( FT_Error ) FT_LOCAL_DEF( FT_Error )
tt_driver_init( TT_Driver driver ) tt_driver_init( FT_Module driver ) /* TT_Driver */
{ {
FT_Error error; FT_Error error;
@ -875,9 +879,11 @@
/* driver :: A handle to the target TrueType driver. */ /* driver :: A handle to the target TrueType driver. */
/* */ /* */
FT_LOCAL_DEF( void ) FT_LOCAL_DEF( void )
tt_driver_done( TT_Driver driver ) tt_driver_done( FT_Module ttdriver ) /* TT_Driver */
{ {
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
TT_Driver driver = (TT_Driver)ttdriver;
/* destroy the execution context */ /* destroy the execution context */
if ( driver->context ) if ( driver->context )

View File

@ -380,19 +380,28 @@ FT_BEGIN_HEADER
} TT_DriverRec; } 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 */ /* Face functions */
/* */ /* */
FT_LOCAL( FT_Error ) FT_LOCAL( FT_Error )
tt_face_init( FT_Stream stream, tt_face_init( FT_Stream stream,
TT_Face face, FT_Face ttface, /* TT_Face */
FT_Int face_index, FT_Int face_index,
FT_Int num_params, FT_Int num_params,
FT_Parameter* params ); FT_Parameter* params );
FT_LOCAL( void ) 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 */ /* Size functions */
/* */ /* */
FT_LOCAL( FT_Error ) FT_LOCAL( FT_Error )
tt_size_init( TT_Size size ); tt_size_init( FT_Size ttsize ); /* TT_Size */
FT_LOCAL( void ) FT_LOCAL( void )
tt_size_done( TT_Size size ); tt_size_done( FT_Size ttsize ); /* TT_Size */
FT_LOCAL( FT_Error ) FT_LOCAL( FT_Error )
tt_size_reset( TT_Size size ); tt_size_reset( TT_Size size );
@ -414,10 +423,10 @@ FT_BEGIN_HEADER
/* Driver functions */ /* Driver functions */
/* */ /* */
FT_LOCAL( FT_Error ) FT_LOCAL( FT_Error )
tt_driver_init( TT_Driver driver ); tt_driver_init( FT_Module ttdriver ); /* TT_Driver */
FT_LOCAL( void ) FT_LOCAL( void )
tt_driver_done( TT_Driver driver ); tt_driver_done( FT_Module ttdriver ); /* TT_Driver */
FT_END_HEADER FT_END_HEADER