diff --git a/ChangeLog b/ChangeLog index dc10196e4..b83770b56 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2002-04-01 Werner Lemberg + + * src/truetype/ttgload.c: 16bit fixes. + (TT_Load_Simple_Glyph): Improve debug messages. + (load_truetype_glyph): Remove dead code. + * src/truetype/ttinterp.c: 16bit fixes. + * src/truetype/ttobjs.c: Ditto. + + * include/freetype/ftsnames.h, include/freetype/internal/sfnt.h, + src/cff/cffload.h, src/psaux/psobjs.h, src/truetype/ttinterp.[ch], + src/sfnt/ttpost.h: s/index/idx/. + 2002-03-31 Yao Zhang * src/truetype/ttobjs.c (TT_Size_Init): Fix typo. @@ -97,6 +109,15 @@ * src/sfnt/sfdriver.c, src/sfnt/sfobjs.c, src/sfnt/ttcmap0.c: Fixed a small bug in the FT_CMaps support code. +2002-03-25 David Turner + + * src/truetype/ttinterp.c (Norm): Replaced with... + (TT_VecLen): This. + (TT_MulFix14, TT_DotFix14): New functions. + (Project, Dual_Project, Free_Project, Compute_Point_Displacement, + Ins_SHPIX, Ins_MIAP, Ins_MIRP): Use them. + [FT_CONFIG_OPTION_OLD_CALCS]: Removed all code. + 2002-03-22 David Turner * src/base/ftobjs.c, src/sfnt/ttcmap0.c, src/type1/t1objs.c: diff --git a/include/freetype/ftsnames.h b/include/freetype/ftsnames.h index 727e451e8..356f98349 100644 --- a/include/freetype/ftsnames.h +++ b/include/freetype/ftsnames.h @@ -7,7 +7,7 @@ /* */ /* This is _not_ used to retrieve glyph names! */ /* */ -/* Copyright 1996-2001 by */ +/* Copyright 1996-2001, 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -128,7 +128,7 @@ FT_BEGIN_HEADER /* */ /* face :: A handle to the source face. */ /* */ - /* index :: The index of the `name' string. */ + /* idx :: The index of the `name' string. */ /* */ /* */ /* aname :: The indexed FT_SfntName structure. */ @@ -146,7 +146,7 @@ FT_BEGIN_HEADER /* */ FT_EXPORT( FT_Error ) FT_Get_Sfnt_Name( FT_Face face, - FT_UInt index, + FT_UInt idx, FT_SfntName *aname ); diff --git a/include/freetype/internal/sfnt.h b/include/freetype/internal/sfnt.h index 04ce97f4f..b6a3aeda8 100644 --- a/include/freetype/internal/sfnt.h +++ b/include/freetype/internal/sfnt.h @@ -326,7 +326,7 @@ FT_BEGIN_HEADER /* Gets the PostScript glyph name of a glyph. */ /* */ /* */ - /* index :: The glyph index. */ + /* idx :: The glyph index. */ /* */ /* PSname :: The address of a string pointer. Will be NULL in case */ /* of error, otherwise it is a pointer to the glyph name. */ @@ -338,7 +338,7 @@ FT_BEGIN_HEADER /* */ typedef FT_Error (*TT_Get_PS_Name_Func)( TT_Face face, - FT_UInt index, + FT_UInt idx, FT_String** PSname ); diff --git a/src/cff/cffload.h b/src/cff/cffload.h index 9511838e6..18f78df7f 100644 --- a/src/cff/cffload.h +++ b/src/cff/cffload.h @@ -32,23 +32,23 @@ FT_BEGIN_HEADER FT_LOCAL( FT_String* ) - CFF_Get_Name( CFF_Index index, + CFF_Get_Name( CFF_Index idx, FT_UInt element ); FT_LOCAL( FT_String* ) - CFF_Get_String( CFF_Index index, + CFF_Get_String( CFF_Index idx, FT_UInt sid, PSNames_Service interface ); FT_LOCAL( FT_Error ) - CFF_Access_Element( CFF_Index index, + CFF_Access_Element( CFF_Index idx, FT_UInt element, FT_Byte** pbytes, FT_ULong* pbyte_len ); FT_LOCAL( void ) - CFF_Forget_Element( CFF_Index index, + CFF_Forget_Element( CFF_Index idx, FT_Byte** pbytes ); diff --git a/src/psaux/psobjs.c b/src/psaux/psobjs.c index b4639590f..891edb0b7 100644 --- a/src/psaux/psobjs.c +++ b/src/psaux/psobjs.c @@ -139,7 +139,7 @@ /* table :: The target table. */ /* */ /* */ - /* index :: The index of the object in the table. */ + /* idx :: The index of the object in the table. */ /* */ /* object :: The address of the object to copy in memory. */ /* */ diff --git a/src/psaux/psobjs.h b/src/psaux/psobjs.h index 712def61f..f748085f3 100644 --- a/src/psaux/psobjs.h +++ b/src/psaux/psobjs.h @@ -53,7 +53,7 @@ FT_BEGIN_HEADER FT_LOCAL( FT_Error ) PS_Table_Add( PS_Table table, - FT_Int index, + FT_Int idx, void* object, FT_Int length ); diff --git a/src/sfnt/ttpost.h b/src/sfnt/ttpost.h index fd7f2afae..57b1c8c70 100644 --- a/src/sfnt/ttpost.h +++ b/src/sfnt/ttpost.h @@ -31,7 +31,7 @@ FT_BEGIN_HEADER FT_LOCAL( FT_Error ) TT_Get_PS_Name( TT_Face face, - FT_UInt index, + FT_UInt idx, FT_String** PSname ); FT_LOCAL( void ) diff --git a/src/smooth/ftgrays.c b/src/smooth/ftgrays.c index bba31ad7d..a2add7215 100644 --- a/src/smooth/ftgrays.c +++ b/src/smooth/ftgrays.c @@ -4,7 +4,7 @@ /* */ /* A new `perfect' anti-aliasing renderer (body). */ /* */ -/* Copyright 2000-2001 by */ +/* Copyright 2000-2001, 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -17,66 +17,66 @@ /*************************************************************************/ /* */ - /* This file can be compiled without the rest of the FreeType engine, */ - /* by defining the _STANDALONE_ macro when compiling it. You also need */ - /* to put the files `ftgrays.h' and `ftimage.h' into the current */ - /* compilation directory. Typically, you could do something like */ + /* This file can be compiled without the rest of the FreeType engine, by */ + /* defining the _STANDALONE_ macro when compiling it. You also need to */ + /* 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/base/ftgrays.c' to your current directory */ /* */ - /* - copy `include/freetype/ftimage.h' and */ - /* `include/freetype/ftgrays.h' to the same directory */ + /* - copy `include/freetype/ftimage.h' and `include/freetype/ftgrays.h' */ + /* to the same directory */ /* */ - /* - compile `ftgrays' with the _STANDALONE_ macro defined, as in */ + /* - compile `ftgrays' with the _STANDALONE_ macro defined, as in */ /* */ - /* cc -c -D_STANDALONE_ ftgrays.c */ + /* cc -c -D_STANDALONE_ ftgrays.c */ /* */ - /* The renderer can be initialized with a call to */ - /* `ft_gray_raster.gray_raster_new'; an anti-aliased bitmap can be */ - /* generated with a call to `ft_gray_raster.gray_raster_render'. */ + /* The renderer can be initialized with a call to */ + /* `ft_gray_raster.gray_raster_new'; an anti-aliased bitmap can be */ + /* generated with a call to `ft_gray_raster.gray_raster_render'. */ /* */ - /* See the comments and documentation in the file `ftimage.h' for */ - /* more details on how the raster works. */ + /* See the comments and documentation in the file `ftimage.h' for more */ + /* details on how the raster works. */ /* */ /*************************************************************************/ /*************************************************************************/ /* */ - /* This is a new anti-aliasing scan-converter for FreeType 2. The */ - /* algorithm used here is _very_ different from the one in the standard */ - /* `ftraster' module. Actually, `ftgrays' computes the _exact_ */ - /* coverage of the outline on each pixel cell. */ + /* This is a new anti-aliasing scan-converter for FreeType 2. The */ + /* algorithm used here is _very_ different from the one in the standard */ + /* `ftraster' module. Actually, `ftgrays' computes the _exact_ */ + /* coverage of the outline on each pixel cell. */ /* */ - /* It is based on ideas that I initially found in Raph Levien's */ - /* excellent LibArt graphics library (see http://www.levien.com/libart */ - /* for more information, though the web pages do not tell anything */ - /* about the renderer; you'll have to dive into the source code to */ - /* understand how it works). */ + /* It is based on ideas that I initially found in Raph Levien's */ + /* excellent LibArt graphics library (see http://www.levien.com/libart */ + /* for more information, though the web pages do not tell anything */ + /* about the renderer; you'll have to dive into the source code to */ + /* understand how it works). */ /* */ - /* Note, however, that this is a _very_ different implementation */ - /* compared to Raph's. Coverage information is stored in a very */ - /* different way, and I don't use sorted vector paths. Also, it */ - /* doesn't use floating point values. */ + /* Note, however, that this is a _very_ different implementation */ + /* compared to Raph's. Coverage information is stored in a very */ + /* different way, and I don't use sorted vector paths. Also, it doesn't */ + /* use floating point values. */ /* */ - /* This renderer has the following advantages: */ + /* This renderer has the following advantages: */ /* */ - /* - It doesn't need an intermediate bitmap. Instead, one can supply */ - /* a callback function that will be called by the renderer to draw */ - /* gray spans on any target surface. You can thus do direct */ - /* composition on any kind of bitmap, provided that you give the */ - /* renderer the right callback. */ + /* - It doesn't need an intermediate bitmap. Instead, one can supply a */ + /* callback function that will be called by the renderer to draw gray */ + /* spans on any target surface. You can thus do direct composition on */ + /* any kind of bitmap, provided that you give the renderer the right */ + /* callback. */ /* */ - /* - A perfect anti-aliaser, i.e., it computes the _exact_ coverage on */ - /* each pixel cell */ + /* - A perfect anti-aliaser, i.e., it computes the _exact_ coverage on */ + /* each pixel cell. */ /* */ - /* - It performs a single pass on the outline (the `standard' FT2 */ - /* renderer makes two passes). */ + /* - It performs a single pass on the outline (the `standard' FT2 */ + /* renderer makes two passes). */ /* */ - /* - It can easily be modified to render to _any_ number of gray levels */ - /* cheaply. */ + /* - It can easily be modified to render to _any_ number of gray levels */ + /* cheaply. */ /* */ - /* - For small (< 20) pixel sizes, it is faster than the standard */ - /* renderer. */ + /* - For small (< 20) pixel sizes, it is faster than the standard */ + /* renderer. */ /* */ /*************************************************************************/ @@ -146,7 +146,7 @@ #ifndef FT_MEM_SET -#define FT_MEM_SET( d, s, c ) memset( d, s, c ) +#define FT_MEM_SET( d, s, c ) memset( d, s, c ) #endif /* define this to dump debugging information */ @@ -2130,11 +2130,11 @@ { ft_glyph_format_outline, - (FT_Raster_New_Func) gray_raster_new, - (FT_Raster_Reset_Func) gray_raster_reset, - (FT_Raster_Set_Mode_Func) 0, - (FT_Raster_Render_Func) gray_raster_render, - (FT_Raster_Done_Func) gray_raster_done + (FT_Raster_New_Func) gray_raster_new, + (FT_Raster_Reset_Func) gray_raster_reset, + (FT_Raster_Set_Mode_Func)0, + (FT_Raster_Render_Func) gray_raster_render, + (FT_Raster_Done_Func) gray_raster_done }; diff --git a/src/smooth/ftsmooth.c b/src/smooth/ftsmooth.c index 80c4c99e8..b717926db 100644 --- a/src/smooth/ftsmooth.c +++ b/src/smooth/ftsmooth.c @@ -4,7 +4,7 @@ /* */ /* Anti-aliasing renderer interface (body). */ /* */ -/* Copyright 2000-2001 by */ +/* Copyright 2000-2001, 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ diff --git a/src/smooth/rules.mk b/src/smooth/rules.mk index 445882323..457f1e5f4 100644 --- a/src/smooth/rules.mk +++ b/src/smooth/rules.mk @@ -3,7 +3,7 @@ # -# Copyright 1996-2000 by +# Copyright 1996-2000, 2001 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, diff --git a/src/truetype/descrip.mms b/src/truetype/descrip.mms index 675fd0e02..e30ee1b3f 100644 --- a/src/truetype/descrip.mms +++ b/src/truetype/descrip.mms @@ -3,7 +3,7 @@ # -# Copyright 2001 by +# Copyright 2001, 2002 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, diff --git a/src/truetype/rules.mk b/src/truetype/rules.mk index 4ef367846..7c1f3e3a6 100644 --- a/src/truetype/rules.mk +++ b/src/truetype/rules.mk @@ -3,7 +3,7 @@ # -# Copyright 1996-2000 by +# Copyright 1996-2000, 2001 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, diff --git a/src/truetype/ttdriver.c b/src/truetype/ttdriver.c index 0902be391..7011921b9 100644 --- a/src/truetype/ttdriver.c +++ b/src/truetype/ttdriver.c @@ -4,7 +4,7 @@ /* */ /* TrueType font driver implementation (body). */ /* */ -/* Copyright 1996-2001 by */ +/* Copyright 1996-2001, 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -365,9 +365,9 @@ Get_Char_Index( TT_CharMap charmap, FT_Long charcode ) { - FT_Error error; - TT_Face face; - TT_CMapTable cmap; + FT_Error error; + TT_Face face; + TT_CMapTable cmap; cmap = &charmap->cmap; @@ -412,9 +412,9 @@ Get_Next_Char( TT_CharMap charmap, FT_Long charcode ) { - FT_Error error; - TT_Face face; - TT_CMapTable cmap; + FT_Error error; + TT_Face face; + TT_CMapTable cmap; cmap = &charmap->cmap; @@ -457,8 +457,8 @@ tt_get_interface( TT_Driver driver, const char* interface ) { - FT_Module sfntd = FT_Get_Module( driver->root.root.library, - "sfnt" ); + FT_Module sfntd = FT_Get_Module( driver->root.root.library, + "sfnt" ); SFNT_Service sfnt; @@ -506,23 +506,23 @@ sizeof ( FT_GlyphSlotRec ), - (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_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, - (FT_CharMap_CharIndexFunc) Get_Char_Index, + (FT_Size_ResetPixelsFunc) Set_Pixel_Sizes, + (FT_Slot_LoadFunc) Load_Glyph, + (FT_CharMap_CharIndexFunc)Get_Char_Index, - (FT_Face_GetKerningFunc) Get_Kerning, - (FT_Face_AttachFunc) 0, - (FT_Face_GetAdvancesFunc) 0, + (FT_Face_GetKerningFunc) Get_Kerning, + (FT_Face_AttachFunc) 0, + (FT_Face_GetAdvancesFunc) 0, - (FT_CharMap_CharNextFunc) Get_Next_Char + (FT_CharMap_CharNextFunc) Get_Next_Char }; diff --git a/src/truetype/ttdriver.h b/src/truetype/ttdriver.h index e4f5aaf9a..f6f26e4b5 100644 --- a/src/truetype/ttdriver.h +++ b/src/truetype/ttdriver.h @@ -4,7 +4,7 @@ /* */ /* High-level TrueType driver interface (specification). */ /* */ -/* Copyright 1996-2001 by */ +/* Copyright 1996-2001, 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c index 4ff468b68..50cd21946 100644 --- a/src/truetype/ttgload.c +++ b/src/truetype/ttgload.c @@ -4,7 +4,7 @@ /* */ /* TrueType Glyph Loader (body). */ /* */ -/* Copyright 1996-2001 by */ +/* Copyright 1996-2001, 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -87,8 +87,8 @@ FT_Short* bearing, FT_UShort* advance ) { - TT_LongMetrics longs_m; - FT_UShort k = header->number_Of_HMetrics; + TT_LongMetrics longs_m; + FT_UShort k = header->number_Of_HMetrics; if ( idx < (FT_UInt)k ) @@ -127,8 +127,8 @@ /*************************************************************************/ /* */ - /* Returns the advance width table for a given pixel size if it is */ - /* found in the font's `hdmx' table (if any). */ + /* Returns the advance width table for a given pixel size if it is found */ + /* in the font's `hdmx' table (if any). */ /* */ static FT_Byte* Get_Advance_Widths( TT_Face face, @@ -136,6 +136,7 @@ { FT_UShort n; + for ( n = 0; n < face->hdmx.num_records; n++ ) if ( face->hdmx.records[n].ppem == ppem ) return face->hdmx.records[n].widths; @@ -153,7 +154,7 @@ /*************************************************************************/ /* */ - /* Translates an array of coordinates. */ + /* Translates an array of coordinates. */ /* */ static void translate_array( FT_UInt n, @@ -175,10 +176,10 @@ static void - tt_prepare_zone( TT_GlyphZone zone, - FT_GlyphLoad load, - FT_UInt start_point, - FT_UInt start_contour ) + tt_prepare_zone( TT_GlyphZone zone, + FT_GlyphLoad load, + FT_UInt start_point, + FT_UInt start_contour ) { zone->n_points = (FT_UShort)( load->outline.n_points - start_point ); zone->n_contours = (FT_Short) ( load->outline.n_contours - start_contour ); @@ -195,17 +196,17 @@ /*************************************************************************/ /* */ - /* The following functions are used by default with TrueType fonts. */ - /* However, they can be replaced by alternatives if we need to support */ - /* TrueType-compressed formats (like MicroType) in the future. */ + /* The following functions are used by default with TrueType fonts. */ + /* However, they can be replaced by alternatives if we need to support */ + /* TrueType-compressed formats (like MicroType) in the future. */ /* */ /*************************************************************************/ FT_CALLBACK_DEF( FT_Error ) - TT_Access_Glyph_Frame( TT_Loader loader, - FT_UInt glyph_index, - FT_ULong offset, - FT_UInt byte_count ) + TT_Access_Glyph_Frame( TT_Loader loader, + FT_UInt glyph_index, + FT_ULong offset, + FT_UInt byte_count ) { FT_Error error; FT_Stream stream = loader->stream; @@ -225,7 +226,7 @@ FT_CALLBACK_DEF( void ) - TT_Forget_Glyph_Frame( TT_Loader loader ) + TT_Forget_Glyph_Frame( TT_Loader loader ) { FT_Stream stream = loader->stream; @@ -235,10 +236,10 @@ FT_CALLBACK_DEF( FT_Error ) - TT_Load_Glyph_Header( TT_Loader loader ) + TT_Load_Glyph_Header( TT_Loader loader ) { - FT_Stream stream = loader->stream; - FT_Int byte_len = loader->byte_len - 10; + FT_Stream stream = loader->stream; + FT_Int byte_len = loader->byte_len - 10; if ( byte_len < 0 ) @@ -263,18 +264,18 @@ FT_CALLBACK_DEF( FT_Error ) - TT_Load_Simple_Glyph( TT_Loader load ) + TT_Load_Simple_Glyph( TT_Loader load ) { - FT_Error error; - FT_Stream stream = load->stream; - FT_GlyphLoader gloader = load->gloader; - FT_Int n_contours = load->n_contours; - FT_Outline* outline; - TT_Face face = (TT_Face)load->face; - TT_GlyphSlot slot = (TT_GlyphSlot)load->glyph; - FT_UShort n_ins; - FT_Int n, n_points; - FT_Int byte_len = load->byte_len; + FT_Error error; + FT_Stream stream = load->stream; + FT_GlyphLoader gloader = load->gloader; + FT_Int n_contours = load->n_contours; + FT_Outline* outline; + TT_Face face = (TT_Face)load->face; + TT_GlyphSlot slot = (TT_GlyphSlot)load->glyph; + FT_UShort n_ins; + FT_Int n, n_points; + FT_Int byte_len = load->byte_len; /* reading the contours endpoints & number of points */ @@ -317,7 +318,7 @@ if ( n_ins > face->max_profile.maxSizeOfInstructions ) { - FT_TRACE0(( "ERROR: Too many instructions!\n" )); + FT_TRACE0(( "TT_Load_Simple_Glyph: Too many instructions!\n" )); error = TT_Err_Too_Many_Hints; goto Fail; } @@ -325,7 +326,7 @@ byte_len -= n_ins; if ( byte_len < 0 ) { - FT_TRACE0(( "ERROR: Instruction count mismatch!\n" )); + FT_TRACE0(( "TT_Load_Simple_Glyph: Instruction count mismatch!\n" )); error = TT_Err_Too_Many_Hints; goto Fail; } @@ -466,14 +467,14 @@ FT_CALLBACK_DEF( FT_Error ) - TT_Load_Composite_Glyph( TT_Loader loader ) + TT_Load_Composite_Glyph( TT_Loader loader ) { - FT_Error error; - FT_Stream stream = loader->stream; - FT_GlyphLoader gloader = loader->gloader; + FT_Error error; + FT_Stream stream = loader->stream; + FT_GlyphLoader gloader = loader->gloader; FT_SubGlyph subglyph; - FT_UInt num_subglyphs; - FT_Int byte_len = loader->byte_len; + FT_UInt num_subglyphs; + FT_Int byte_len = loader->byte_len; num_subglyphs = 0; @@ -603,17 +604,17 @@ /* interpretation. */ /* */ static FT_Error - TT_Process_Simple_Glyph( TT_Loader load, - FT_Bool debug ) + TT_Process_Simple_Glyph( TT_Loader load, + FT_Bool debug ) { - FT_GlyphLoader gloader = load->gloader; - FT_Outline* outline = &gloader->current.outline; - FT_UInt n_points = outline->n_points; + FT_GlyphLoader gloader = load->gloader; + FT_Outline* outline = &gloader->current.outline; + FT_UInt n_points = outline->n_points; #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER - FT_UInt n_ins; + FT_UInt n_ins; #endif - TT_GlyphZone zone = &load->zone; - FT_Error error = TT_Err_Ok; + TT_GlyphZone zone = &load->zone; + FT_Error error = TT_Err_Ok; FT_UNUSED( debug ); /* used by truetype interpreter only */ @@ -737,22 +738,22 @@ /* TT_Loader object. */ /* */ static FT_Error - load_truetype_glyph( TT_Loader loader, - FT_UInt glyph_index ) + load_truetype_glyph( TT_Loader loader, + FT_UInt glyph_index ) { #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER - FT_Stream stream = loader->stream; + FT_Stream stream = loader->stream; #endif - FT_Error error; - TT_Face face = (TT_Face)loader->face; - FT_ULong offset; - FT_Int contours_count; - FT_UInt idx, num_points, count; - FT_Fixed x_scale, y_scale; - FT_GlyphLoader gloader = loader->gloader; - FT_Bool opened_frame = 0; + FT_Error error; + TT_Face face = (TT_Face)loader->face; + FT_ULong offset; + FT_Int contours_count; + FT_UInt idx, num_points, count; + FT_Fixed x_scale, y_scale; + FT_GlyphLoader gloader = loader->gloader; + FT_Bool opened_frame = 0; /* check glyph index */ @@ -781,8 +782,8 @@ Get_HMetrics( face, idx, - (FT_Bool)!(loader->load_flags & - FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH), + (FT_Bool)!( loader->load_flags & + FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ), &left_bearing, &advance_width ); @@ -830,16 +831,6 @@ loader->byte_len = (FT_Int)count; -#if 0 - /* temporary hack */ - if ( count < 10 ) - { - /* This glyph is corrupted -- it does not have a complete header */ - error = TT_Err_Invalid_Outline; - goto Fail; - } -#endif - offset = loader->glyf_offset + offset; /* access glyph frame */ @@ -889,7 +880,7 @@ #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER { - TT_Size size = (TT_Size)loader->size; + TT_Size size = (TT_Size)loader->size; error = TT_Process_Simple_Glyph( loader, @@ -951,9 +942,9 @@ /* set up remaining glyph fields */ FT_GlyphLoader_Add( gloader ); - glyph->num_subglyphs = gloader->base.num_subglyphs; - glyph->format = ft_glyph_format_composite; - glyph->subglyphs = gloader->base.subglyphs; + glyph->num_subglyphs = gloader->base.num_subglyphs; + glyph->format = ft_glyph_format_composite; + glyph->subglyphs = gloader->base.subglyphs; goto Exit; } @@ -964,11 +955,11 @@ /* Now, read each subglyph independently. */ { - FT_Int n, num_base_points, num_new_points; - FT_SubGlyph subglyph = 0; + FT_Int n, num_base_points, num_new_points; + FT_SubGlyph subglyph = 0; - FT_UInt num_subglyphs = gloader->current.num_subglyphs; - FT_UInt num_base_subgs = gloader->base.num_subglyphs; + FT_UInt num_subglyphs = gloader->current.num_subglyphs; + FT_UInt num_base_subgs = gloader->base.num_subglyphs; FT_GlyphLoader_Add( gloader ); @@ -1114,7 +1105,7 @@ FT_TRACE5(( " Instructions size = %d\n", n_ins )); /* in some fonts? */ - if ( n_ins == 0xFFFF ) + if ( n_ins == 0xFFFFU ) n_ins = 0; /* check it */ @@ -1260,7 +1251,7 @@ /* `advance_Width_Max' field! It is used, to my knowledge, */ /* exclusively in the X-TrueType font server. */ /* */ - if ( face->postscript.isFixedPitch && + if ( face->postscript.isFixedPitch && ( loader->load_flags & FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH ) == 0 ) advance = face->horizontal.advance_Width_Max; @@ -1285,9 +1276,9 @@ FT_Short top_bearing; /* vertical top side bearing (EM units) */ FT_UShort advance_height; /* vertical advance height (EM units) */ - FT_Pos left; /* scaled vertical left side bearing */ - FT_Pos top; /* scaled vertical top side bearing */ - FT_Pos advance; /* scaled vertical advance height */ + FT_Pos left; /* scaled vertical left side bearing */ + FT_Pos top; /* scaled vertical top side bearing */ + FT_Pos advance; /* scaled vertical advance height */ /* Get the unscaled `tsb' and `ah' */ @@ -1316,7 +1307,7 @@ /* here with: */ /* ascender - descender + linegap */ /* */ - if ( face->os2.version != 0xFFFF ) + if ( face->os2.version != 0xFFFFU ) { top_bearing = (FT_Short)( face->os2.sTypoLineGap / 2 ); advance_height = (FT_UShort)( face->os2.sTypoAscender - @@ -1375,8 +1366,8 @@ if ( !face->postscript.isFixedPitch && size && IS_HINTED( loader->load_flags ) ) { - FT_Byte* widths = Get_Advance_Widths( face, - size->root.metrics.x_ppem ); + FT_Byte* widths = Get_Advance_Widths( face, + size->root.metrics.x_ppem ); if ( widths ) @@ -1423,10 +1414,10 @@ FT_UInt load_flags ) { SFNT_Service sfnt; - TT_Face face; - FT_Stream stream; - FT_Error error; - TT_LoaderRec loader; + TT_Face face; + FT_Stream stream; + FT_Error error; + TT_LoaderRec loader; face = (TT_Face)glyph->face; @@ -1452,7 +1443,7 @@ /* XXX: The convention should be emphasized in */ /* the documents because it can be confusing. */ if ( size && - size->strike_index != 0xFFFF && + size->strike_index != 0xFFFFU && sfnt->load_sbits && ( load_flags & FT_LOAD_NO_BITMAP ) == 0 ) @@ -1578,6 +1569,7 @@ /* Main loading loop */ glyph->format = ft_glyph_format_outline; glyph->num_subglyphs = 0; + error = load_truetype_glyph( &loader, glyph_index ); if ( !error ) compute_glyph_metrics( &loader, glyph_index ); diff --git a/src/truetype/ttgload.h b/src/truetype/ttgload.h index eee9057c2..37445238e 100644 --- a/src/truetype/ttgload.h +++ b/src/truetype/ttgload.h @@ -4,7 +4,7 @@ /* */ /* TrueType Glyph Loader (specification). */ /* */ -/* Copyright 1996-2001 by */ +/* Copyright 1996-2001, 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ diff --git a/src/truetype/ttinterp.c b/src/truetype/ttinterp.c index 560b67320..28587e614 100644 --- a/src/truetype/ttinterp.c +++ b/src/truetype/ttinterp.c @@ -4,7 +4,7 @@ /* */ /* TrueType bytecode interpreter (body). */ /* */ -/* Copyright 1996-2001 by */ +/* Copyright 1996-2001, 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -1168,104 +1168,114 @@ #define NULL_Vector (FT_Vector*)&Null_Vector - /* compute (a*b)/2^14 with maximal accuracy and rounding */ + /* compute (a*b)/2^14 with maximal accuracy and rounding */ static FT_Int32 - TT_MulFix14( FT_Int32 a, FT_Int b ) + TT_MulFix14( FT_Int32 a, + FT_Int b ) { FT_Int32 m, s, hi; FT_UInt32 l, lo; + /* compute ax*bx as 64-bit value */ - l = (FT_UInt32)( (a & 0xFFFF)*b ); - m = (a >> 16)*b; + l = (FT_UInt32)( ( a & 0xFFFFU ) * b ); + m = ( a >> 16 ) * b; - lo = l + (FT_UInt32)(m << 16); - hi = (m >> 16) + ((FT_Int32)l >> 31) + (lo < l); + lo = l + (FT_UInt32)( m << 16 ); + hi = ( m >> 16 ) + ( (FT_Int32)l >> 31 ) + ( lo < l ); /* divide the result by 2^14 with rounding */ - s = (hi >> 31); + s = hi >> 31; l = lo + (FT_UInt32)s; - hi += s + (l < lo); + hi += s + ( l < lo ); lo = l; l = lo + 0x2000U; hi += (l < lo); - return ( (hi << 18) | (l >> 14) ); + return ( hi << 18 ) | ( l >> 14 ); } - /* compute (ax*bx+ay*by)/2^14 with maximal accuracy and rounding */ + /* compute (ax*bx+ay*by)/2^14 with maximal accuracy and rounding */ static FT_Int32 - TT_DotFix14( FT_Int32 ax, FT_Int32 ay, FT_Int bx, FT_Int by ) + TT_DotFix14( FT_Int32 ax, + FT_Int32 ay, + FT_Int bx, + FT_Int by ) { FT_Int32 m, s, hi1, hi2, hi; FT_UInt32 l, lo1, lo2, lo; + /* compute ax*bx as 64-bit value */ - l = (FT_UInt32)( (ax & 0xFFFF)*bx ); - m = (ax >> 16)*bx; + l = (FT_UInt32)( ( ax & 0xFFFFU ) * bx ); + m = ( ax >> 16 ) * bx; - lo1 = l + (FT_UInt32)(m << 16); - hi1 = (m >> 16) + ((FT_Int32)l >> 31) + (lo1 < l); + lo1 = l + (FT_UInt32)( m << 16 ); + hi1 = ( m >> 16 ) + ( (FT_Int32)l >> 31 ) + ( lo1 < l ); /* compute ay*by as 64-bit value */ - l = (FT_UInt32)( (ay & 0xFFFF)*by ); - m = (ay >> 16)*by; + l = (FT_UInt32)( ( ay & 0xFFFFU ) * by ); + m = ( ay >> 16 ) * by; - lo2 = l + (FT_UInt32)(m << 16); - hi2 = (m >> 16) + ((FT_Int32)l >> 31) + (lo2 < l); + lo2 = l + (FT_UInt32)( m << 16 ); + hi2 = ( m >> 16 ) + ( (FT_Int32)l >> 31 ) + ( lo2 < l ); /* add them */ lo = lo1 + lo2; - hi = hi1 + hi2 + (lo < lo1); + hi = hi1 + hi2 + ( lo < lo1 ); /* divide the result by 2^14 with rounding */ - s = (hi >> 31); + s = hi >> 31; l = lo + (FT_UInt32)s; - hi += s + (l < lo); + hi += s + ( l < lo ); lo = l; l = lo + 0x2000U; - hi += (l < lo); + hi += ( l < lo ); - return ( (hi << 18) | (l >> 14) ); + return ( hi << 18 ) | ( l >> 14 ); } - /* return length of given vector */ + + /* return length of given vector */ + #if 0 static FT_Int32 - TT_VecLen( FT_Int32 x, FT_Int32 y ) + TT_VecLen( FT_Int32 x, + FT_Int32 y ) { - FT_Int32 m, hi1, hi2, hi; - FT_UInt32 l, lo1, lo2, lo; + FT_Int32 m, hi1, hi2, hi; + FT_UInt32 l, lo1, lo2, lo; + /* compute x*x as 64-bit value */ - lo = (FT_UInt32)(x & 0xFFFF); - hi = (x >> 16); + lo = (FT_UInt32)( x & 0xFFFFU ); + hi = x >> 16; - l = lo*lo; - m = hi*lo; - hi = hi*hi; + l = lo * lo; + m = hi * lo; + hi = hi * hi; - lo1 = l + (FT_UInt32)(m << 17); - hi1 = hi + (m >> 15) + (lo1 < l); + lo1 = l + (FT_UInt32)( m << 17 ); + hi1 = hi + ( m >> 15 ) + ( lo1 < l ); /* compute y*y as 64-bit value */ - lo = (FT_UInt32)( y & 0xFFFF ); - hi = (y >> 16); + lo = (FT_UInt32)( y & 0xFFFFU ); + hi = y >> 16; - l = lo*lo; - m = hi*lo; - hi = hi*hi; + l = lo * lo; + m = hi * lo; + hi = hi * hi; - lo2 = l + (FT_UInt32)(m << 17); - hi2 = hi + (m >> 15) + (lo2 < l); + lo2 = l + (FT_UInt32)( m << 17 ); + hi2 = hi + ( m >> 15 ) + ( lo2 < l ); /* add them to get 'x*x+y*y' as 64-bit value */ lo = lo1 + lo2; - hi = hi1 + hi2 + (lo < lo1); + hi = hi1 + hi2 + ( lo < lo1 ); /* compute the square root of this value */ { @@ -1280,8 +1290,8 @@ count = 32; do { - rem = ( rem << 2 ) | ( (FT_UInt32)hi >> 30 ); - hi = ( hi << 2 ) | ( lo >> 30 ); + rem = ( rem << 2 ) | ( (FT_UInt32)hi >> 30 ); + hi = ( hi << 2 ) | ( lo >> 30 ); lo <<= 2; root <<= 1; test_div = ( root << 1 ) + 1; @@ -1297,24 +1307,28 @@ return (FT_Int32)root; } } + #else - /* this version uses FT_Vector_Length which computes the same value */ - /* much, much faster.. */ - /* */ + /* this version uses FT_Vector_Length which computes the same value */ + /* much, much faster.. */ + /* */ static FT_F26Dot6 TT_VecLen( FT_F26Dot6 X, FT_F26Dot6 Y ) { FT_Vector v; + v.x = X; v.y = Y; + return FT_Vector_Length( &v ); } #endif + /*************************************************************************/ /* */ /* */ @@ -1367,48 +1381,48 @@ FT_CALLBACK_DEF( FT_F26Dot6 ) - Read_CVT( EXEC_OP_ FT_ULong index ) + Read_CVT( EXEC_OP_ FT_ULong idx ) { - return CUR.cvt[index]; + return CUR.cvt[idx]; } FT_CALLBACK_DEF( FT_F26Dot6 ) - Read_CVT_Stretched( EXEC_OP_ FT_ULong index ) + Read_CVT_Stretched( EXEC_OP_ FT_ULong idx ) { - return TT_MULFIX( CUR.cvt[index], CURRENT_Ratio() ); + return TT_MULFIX( CUR.cvt[idx], CURRENT_Ratio() ); } FT_CALLBACK_DEF( void ) - Write_CVT( EXEC_OP_ FT_ULong index, + Write_CVT( EXEC_OP_ FT_ULong idx, FT_F26Dot6 value ) { - CUR.cvt[index] = value; + CUR.cvt[idx] = value; } FT_CALLBACK_DEF( void ) - Write_CVT_Stretched( EXEC_OP_ FT_ULong index, + Write_CVT_Stretched( EXEC_OP_ FT_ULong idx, FT_F26Dot6 value ) { - CUR.cvt[index] = FT_DivFix( value, CURRENT_Ratio() ); + CUR.cvt[idx] = FT_DivFix( value, CURRENT_Ratio() ); } FT_CALLBACK_DEF( void ) - Move_CVT( EXEC_OP_ FT_ULong index, + Move_CVT( EXEC_OP_ FT_ULong idx, FT_F26Dot6 value ) { - CUR.cvt[index] += value; + CUR.cvt[idx] += value; } FT_CALLBACK_DEF( void ) - Move_CVT_Stretched( EXEC_OP_ FT_ULong index, + Move_CVT_Stretched( EXEC_OP_ FT_ULong idx, FT_F26Dot6 value ) { - CUR.cvt[index] += FT_DivFix( value, CURRENT_Ratio() ); + CUR.cvt[idx] += FT_DivFix( value, CURRENT_Ratio() ); } @@ -1511,11 +1525,11 @@ /* zone :: The affected glyph zone. */ /* */ static void - Direct_Move( EXEC_OP_ TT_GlyphZone zone, - FT_UShort point, - FT_F26Dot6 distance ) + Direct_Move( EXEC_OP_ TT_GlyphZone zone, + FT_UShort point, + FT_F26Dot6 distance ) { - FT_F26Dot6 v; + FT_F26Dot6 v; v = CUR.GS.freeVector.x; @@ -1573,9 +1587,9 @@ static void - Direct_Move_X( EXEC_OP_ TT_GlyphZone zone, - FT_UShort point, - FT_F26Dot6 distance ) + Direct_Move_X( EXEC_OP_ TT_GlyphZone zone, + FT_UShort point, + FT_F26Dot6 distance ) { FT_UNUSED_EXEC; @@ -1585,9 +1599,9 @@ static void - Direct_Move_Y( EXEC_OP_ TT_GlyphZone zone, - FT_UShort point, - FT_F26Dot6 distance ) + Direct_Move_Y( EXEC_OP_ TT_GlyphZone zone, + FT_UShort point, + FT_F26Dot6 distance ) { FT_UNUSED_EXEC; @@ -3942,8 +3956,8 @@ K = CUR.stack[CUR.args - L]; FT_MEM_MOVE( &CUR.stack[CUR.args - L ], - &CUR.stack[CUR.args - L + 1], - ( L - 1 ) * sizeof ( FT_Long ) ); + &CUR.stack[CUR.args - L + 1], + ( L - 1 ) * sizeof ( FT_Long ) ); CUR.stack[CUR.args - 1] = K; } @@ -5076,14 +5090,14 @@ static FT_Bool - Compute_Point_Displacement( EXEC_OP_ FT_F26Dot6* x, - FT_F26Dot6* y, - TT_GlyphZone zone, - FT_UShort* refp ) + Compute_Point_Displacement( EXEC_OP_ FT_F26Dot6* x, + FT_F26Dot6* y, + TT_GlyphZone zone, + FT_UShort* refp ) { TT_GlyphZoneRec zp; - FT_UShort p; - FT_F26Dot6 d; + FT_UShort p; + FT_F26Dot6 d; if ( CUR.opcode & 1 ) @@ -5161,11 +5175,11 @@ Ins_SHP( INS_ARG ) { TT_GlyphZoneRec zp; - FT_UShort refp; + FT_UShort refp; - FT_F26Dot6 dx, - dy; - FT_UShort point; + FT_F26Dot6 dx, + dy; + FT_UShort point; FT_UNUSED_ARG; @@ -5214,12 +5228,12 @@ Ins_SHC( INS_ARG ) { TT_GlyphZoneRec zp; - FT_UShort refp; - FT_F26Dot6 dx, - dy; + FT_UShort refp; + FT_F26Dot6 dx, + dy; - FT_Short contour; - FT_UShort first_point, last_point, i; + FT_Short contour; + FT_UShort first_point, last_point, i; contour = (FT_UShort)args[0]; @@ -5270,11 +5284,11 @@ Ins_SHZ( INS_ARG ) { TT_GlyphZoneRec zp; - FT_UShort refp; - FT_F26Dot6 dx, - dy; + FT_UShort refp; + FT_F26Dot6 dx, + dy; - FT_UShort last_point, i; + FT_UShort last_point, i; if ( BOUNDS( args[0], 2 ) ) diff --git a/src/truetype/ttinterp.h b/src/truetype/ttinterp.h index 96d831660..e750963ff 100644 --- a/src/truetype/ttinterp.h +++ b/src/truetype/ttinterp.h @@ -4,7 +4,7 @@ /* */ /* TrueType bytecode interpreter (specification). */ /* */ -/* Copyright 1996-2001 by */ +/* Copyright 1996-2001, 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -73,9 +73,9 @@ FT_BEGIN_HEADER /* Point displacement along the freedom vector routine */ typedef void - (*TT_Move_Func)( EXEC_OP_ TT_GlyphZone zone, - FT_UShort point, - FT_F26Dot6 distance ); + (*TT_Move_Func)( EXEC_OP_ TT_GlyphZone zone, + FT_UShort point, + FT_F26Dot6 distance ); /* Distance projection along one of the projection vectors */ typedef FT_F26Dot6 @@ -84,12 +84,12 @@ FT_BEGIN_HEADER /* reading a cvt value. Take care of non-square pixels if necessary */ typedef FT_F26Dot6 - (*TT_Get_CVT_Func)( EXEC_OP_ FT_ULong index ); + (*TT_Get_CVT_Func)( EXEC_OP_ FT_ULong idx ); /* setting or moving a cvt value. Take care of non-square pixels */ /* if necessary */ typedef void - (*TT_Set_CVT_Func)( EXEC_OP_ FT_ULong index, + (*TT_Set_CVT_Func)( EXEC_OP_ FT_ULong idx, FT_F26Dot6 value ); @@ -114,90 +114,90 @@ FT_BEGIN_HEADER /* */ typedef struct TT_ExecContextRec_ { - TT_Face face; - TT_Size size; - FT_Memory memory; + TT_Face face; + TT_Size size; + FT_Memory memory; /* instructions state */ - FT_Error error; /* last execution error */ + FT_Error error; /* last execution error */ - FT_Long top; /* top of exec. stack */ + FT_Long top; /* top of exec. stack */ - FT_UInt stackSize; /* size of exec. stack */ - FT_Long* stack; /* current exec. stack */ + FT_UInt stackSize; /* size of exec. stack */ + FT_Long* stack; /* current exec. stack */ - FT_Long args; - FT_UInt new_top; /* new top after exec. */ + FT_Long args; + FT_UInt new_top; /* new top after exec. */ TT_GlyphZoneRec zp0, /* zone records */ - zp1, - zp2, - pts, - twilight; + zp1, + zp2, + pts, + twilight; - FT_Size_Metrics metrics; - TT_Size_Metrics tt_metrics; /* size metrics */ + FT_Size_Metrics metrics; + TT_Size_Metrics tt_metrics; /* size metrics */ - TT_GraphicsState GS; /* current graphics state */ + TT_GraphicsState GS; /* current graphics state */ - FT_Int curRange; /* current code range number */ - FT_Byte* code; /* current code range */ - FT_Long IP; /* current instruction pointer */ - FT_Long codeSize; /* size of current range */ + FT_Int curRange; /* current code range number */ + FT_Byte* code; /* current code range */ + FT_Long IP; /* current instruction pointer */ + FT_Long codeSize; /* size of current range */ - FT_Byte opcode; /* current opcode */ - FT_Int length; /* length of current opcode */ + FT_Byte opcode; /* current opcode */ + FT_Int length; /* length of current opcode */ - FT_Bool step_ins; /* true if the interpreter must */ - /* increment IP after ins. exec */ - FT_Long cvtSize; - FT_Long* cvt; + FT_Bool step_ins; /* true if the interpreter must */ + /* increment IP after ins. exec */ + FT_Long cvtSize; + FT_Long* cvt; - FT_UInt glyphSize; /* glyph instructions buffer size */ - FT_Byte* glyphIns; /* glyph instructions buffer */ + FT_UInt glyphSize; /* glyph instructions buffer size */ + FT_Byte* glyphIns; /* glyph instructions buffer */ - FT_UInt numFDefs; /* number of function defs */ - FT_UInt maxFDefs; /* maximum number of function defs */ - TT_DefArray FDefs; /* table of FDefs entries */ + FT_UInt numFDefs; /* number of function defs */ + FT_UInt maxFDefs; /* maximum number of function defs */ + TT_DefArray FDefs; /* table of FDefs entries */ - FT_UInt numIDefs; /* number of instruction defs */ - FT_UInt maxIDefs; /* maximum number of ins defs */ - TT_DefArray IDefs; /* table of IDefs entries */ + FT_UInt numIDefs; /* number of instruction defs */ + FT_UInt maxIDefs; /* maximum number of ins defs */ + TT_DefArray IDefs; /* table of IDefs entries */ - FT_UInt maxFunc; /* maximum function index */ - FT_UInt maxIns; /* maximum instruction index */ + FT_UInt maxFunc; /* maximum function index */ + FT_UInt maxIns; /* maximum instruction index */ - FT_Int callTop, /* top of call stack during execution */ - callSize; /* size of call stack */ - TT_CallStack callStack; /* call stack */ + FT_Int callTop, /* top of call stack during execution */ + callSize; /* size of call stack */ + TT_CallStack callStack; /* call stack */ - FT_UShort maxPoints; /* capacity of this context's `pts' */ - FT_Short maxContours; /* record, expressed in points and */ - /* contours. */ + FT_UShort maxPoints; /* capacity of this context's `pts' */ + FT_Short maxContours; /* record, expressed in points and */ + /* contours. */ TT_CodeRangeTable codeRangeTable; /* table of valid code ranges */ /* useful for the debugger */ - FT_UShort storeSize; /* size of current storage */ - FT_Long* storage; /* storage area */ + FT_UShort storeSize; /* size of current storage */ + FT_Long* storage; /* storage area */ - FT_F26Dot6 period; /* values used for the */ - FT_F26Dot6 phase; /* `SuperRounding' */ - FT_F26Dot6 threshold; + FT_F26Dot6 period; /* values used for the */ + FT_F26Dot6 phase; /* `SuperRounding' */ + FT_F26Dot6 threshold; #if 0 /* this seems to be unused */ - FT_Int cur_ppem; /* ppem along the current proj vector */ + FT_Int cur_ppem; /* ppem along the current proj vector */ #endif - FT_Bool instruction_trap; /* If `True', the interpreter will */ - /* exit after each instruction */ + FT_Bool instruction_trap; /* If `True', the interpreter will */ + /* exit after each instruction */ - TT_GraphicsState default_GS; /* graphics state resulting from */ - /* the prep program */ - FT_Bool is_composite; /* true if the glyph is composite */ - FT_Bool pedantic_hinting; /* true for pedantic interpretation */ + TT_GraphicsState default_GS; /* graphics state resulting from */ + /* the prep program */ + FT_Bool is_composite; /* true if the glyph is composite */ + FT_Bool pedantic_hinting; /* true if pedantic interpretation */ /* latest interpreter additions */ diff --git a/src/truetype/ttobjs.c b/src/truetype/ttobjs.c index 2d443cf55..cab9d1bb2 100644 --- a/src/truetype/ttobjs.c +++ b/src/truetype/ttobjs.c @@ -4,7 +4,7 @@ /* */ /* Objects manager (body). */ /* */ -/* Copyright 1996-2001 by */ +/* Copyright 1996-2001, 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -66,7 +66,7 @@ /* zone :: A pointer to the target glyph zone. */ /* */ FT_LOCAL_DEF( void ) - TT_Done_GlyphZone( TT_GlyphZone zone ) + TT_Done_GlyphZone( TT_GlyphZone zone ) { FT_Memory memory = zone->memory; @@ -103,10 +103,10 @@ /* FreeType error code. 0 means success. */ /* */ FT_LOCAL_DEF( FT_Error ) - TT_New_GlyphZone( FT_Memory memory, - FT_UShort maxPoints, - FT_Short maxContours, - TT_GlyphZone zone ) + TT_New_GlyphZone( FT_Memory memory, + FT_UShort maxPoints, + FT_Short maxContours, + TT_GlyphZone zone ) { FT_Error error; @@ -160,8 +160,8 @@ FT_Int num_params, FT_Parameter* params ) { - FT_Error error; - FT_Library library; + FT_Error error; + FT_Library library; SFNT_Service sfnt; @@ -227,10 +227,10 @@ FT_LOCAL_DEF( void ) TT_Face_Done( TT_Face face ) { - FT_Memory memory = face->root.memory; - FT_Stream stream = face->root.stream; + FT_Memory memory = face->root.memory; + FT_Stream stream = face->root.stream; - SFNT_Service sfnt = (SFNT_Service)face->sfnt; + SFNT_Service sfnt = (SFNT_Service)face->sfnt; /* for `extended TrueType formats' (i.e. compressed versions) */ @@ -326,10 +326,10 @@ } /* allocate function defs, instruction defs, cvt, and storage area */ - if ( FT_NEW_ARRAY( size->function_defs, size->max_function_defs ) || + if ( FT_NEW_ARRAY( size->function_defs, size->max_function_defs ) || FT_NEW_ARRAY( size->instruction_defs, size->max_instruction_defs ) || - FT_NEW_ARRAY( size->cvt, size->cvt_size ) || - FT_NEW_ARRAY( size->storage, size->storage_size ) ) + FT_NEW_ARRAY( size->cvt, size->cvt_size ) || + FT_NEW_ARRAY( size->storage, size->storage_size ) ) goto Fail_Memory; @@ -513,8 +513,8 @@ static FT_Error Reset_Outline_Size( TT_Size size ) { - TT_Face face; - FT_Error error = TT_Err_Ok; + TT_Face face; + FT_Error error = TT_Err_Ok; FT_Size_Metrics* metrics; @@ -561,7 +561,7 @@ #ifdef TT_CONFIG_OPTION_EMBEDDED_BITMAPS /* set to `invalid' by default */ - size->strike_index = 0xFFFF; + size->strike_index = 0xFFFFU; #endif #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER @@ -670,12 +670,12 @@ FT_ULong strike_index; FT_Size_Metrics* metrics; FT_Size_Metrics* sbit_metrics; - SFNT_Service sfnt; + SFNT_Service sfnt; metrics = &size->root.metrics; - if ( size->strike_index != 0xFFFF ) + if ( size->strike_index != 0xFFFFU ) return TT_Err_Ok; face = (TT_Face)size->root.face; @@ -689,7 +689,7 @@ if ( !error ) { - TT_SBit_Strike strike = face->sbit_strikes + strike_index; + TT_SBit_Strike strike = face->sbit_strikes + strike_index; sbit_metrics->x_ppem = metrics->x_ppem; @@ -719,7 +719,7 @@ } else { - size->strike_index = 0xFFFF; + size->strike_index = 0xFFFFU; sbit_metrics->x_ppem = 0; sbit_metrics->y_ppem = 0; @@ -769,7 +769,7 @@ if ( face->face_flags & FT_FACE_FLAG_FIXED_SIZES ) { - if ( size->strike_index == 0xFFFF ) + if ( size->strike_index == 0xFFFFU ) error = Reset_SBit_Size( size ); if ( !error && !( face->face_flags & FT_FACE_FLAG_SCALABLE ) ) diff --git a/src/truetype/ttobjs.h b/src/truetype/ttobjs.h index 787178867..4fb48d041 100644 --- a/src/truetype/ttobjs.h +++ b/src/truetype/ttobjs.h @@ -4,7 +4,7 @@ /* */ /* Objects manager (specification). */ /* */ -/* Copyright 1996-2001 by */ +/* Copyright 1996-2001, 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ @@ -108,13 +108,13 @@ FT_BEGIN_HEADER #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER FT_LOCAL( void ) - TT_Done_GlyphZone( TT_GlyphZone zone ); + TT_Done_GlyphZone( TT_GlyphZone zone ); FT_LOCAL( FT_Error ) - TT_New_GlyphZone( FT_Memory memory, - FT_UShort maxPoints, - FT_Short maxContours, - TT_GlyphZone zone ); + TT_New_GlyphZone( FT_Memory memory, + FT_UShort maxPoints, + FT_Short maxContours, + TT_GlyphZone zone ); #endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */ @@ -192,27 +192,27 @@ FT_BEGIN_HEADER /* */ typedef struct TT_SubglyphRec_ { - FT_Long index; /* subglyph index; initialized with -1 */ - FT_Bool is_scaled; /* is the subglyph scaled? */ - FT_Bool is_hinted; /* should it be hinted? */ - FT_Bool preserve_pps; /* preserve phantom points? */ + FT_Long index; /* subglyph index; initialized with -1 */ + FT_Bool is_scaled; /* is the subglyph scaled? */ + FT_Bool is_hinted; /* should it be hinted? */ + FT_Bool preserve_pps; /* preserve phantom points? */ - FT_Long file_offset; + FT_Long file_offset; - FT_BBox bbox; - FT_Pos left_bearing; - FT_Pos advance; + FT_BBox bbox; + FT_Pos left_bearing; + FT_Pos advance; TT_GlyphZoneRec zone; - FT_Long arg1; /* first argument */ - FT_Long arg2; /* second argument */ + FT_Long arg1; /* first argument */ + FT_Long arg2; /* second argument */ - FT_UShort element_flag; /* current load element flag */ + FT_UShort element_flag; /* current load element flag */ - TT_Transform transform; /* transformation matrix */ + TT_Transform transform; /* transformation matrix */ - FT_Vector pp1, pp2; /* phantom points */ + FT_Vector pp1, pp2; /* phantom points */ } TT_SubGlyphRec, *TT_SubGlyph_Stack; @@ -343,7 +343,7 @@ FT_BEGIN_HEADER FT_UShort storage_size; /* The storage area is now part of */ FT_Long* storage; /* the instance */ - TT_GlyphZoneRec twilight; /* The instance's twilight zone */ + TT_GlyphZoneRec twilight; /* The instance's twilight zone */ /* debugging variables */ @@ -365,11 +365,11 @@ FT_BEGIN_HEADER /* */ typedef struct TT_DriverRec_ { - FT_DriverRec root; - TT_ExecContext context; /* execution context */ - TT_GlyphZoneRec zone; /* glyph loader points zone */ + FT_DriverRec root; + TT_ExecContext context; /* execution context */ + TT_GlyphZoneRec zone; /* glyph loader points zone */ - void* extension_component; + void* extension_component; } TT_DriverRec; diff --git a/src/truetype/ttpload.c b/src/truetype/ttpload.c index 212d484ea..19bd0f87c 100644 --- a/src/truetype/ttpload.c +++ b/src/truetype/ttpload.c @@ -4,7 +4,7 @@ /* */ /* TrueType glyph data/program tables loader (body). */ /* */ -/* Copyright 1996-2001 by */ +/* Copyright 1996-2001, 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */ diff --git a/src/truetype/ttpload.h b/src/truetype/ttpload.h index 26de13ea9..c83b2f269 100644 --- a/src/truetype/ttpload.h +++ b/src/truetype/ttpload.h @@ -4,7 +4,7 @@ /* */ /* TrueType glyph data/program tables loader (specification). */ /* */ -/* Copyright 1996-2001 by */ +/* Copyright 1996-2001, 2002 by */ /* David Turner, Robert Wilhelm, and Werner Lemberg. */ /* */ /* This file is part of the FreeType project, and may only be used, */