From f9b8dec437dd84060bcd82a555c92fecff848aa7 Mon Sep 17 00:00:00 2001 From: David Turner Date: Fri, 16 Jun 2000 19:34:52 +0000 Subject: [PATCH] major reformatting of the modules source code in order to get rid of most of the basic types redefinitions (i.e. FT_Int instead of "FT_Int", etc..) The format-specific prefixs like "TT_", "T1_", "T2_" & 'CID_" are now only used in relevant structures.. fixed Werner's fix to t2gload.c :-) other small bug fixes --- CHANGES | 10 +- demos/src/ttdebug.c | 24 +- include/freetype/internal/ftobjs.h | 50 -- include/freetype/internal/sfnt.h | 40 +- include/freetype/internal/t1types.h | 267 +--------- include/freetype/internal/tttypes.h | 607 ++++++----------------- include/freetype/tttags.h | 2 + src/base/ftoutln.c | 129 ----- src/cff/t2driver.c | 54 +- src/cff/t2gload.c | 160 +++--- src/cff/t2gload.h | 86 ++-- src/cff/t2load.c | 92 ++-- src/cff/t2load.h | 18 +- src/cff/t2objs.c | 21 +- src/cff/t2objs.h | 29 +- src/cff/t2parse.c | 128 ++--- src/cff/t2parse.h | 20 +- src/cid/cidafm.c | 52 +- src/cid/cidafm.h | 16 +- src/cid/cidgload.c | 168 +++---- src/cid/cidgload.h | 66 +-- src/cid/cidload.c | 106 ++-- src/cid/cidload.h | 14 +- src/cid/cidobjs.c | 18 +- src/cid/cidobjs.h | 28 +- src/cid/cidparse.c | 198 ++++---- src/cid/cidparse.h | 68 +-- src/cid/cidriver.c | 38 +- src/sfnt/sfobjs.c | 44 +- src/sfnt/sfobjs.h | 12 +- src/sfnt/ttcmap.c | 66 +-- src/sfnt/ttcmap.h | 4 +- src/sfnt/ttload.c | 154 +++--- src/sfnt/ttload.h | 46 +- src/sfnt/ttpost.c | 66 +-- src/sfnt/ttpost.h | 6 +- src/sfnt/ttsbit.c | 220 +++++---- src/sfnt/ttsbit.h | 12 +- src/truetype/ttdriver.c | 56 +-- src/truetype/ttgload.c | 270 +++++----- src/truetype/ttgload.h | 42 +- src/truetype/ttinterp.c | 740 ++++++++++++++-------------- src/truetype/ttinterp.h | 134 ++--- src/truetype/ttobjs.c | 170 ++++++- src/truetype/ttobjs.h | 192 +++++--- src/truetype/ttpload.c | 44 +- src/truetype/ttpload.h | 6 +- src/type1/t1afm.c | 10 +- src/type1/t1driver.c | 32 +- src/type1/t1gload.c | 216 ++++---- src/type1/t1gload.h | 144 +++--- src/type1/t1hinter.c | 166 +++---- src/type1/t1hinter.h | 36 +- src/type1/t1load.c | 150 +++--- src/type1/t1load.h | 2 +- src/type1/t1objs.c | 22 +- src/type1/t1objs.h | 20 +- src/type1/t1parse.c | 180 +++---- src/type1/t1parse.h | 62 +-- src/type1/t1tokens.c | 104 ++-- src/type1/t1tokens.h | 38 +- src/type1z/t1afm.c | 14 +- src/type1z/t1afm.h | 16 +- src/type1z/t1driver.c | 32 +- src/type1z/t1gload.c | 134 ++--- src/type1z/t1gload.h | 68 +-- src/type1z/t1load.c | 225 ++++----- src/type1z/t1load.h | 24 +- src/type1z/t1objs.c | 18 +- src/type1z/t1objs.h | 20 +- src/type1z/t1parse.c | 248 +++++----- src/type1z/t1parse.h | 128 ++--- src/type1z/t1tokens.h | 8 +- 73 files changed, 3194 insertions(+), 3716 deletions(-) diff --git a/CHANGES b/CHANGES index a2d3f77db..7e056e7f8 100644 --- a/CHANGES +++ b/CHANGES @@ -1,4 +1,12 @@ -LATEST_CHANGES +LATEST CHANGES + + - reformated all modules source code in order to get rid of the basic + data types redifinitions (i.e. "TT_Int" instead of "FT_Int", "T1_Fixed" + instead of "FT_Fixed"). Hence the format-specific prefixes like "TT_", + "T1_", "T2_" and "CID_" are only used for relevant structures.. + +============================================================================ +OLD CHANGES FOR BETA 7 - bug-fixed the OpenType/CFF parser. It now loads and displays my two fonts nicely, but I'm pretty certain that more testing is needed :-) diff --git a/demos/src/ttdebug.c b/demos/src/ttdebug.c index a7c45dd68..138db6e54 100644 --- a/demos/src/ttdebug.c +++ b/demos/src/ttdebug.c @@ -39,7 +39,7 @@ TT_Face face; /* truetype face */ TT_Size size; /* truetype size */ TT_GlyphSlot glyph; /* truetype glyph slot */ TT_ExecContext exec; /* truetype execution context */ -TT_Error error; +FT_Error error; TT_CodeRange_Tag debug_coderange = tt_coderange_glyph; @@ -53,7 +53,7 @@ TT_CodeRange_Tag debug_coderange = tt_coderange_glyph; #undef PACK #define PACK( x, y ) ((x << 4) | y) - static const TT_Byte Pop_Push_Count[256] = + static const FT_Byte Pop_Push_Count[256] = { /* opcodes are gathered in groups of 16 */ /* please keep the spaces as they are */ @@ -807,16 +807,16 @@ TT_CodeRange_Tag debug_coderange = tt_coderange_glyph; static - TT_Error RunIns( TT_ExecContext exc ) + FT_Error RunIns( TT_ExecContext exc ) { FT_Int A, diff, key; FT_Long next_IP; FT_Char ch, oldch = '\0', *temp; - TT_Error error = 0; + FT_Error error = 0; - FT_GlyphZone save; - FT_GlyphZone pts; + TT_GlyphZone save; + TT_GlyphZone pts; const FT_String* round_str[8] = { @@ -831,7 +831,7 @@ TT_CodeRange_Tag debug_coderange = tt_coderange_glyph; }; /* only debug the requested code range */ - if (exc->curRange != (TT_Int)debug_coderange) + if (exc->curRange != (FT_Int)debug_coderange) return TT_RunIns(exc); exc->pts.n_points = exc->zp0.n_points; @@ -843,11 +843,11 @@ TT_CodeRange_Tag debug_coderange = tt_coderange_glyph; save.n_points = pts.n_points; save.n_contours = pts.n_contours; - save.org = (TT_Vector*)malloc( 2 * sizeof( TT_F26Dot6 ) * + save.org = (FT_Vector*)malloc( 2 * sizeof( FT_F26Dot6 ) * save.n_points ); - save.cur = (TT_Vector*)malloc( 2 * sizeof( TT_F26Dot6 ) * + save.cur = (FT_Vector*)malloc( 2 * sizeof( FT_F26Dot6 ) * save.n_points ); - save.tags = (TT_Byte*)malloc( save.n_points ); + save.tags = (FT_Byte*)malloc( save.n_points ); exc->instruction_trap = 1; @@ -996,8 +996,8 @@ TT_CodeRange_Tag debug_coderange = tt_coderange_glyph; } } while ( !key ); - MEM_Copy( save.org, pts.org, pts.n_points * sizeof ( TT_Vector ) ); - MEM_Copy( save.cur, pts.cur, pts.n_points * sizeof ( TT_Vector ) ); + MEM_Copy( save.org, pts.org, pts.n_points * sizeof ( FT_Vector ) ); + MEM_Copy( save.cur, pts.cur, pts.n_points * sizeof ( FT_Vector ) ); MEM_Copy( save.tags, pts.tags, pts.n_points ); /* a return indicate the last command */ diff --git a/include/freetype/internal/ftobjs.h b/include/freetype/internal/ftobjs.h index d04b184e4..17f852073 100644 --- a/include/freetype/internal/ftobjs.h +++ b/include/freetype/internal/ftobjs.h @@ -164,56 +164,6 @@ /*************************************************************************/ /*************************************************************************/ - /************************************************************************ - * - * - * FT_GlyphZone - * - * - * A glyph zone is used to load, scale and hint glyph outline - * coordinates. - * - * - * memory :: handle to memory manager - * max_points :: max size in points of zone - * max_contours :: max size in contours of zone - * n_points :: current number of points in zone - * n_contours :: current number of contours in zone - * org :: original glyph coordinates (font units/scaled) - * cur :: current glyph coordinates (scaled/hinted) - * tags :: point control tags - * contours :: contour end points - * - ***********************************************************************/ - - typedef struct FT_GlyphZone_ - { - FT_Memory memory; - FT_UShort max_points; - FT_UShort max_contours; - FT_UShort n_points; /* number of points in zone */ - FT_Short n_contours; /* number of contours */ - - FT_Vector* org; /* original point coordinates */ - FT_Vector* cur; /* current point coordinates */ - - FT_Byte* tags; /* current touch flags */ - FT_UShort* contours; /* contour end points */ - - } FT_GlyphZone; - - - BASE_DEF(FT_Error) FT_New_GlyphZone( FT_Memory memory, - FT_UShort maxPoints, - FT_Short maxContours, - FT_GlyphZone* zone ); - - BASE_DEF(void) FT_Done_GlyphZone( FT_GlyphZone* zone ); - - BASE_DEF(FT_Error) FT_Update_GlyphZone( FT_GlyphZone* zone, - FT_UShort num_points, - FT_Short num_contours ); - /*************************************************************************/ /*************************************************************************/ diff --git a/include/freetype/internal/sfnt.h b/include/freetype/internal/sfnt.h index 4db1bb912..3f5f02bab 100644 --- a/include/freetype/internal/sfnt.h +++ b/include/freetype/internal/sfnt.h @@ -140,9 +140,9 @@ /* values of "search_range", "entry_selector" and "range_shift".. */ /* */ typedef - TT_Error (*TT_Load_SFNT_Header_Func)( TT_Face face, + FT_Error (*TT_Load_SFNT_Header_Func)( TT_Face face, FT_Stream stream, - TT_Long faceIndex, + FT_Long faceIndex, SFNT_Header* sfnt ); /*************************************************************************/ @@ -167,7 +167,7 @@ /* TT_Load_Format_Tag */ /* */ typedef - TT_Error (*TT_Load_Directory_Func)( TT_Face face, + FT_Error (*TT_Load_Directory_Func)( TT_Face face, FT_Stream stream, SFNT_Header* sfnt ); @@ -214,11 +214,11 @@ /* TrueType error code. 0 means success. */ /* */ typedef - TT_Error (*TT_Load_Any_Func)( TT_Face face, - TT_ULong tag, - TT_Long offset, + FT_Error (*TT_Load_Any_Func)( TT_Face face, + FT_ULong tag, + FT_Long offset, void* buffer, - TT_Long* length ); + FT_Long* length ); /*************************************************************************/ @@ -253,11 +253,11 @@ /* The `map.buffer' field is always freed before the glyph is loaded. */ /* */ typedef - TT_Error (*TT_Load_SBit_Image_Func)( TT_Face face, - TT_Int x_ppem, - TT_Int y_ppem, - TT_UInt glyph_index, - TT_UInt load_flags, + FT_Error (*TT_Load_SBit_Image_Func)( TT_Face face, + FT_Int x_ppem, + FT_Int y_ppem, + FT_UInt glyph_index, + FT_UInt load_flags, FT_Stream stream, FT_Bitmap* map, TT_SBit_Metrics* metrics ); @@ -282,9 +282,9 @@ /* TrueType error code. 0 means success. */ /* */ typedef - TT_Error (*TT_Get_PS_Name_Func)( TT_Face face, - TT_UInt index, - TT_String** PSname ); + FT_Error (*TT_Get_PS_Name_Func)( TT_Face face, + FT_UInt index, + FT_String** PSname ); /*************************************************************************/ @@ -304,9 +304,9 @@ /* TrueType error code. 0 means success. */ /* */ typedef - TT_Error (*TT_Load_Metrics_Func)( TT_Face face, + FT_Error (*TT_Load_Metrics_Func)( TT_Face face, FT_Stream stream, - TT_Bool vertical ); + FT_Bool vertical ); @@ -334,7 +334,7 @@ /* released. */ /* */ typedef - TT_Error (*TT_CharMap_Load_Func)( TT_Face face, + FT_Error (*TT_CharMap_Load_Func)( TT_Face face, TT_CMapTable* cmap, FT_Stream input ); @@ -355,7 +355,7 @@ /* Error code. 0 means success. */ /* */ typedef - TT_Error (*TT_CharMap_Free_Func)( TT_Face face, + FT_Error (*TT_CharMap_Free_Func)( TT_Face face, TT_CMapTable* cmap ); @@ -379,7 +379,7 @@ /* the start of the table */ /* */ typedef - TT_Error (*TT_Load_Table_Func)( TT_Face face, + FT_Error (*TT_Load_Table_Func)( TT_Face face, FT_Stream stream ); diff --git a/include/freetype/internal/t1types.h b/include/freetype/internal/t1types.h index e089aec32..8d11d4033 100644 --- a/include/freetype/internal/t1types.h +++ b/include/freetype/internal/t1types.h @@ -29,231 +29,6 @@ #endif -/*************************************************************************/ -/*************************************************************************/ -/*************************************************************************/ -/*** ***/ -/*** ***/ -/*** DEFINITIONS OF BASIC DATA TYPES ***/ -/*** ***/ -/*** ***/ -/*************************************************************************/ -/*************************************************************************/ -/*************************************************************************/ - - -/* The REDEFINE macro is used to convert a FreeType generic type into */ -/* a TrueType-specific one. It simply replaces the "FT_" prefix by "T1_" */ -/* in order to define compatible T1_Long, T1_Error, T1_Outline, etc.. */ -/* */ -#undef REDEFINE -#define REDEFINE( type ) typedef FT_##type T1_##type - - - /* T1_Bool */ - /* */ - /* */ - /* A simple typedef of unsigned char, used for simple booleans. */ - /* */ - REDEFINE( Bool ); - - - /* T1_FWord */ - /* */ - /* */ - /* a signed 16-bit integer used to store a distance in original */ - /* font units. */ - /* */ - REDEFINE( FWord ); - - - /* T1_UFWord */ - /* */ - /* */ - /* an unsigned 16-bit integer used to store a distance in original */ - /* font units. */ - /* */ - REDEFINE( UFWord ); - - - /* T1_Char */ - /* */ - /* */ - /* a simple typedef for the _signed_ char type. */ - /* */ - REDEFINE( Char ); - - - /* T1_Byte */ - /* */ - /* */ - /* a simple typedef for the _unsigned_ char type. */ - /* */ - REDEFINE( Byte ); - - - /* T1_String */ - /* */ - /* */ - /* a simple typedef for the char type, used for strings usually. */ - /* */ - REDEFINE( String ); - - - /* T1_Short */ - /* */ - /* */ - /* a typedef for signed short */ - /* */ - REDEFINE( Short ); - - - /* T1_UShort */ - /* */ - /* */ - /* a typedef for unsigned short */ - /* */ - REDEFINE( UShort ); - - - /* FT_Int */ - /* */ - /* */ - /* a typedef for the int type */ - /* */ - REDEFINE( Int ); - - - /* FT_UInt */ - /* */ - /* */ - /* a typedef for the unsigned int type */ - /* */ - REDEFINE( UInt ); - - - /* T1_Long */ - /* */ - /* */ - /* a typedef for signed long */ - /* */ - REDEFINE( Long ); - - - /* T1_ULong */ - /* */ - /* */ - /* a typedef for unsigned long */ - /* */ - REDEFINE( ULong ); - - - /* T1_F2Dot14 */ - /* */ - /* */ - /* a signed 2.14 fixed float used for unit vectors */ - /* */ - REDEFINE( F2Dot14 ); - - - /* T1_F26Dot6 */ - /* */ - /* */ - /* a signed 26.6 fixed float used for vectorial pixel coordinates */ - /* */ - REDEFINE( F26Dot6 ); - - - /* T1_Fixed */ - /* */ - /* */ - /* This type is used to store 16.16 fixed float values, like */ - /* scales or matrix coefficients.. */ - /* */ - REDEFINE( Fixed ); - - - /* T1_Pos */ - /* */ - /* */ - /* The type T1_Pos is a 32-bits integer used to store vectorial */ - /* coordinates. Depending on the context, these can represent */ - /* distances in integer font units, or 26.6 fixed float pixel */ - /* coordinates.. */ - /* */ - REDEFINE( Pos ); - - - /* T1_Vector */ - /* */ - /* */ - /* A simple structure used to store a 2d vector, coordinates */ - /* are of the T1_Pos type. */ - /* */ - /* */ - /* x :: horizontal coordinate */ - /* y :: vertical coordinate */ - /* */ - REDEFINE( Vector ); - - /* T1_UnitVector */ - /* */ - /* */ - /* A simple structure used to store a 2d vector unit vector. */ - /* uses T1_F2Dot14 types. */ - /* */ - /* */ - /* x :: horizontal coordinate */ - /* y :: vertical coordinate */ - /* */ - REDEFINE( UnitVector ); - - - /* T1_Matrix */ - /* */ - /* */ - /* A simple structure used to store a 2x2 matrix. Coefficients */ - /* are in 16.16 fixed float format. The computation performed */ - /* is : */ - /* { */ - /* x' = x*xx + y*xy */ - /* y' = x*yx + y*yy */ - /* } */ - /* */ - /* */ - /* xx :: matrix coefficient */ - /* xy :: matrix coefficient */ - /* yx :: matrix coefficient */ - /* yy :: matrix coefficient */ - /* */ - REDEFINE( Matrix ); - - - /* T1_BBox */ - /* */ - /* */ - /* A structure used to hold an outline's bounding box, i.e. */ - /* the coordinates of its extrema in the horizontal and vertical */ - /* directions. */ - /* */ - /* */ - /* xMin :: the horizontal minimum (left-most) */ - /* yMin :: the vertical minimum (bottom-most) */ - /* xMax :: the horizontal maximum (right-most) */ - /* yMax :: the vertical maximum (top-most) */ - /* */ - REDEFINE( BBox ); - - - /* T1_Error */ - /* */ - /* */ - /* The FreeType error code type. A value of 0 is always */ - /* interpreted as a succesful operation. */ - /* */ - REDEFINE( Error ); - - /*************************************************************************/ /*************************************************************************/ @@ -285,12 +60,12 @@ /* */ typedef struct T1_Encoding_ { - T1_Int num_chars; - T1_Int code_first; - T1_Int code_last; + FT_Int num_chars; + FT_Int code_first; + FT_Int code_last; - T1_UShort* char_index; - T1_String** char_name; + FT_UShort* char_index; + FT_String** char_name; } T1_Encoding; @@ -320,26 +95,26 @@ T1_EncodingType encoding_type; T1_Encoding encoding; - T1_Byte* subrs_block; - T1_Byte* charstrings_block; - T1_Byte* glyph_names_block; + FT_Byte* subrs_block; + FT_Byte* charstrings_block; + FT_Byte* glyph_names_block; - T1_Int num_subrs; - T1_Byte** subrs; - T1_Int* subrs_len; + FT_Int num_subrs; + FT_Byte** subrs; + FT_Int* subrs_len; - T1_Int num_glyphs; - T1_String** glyph_names; /* array of glyph names */ - T1_Byte** charstrings; /* array of glyph charstrings */ - T1_Int* charstrings_len; + FT_Int num_glyphs; + FT_String** glyph_names; /* array of glyph names */ + FT_Byte** charstrings; /* array of glyph charstrings */ + FT_Int* charstrings_len; - T1_Byte paint_type; - T1_Byte font_type; - T1_Matrix font_matrix; - T1_BBox font_bbox; - T1_Long font_id; + FT_Byte paint_type; + FT_Byte font_type; + FT_Matrix font_matrix; + FT_BBox font_bbox; + FT_Long font_id; - T1_Int stroke_width; + FT_Int stroke_width; } T1_Font; diff --git a/include/freetype/internal/tttypes.h b/include/freetype/internal/tttypes.h index 7383b4893..24914d5f7 100644 --- a/include/freetype/internal/tttypes.h +++ b/include/freetype/internal/tttypes.h @@ -32,299 +32,6 @@ #endif - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - /*** ***/ - /*** ***/ - /*** DEFINITIONS OF BASIC DATA TYPES ***/ - /*** ***/ - /*** ***/ - /*************************************************************************/ - /*************************************************************************/ - /*************************************************************************/ - - - /*************************************************************************/ - /* */ - /* The REDEFINE() macro is used to convert a FreeType generic type into */ - /* a TrueType-specific one. It simply replaces the `FT_' prefix by */ - /* `TT_' in order to define compatible types like TT_Long, TT_Error, */ - /* TT_Outline, etc. */ - /* */ -#undef REDEFINE -#define REDEFINE( type ) typedef FT_##type TT_##type - - - /*************************************************************************/ - /* */ - /* */ - /* TT_Bool */ - /* */ - /* */ - /* A typedef of unsigned char, used for simple booleans. */ - /* */ - REDEFINE( Bool ); - - - /*************************************************************************/ - /* */ - /* */ - /* TT_FWord */ - /* */ - /* */ - /* A signed 16-bit integer used to store a distance in original font */ - /* units. */ - /* */ - REDEFINE( FWord ); - - - /*************************************************************************/ - /* */ - /* */ - /* TT_UFWord */ - /* */ - /* */ - /* An unsigned 16-bit integer used to store a distance in original */ - /* font units. */ - /* */ - REDEFINE( UFWord ); - - - /*************************************************************************/ - /* */ - /* */ - /* TT_Char */ - /* */ - /* */ - /* A simple typedef for the _signed_ char type. */ - /* */ - REDEFINE( Char ); - - - /*************************************************************************/ - /* */ - /* */ - /* TT_Byte */ - /* */ - /* */ - /* A simple typedef for the _unsigned_ char type. */ - /* */ - REDEFINE( Byte ); - - - /*************************************************************************/ - /* */ - /* */ - /* TT_String */ - /* */ - /* */ - /* A simple typedef for the char type, usually used for strings. */ - /* */ - REDEFINE( String ); - - - /*************************************************************************/ - /* */ - /* */ - /* TT_Short */ - /* */ - /* */ - /* A typedef for signed short. */ - /* */ - REDEFINE( Short ); - - - /*************************************************************************/ - /* */ - /* */ - /* TT_UShort */ - /* */ - /* */ - /* A typedef for unsigned short. */ - /* */ - REDEFINE( UShort ); - - - /*************************************************************************/ - /* */ - /* */ - /* TT_Int */ - /* */ - /* */ - /* A typedef for the int type. */ - /* */ - REDEFINE( Int ); - - - /*************************************************************************/ - /* */ - /* */ - /* TT_UInt */ - /* */ - /* */ - /* A typedef for the unsigned int type. */ - /* */ - REDEFINE( UInt ); - - - /*************************************************************************/ - /* */ - /* */ - /* TT_Long */ - /* */ - /* */ - /* A typedef for signed long. */ - /* */ - REDEFINE( Long ); - - - /*************************************************************************/ - /* */ - /* */ - /* TT_ULong */ - /* */ - /* */ - /* A typedef for unsigned long. */ - /* */ - REDEFINE( ULong ); - - - /*************************************************************************/ - /* */ - /* */ - /* TT_F2Dot14 */ - /* */ - /* */ - /* A signed 2.14 fixed float type used for unit vectors. */ - /* */ - REDEFINE( F2Dot14 ); - - - /*************************************************************************/ - /* */ - /* */ - /* TT_F26Dot6 */ - /* */ - /* */ - /* A signed 26.6 fixed float type used for vectorial pixel */ - /* coordinates. */ - /* */ - REDEFINE( F26Dot6 ); - - - /*************************************************************************/ - /* */ - /* */ - /* TT_Fixed */ - /* */ - /* */ - /* This type is used to store 16.16 fixed float values, like scales */ - /* or matrix coefficients. */ - /* */ - REDEFINE( Fixed ); - - - /*************************************************************************/ - /* */ - /* */ - /* TT_Pos */ - /* */ - /* */ - /* The type FT_Pos is a 32-bit integer used to store vectorial */ - /* coordinates. Depending on the context, these can represent */ - /* distances in integer font units, or 26.6 fixed float pixel */ - /* coordinates. */ - /* */ - REDEFINE( Pos ); - - - /*************************************************************************/ - /* */ - /* */ - /* TT_Vector */ - /* */ - /* */ - /* A simple structure used to store a 2d vector; coordinates are of */ - /* the TT_Pos type. */ - /* */ - /* */ - /* x :: The horizontal coordinate. */ - /* y :: The vertical coordinate. */ - /* */ - REDEFINE( Vector ); - - - /*************************************************************************/ - /* */ - /* */ - /* TT_UnitVector */ - /* */ - /* */ - /* A simple structure used to store a 2d vector unit vector. Uses */ - /* TT_F2Dot14 types. */ - /* */ - /* */ - /* x :: Horizontal coordinate. */ - /* y :: Vertical coordinate. */ - /* */ - REDEFINE( UnitVector ); - - - /*************************************************************************/ - /* */ - /* */ - /* TT_Matrix */ - /* */ - /* */ - /* A simple structure used to store a 2x2 matrix. Coefficients are */ - /* in 16.16 fixed float format. The computation performed is: */ - /* */ - /* { */ - /* x' = x*xx + y*xy */ - /* y' = x*yx + y*yy */ - /* } */ - /* */ - /* */ - /* xx :: Matrix coefficient. */ - /* xy :: Matrix coefficient. */ - /* yx :: Matrix coefficient. */ - /* yy :: Matrix coefficient. */ - /* */ - REDEFINE( Matrix ); - - - /*************************************************************************/ - /* */ - /* */ - /* TT_BBox */ - /* */ - /* */ - /* A structure used to hold an outline's bounding box, i.e., the */ - /* coordinates of its extrema in the horizontal and vertical */ - /* directions. */ - /* */ - /* */ - /* xMin :: The horizontal minimum (left-most). */ - /* yMin :: The vertical minimum (bottom-most). */ - /* xMax :: The horizontal maximum (right-most). */ - /* yMax :: The vertical maximum (top-most). */ - /* */ - REDEFINE( BBox ); - - - /*************************************************************************/ - /* */ - /* */ - /* TT_Error */ - /* */ - /* */ - /* The TrueType error code type. A value of 0 is always interpreted */ - /* as a successful operation. */ - /* */ - REDEFINE( Error ); - - /*************************************************************************/ /*************************************************************************/ /*************************************************************************/ @@ -358,10 +65,10 @@ /* */ typedef struct TTC_Header_ { - TT_ULong Tag; - TT_Fixed version; - TT_Long DirCount; - TT_ULong* TableDirectory; + FT_ULong Tag; + FT_Fixed version; + FT_Long DirCount; + FT_ULong* TableDirectory; } TTC_Header; @@ -383,11 +90,11 @@ /* */ typedef struct SFNT_Header_ { - TT_ULong format_tag; - TT_UShort num_tables; - TT_UShort search_range; - TT_UShort entry_selector; - TT_UShort range_shift; + FT_ULong format_tag; + FT_UShort num_tables; + FT_UShort search_range; + FT_UShort entry_selector; + FT_UShort range_shift; } SFNT_Header; @@ -413,12 +120,12 @@ /* */ typedef struct TT_TableDir_ { - TT_Fixed version; /* should be 0x10000 */ - TT_UShort numTables; /* number of tables */ + FT_Fixed version; /* should be 0x10000 */ + FT_UShort numTables; /* number of tables */ - TT_UShort searchRange; /* These parameters are only used */ - TT_UShort entrySelector; /* for a dichotomy search in the */ - TT_UShort rangeShift; /* directory. We ignore them. */ + FT_UShort searchRange; /* These parameters are only used */ + FT_UShort entrySelector; /* for a dichotomy search in the */ + FT_UShort rangeShift; /* directory. We ignore them. */ } TT_TableDir; @@ -440,10 +147,10 @@ /* */ typedef struct TT_Table_ { - TT_ULong Tag; /* table type */ - TT_ULong CheckSum; /* table checksum */ - TT_ULong Offset; /* table file offset */ - TT_ULong Length; /* table length */ + FT_ULong Tag; /* table type */ + FT_ULong CheckSum; /* table checksum */ + FT_ULong Offset; /* table file offset */ + FT_ULong Length; /* table length */ } TT_Table; @@ -466,8 +173,8 @@ /* */ typedef struct TT_CMapDir_ { - TT_UShort tableVersionNumber; - TT_UShort numCMaps; + FT_UShort tableVersionNumber; + FT_UShort numCMaps; } TT_CMapDir; @@ -495,9 +202,9 @@ /* */ typedef struct TT_CMapDirEntry_ { - TT_UShort platformID; - TT_UShort platformEncodingID; - TT_Long offset; + FT_UShort platformID; + FT_UShort platformEncodingID; + FT_Long offset; } TT_CMapDirEntry; @@ -517,8 +224,8 @@ /* */ typedef struct TT_LongMetrics_ { - TT_UShort advance; - TT_Short bearing; + FT_UShort advance; + FT_Short bearing; } TT_LongMetrics; @@ -531,7 +238,7 @@ /* A simple type to model the short metrics of the `hmtx' and `vmtx' */ /* tables. */ /* */ - typedef TT_Short TT_ShortMetrics; + typedef FT_Short TT_ShortMetrics; /*************************************************************************/ @@ -563,17 +270,17 @@ /* */ typedef struct TT_NameRec_ { - TT_UShort platformID; - TT_UShort encodingID; - TT_UShort languageID; - TT_UShort nameID; - TT_UShort stringLength; - TT_UShort stringOffset; + FT_UShort platformID; + FT_UShort encodingID; + FT_UShort languageID; + FT_UShort nameID; + FT_UShort stringLength; + FT_UShort stringOffset; /* this last field is not defined in the spec */ /* but used by the FreeType engine */ - TT_Byte* string; + FT_Byte* string; } TT_NameRec; @@ -600,11 +307,11 @@ /* */ typedef struct TT_NameTable_ { - TT_UShort format; - TT_UShort numNameRecords; - TT_UShort storageOffset; + FT_UShort format; + FT_UShort numNameRecords; + FT_UShort storageOffset; TT_NameRec* names; - TT_Byte* storage; + FT_Byte* storage; } TT_NameTable; @@ -639,8 +346,8 @@ /* */ typedef struct TT_GaspRange_ { - TT_UShort maxPPEM; - TT_UShort gaspFlag; + FT_UShort maxPPEM; + FT_UShort gaspFlag; } TT_GaspRange; @@ -665,8 +372,8 @@ /* */ typedef struct TT_Gasp_ { - TT_UShort version; - TT_UShort numRanges; + FT_UShort version; + FT_UShort numRanges; TT_GaspRange* gaspRanges; } TT_Gasp; @@ -690,9 +397,9 @@ /* */ typedef struct TT_HdmxRec_ { - TT_Byte ppem; - TT_Byte max_width; - TT_Byte* widths; + FT_Byte ppem; + FT_Byte max_width; + FT_Byte* widths; } TT_HdmxRec; @@ -713,8 +420,8 @@ /* */ typedef struct TT_Hdmx_ { - TT_UShort version; - TT_Short num_records; + FT_UShort version; + FT_Short num_records; TT_HdmxRec* records; } TT_Hdmx; @@ -738,9 +445,9 @@ /* */ typedef struct TT_Kern_0_Pair_ { - TT_UShort left; /* index of left glyph in pair */ - TT_UShort right; /* index of right glyph in pair */ - TT_FWord value; /* kerning value */ + FT_UShort left; /* index of left glyph in pair */ + FT_UShort right; /* index of right glyph in pair */ + FT_FWord value; /* kerning value */ } TT_Kern_0_Pair; @@ -785,16 +492,16 @@ /* */ typedef struct TT_SBit_Metrics_ { - TT_Byte height; - TT_Byte width; + FT_Byte height; + FT_Byte width; - TT_Char horiBearingX; - TT_Char horiBearingY; - TT_Byte horiAdvance; + FT_Char horiBearingX; + FT_Char horiBearingY; + FT_Byte horiAdvance; - TT_Char vertBearingX; - TT_Char vertBearingY; - TT_Byte vertAdvance; + FT_Char vertBearingX; + FT_Char vertBearingY; + FT_Byte vertAdvance; } TT_SBit_Metrics; @@ -822,12 +529,12 @@ /* */ typedef struct TT_SBit_Small_Metrics_ { - TT_Byte height; - TT_Byte width; + FT_Byte height; + FT_Byte width; - TT_Char bearingX; - TT_Char bearingY; - TT_Byte advance; + FT_Char bearingX; + FT_Char bearingY; + FT_Byte advance; } TT_SBit_Small_Metrics; @@ -882,17 +589,17 @@ /* */ typedef struct TT_SBit_Line_Metrics_ { - TT_Char ascender; - TT_Char descender; - TT_Byte max_width; - TT_Char caret_slope_numerator; - TT_Char caret_slope_denominator; - TT_Char caret_offset; - TT_Char min_origin_SB; - TT_Char min_advance_SB; - TT_Char max_before_BL; - TT_Char min_after_BL; - TT_Char pads[2]; + FT_Char ascender; + FT_Char descender; + FT_Byte max_width; + FT_Char caret_slope_numerator; + FT_Char caret_slope_denominator; + FT_Char caret_offset; + FT_Char min_origin_SB; + FT_Char min_advance_SB; + FT_Char max_before_BL; + FT_Char min_after_BL; + FT_Char pads[2]; } TT_SBit_Line_Metrics; @@ -936,21 +643,21 @@ /* */ typedef struct TT_SBit_Range { - TT_UShort first_glyph; - TT_UShort last_glyph; + FT_UShort first_glyph; + FT_UShort last_glyph; - TT_UShort index_format; - TT_UShort image_format; - TT_ULong image_offset; + FT_UShort index_format; + FT_UShort image_format; + FT_ULong image_offset; - TT_ULong image_size; + FT_ULong image_size; TT_SBit_Metrics metrics; - TT_ULong num_glyphs; + FT_ULong num_glyphs; - TT_ULong* glyph_offsets; - TT_UShort* glyph_codes; + FT_ULong* glyph_offsets; + FT_UShort* glyph_codes; - TT_ULong table_offset; + FT_ULong table_offset; } TT_SBit_Range; @@ -990,23 +697,23 @@ /* */ typedef struct TT_SBit_Strike_ { - TT_Int num_ranges; + FT_Int num_ranges; TT_SBit_Range* sbit_ranges; - TT_ULong ranges_offset; + FT_ULong ranges_offset; - TT_ULong color_ref; + FT_ULong color_ref; TT_SBit_Line_Metrics hori; TT_SBit_Line_Metrics vert; - TT_UShort start_glyph; - TT_UShort end_glyph; + FT_UShort start_glyph; + FT_UShort end_glyph; - TT_Byte x_ppem; - TT_Byte y_ppem; + FT_Byte x_ppem; + FT_Byte y_ppem; - TT_Byte bit_depth; - TT_Char flags; + FT_Byte bit_depth; + FT_Char flags; } TT_SBit_Strike; @@ -1026,10 +733,10 @@ /* */ typedef struct TT_SBit_Component_ { - TT_UShort glyph_code; + FT_UShort glyph_code; - TT_Char x_offset; - TT_Char y_offset; + FT_Char x_offset; + FT_Char y_offset; } TT_SBit_Component; @@ -1061,11 +768,11 @@ TT_SBit_Line_Metrics hori; TT_SBit_Line_Metrics vert; - TT_Byte x_ppem; - TT_Byte y_ppem; + FT_Byte x_ppem; + FT_Byte y_ppem; - TT_Byte x_ppem_substitute; - TT_Byte y_ppem_substitute; + FT_Byte x_ppem_substitute; + FT_Byte y_ppem_substitute; } TT_SBit_Scale; @@ -1101,10 +808,10 @@ /* */ typedef struct TT_Post_20_ { - TT_UShort num_glyphs; - TT_UShort num_names; - TT_UShort* glyph_indices; - TT_Char** glyph_names; + FT_UShort num_glyphs; + FT_UShort num_names; + FT_UShort* glyph_indices; + FT_Char** glyph_names; } TT_Post_20; @@ -1126,8 +833,8 @@ /* */ typedef struct TT_Post_25_ { - TT_UShort num_glyphs; - TT_Char* offsets; + FT_UShort num_glyphs; + FT_Char* offsets; } TT_Post_25; @@ -1149,7 +856,7 @@ /* */ typedef struct TT_Post_Names_ { - TT_Bool loaded; + FT_Bool loaded; union { @@ -1175,7 +882,7 @@ /* format 0 */ typedef struct TT_CMap0_ { - TT_Byte* glyphIdArray; + FT_Byte* glyphIdArray; } TT_CMap0; @@ -1183,23 +890,23 @@ /* format 2 */ typedef struct TT_CMap2SubHeader_ { - TT_UShort firstCode; /* first valid low byte */ - TT_UShort entryCount; /* number of valid low bytes */ - TT_Short idDelta; /* delta value to glyphIndex */ - TT_UShort idRangeOffset; /* offset from here to 1st code */ + FT_UShort firstCode; /* first valid low byte */ + FT_UShort entryCount; /* number of valid low bytes */ + FT_Short idDelta; /* delta value to glyphIndex */ + FT_UShort idRangeOffset; /* offset from here to 1st code */ } TT_CMap2SubHeader; typedef struct TT_CMap2_ { - TT_UShort* subHeaderKeys; + FT_UShort* subHeaderKeys; /* high byte mapping table */ /* value = subHeader index * 8 */ TT_CMap2SubHeader* subHeaders; - TT_UShort* glyphIdArray; - TT_UShort numGlyphId; /* control value */ + FT_UShort* glyphIdArray; + FT_UShort numGlyphId; /* control value */ } TT_CMap2; @@ -1207,24 +914,24 @@ /* format 4 */ typedef struct TT_CMap4Segment_ { - TT_UShort endCount; - TT_UShort startCount; - TT_Short idDelta; - TT_UShort idRangeOffset; + FT_UShort endCount; + FT_UShort startCount; + FT_Short idDelta; + FT_UShort idRangeOffset; } TT_CMap4Segment; typedef struct TT_CMap4_ { - TT_UShort segCountX2; /* number of segments * 2 */ - TT_UShort searchRange; /* these parameters can be used */ - TT_UShort entrySelector; /* for a binary search */ - TT_UShort rangeShift; + FT_UShort segCountX2; /* number of segments * 2 */ + FT_UShort searchRange; /* these parameters can be used */ + FT_UShort entrySelector; /* for a binary search */ + FT_UShort rangeShift; TT_CMap4Segment* segments; - TT_UShort* glyphIdArray; - TT_UShort numGlyphId; /* control value */ + FT_UShort* glyphIdArray; + FT_UShort numGlyphId; /* control value */ TT_CMap4Segment* last_segment; /* last used segment, this is a small */ /* cache to potentially increase speed */ @@ -1234,30 +941,30 @@ /* format 6 */ typedef struct TT_CMap6_ { - TT_UShort firstCode; /* first character code of subrange */ - TT_UShort entryCount; /* number of character codes in subrange */ + FT_UShort firstCode; /* first character code of subrange */ + FT_UShort entryCount; /* number of character codes in subrange */ - TT_UShort* glyphIdArray; + FT_UShort* glyphIdArray; } TT_CMap6; typedef struct TT_CMapTable_ TT_CMapTable; typedef - TT_UInt (*TT_CharMap_Func)( TT_CMapTable* charmap, - TT_ULong char_code ); + FT_UInt (*TT_CharMap_Func)( TT_CMapTable* charmap, + FT_ULong char_code ); /* charmap table */ struct TT_CMapTable_ { - TT_UShort platformID; - TT_UShort platformEncodingID; - TT_UShort format; - TT_UShort length; - TT_UShort version; + FT_UShort platformID; + FT_UShort platformEncodingID; + FT_UShort format; + FT_UShort length; + FT_UShort version; - TT_Bool loaded; - TT_ULong offset; + FT_Bool loaded; + FT_ULong offset; union { @@ -1344,7 +1051,7 @@ /* a function type used for the truetype bytecode interpreter hooks */ - typedef TT_Error (*TT_Interpreter)( void* exec_context ); + typedef FT_Error (*TT_Interpreter)( void* exec_context ); /*************************************************************************/ @@ -1370,10 +1077,10 @@ /* The stream cursor must be at the font file's origin */ /* */ typedef - TT_Error (*TT_Goto_Table_Func)( TT_Face face, - TT_ULong tag, + FT_Error (*TT_Goto_Table_Func)( TT_Face face, + FT_ULong tag, FT_Stream stream, - TT_ULong *length ); + FT_ULong *length ); /*************************************************************************/ /* */ @@ -1542,25 +1249,25 @@ TTC_Header ttc_header; FT_ULong format_tag; - TT_UShort num_tables; + FT_UShort num_tables; TT_Table* dir_tables; TT_Header header; /* TrueType header table */ TT_HoriHeader horizontal; /* TrueType horizontal header */ TT_MaxProfile max_profile; - TT_ULong max_components; + FT_ULong max_components; - TT_Bool vertical_info; + FT_Bool vertical_info; TT_VertHeader vertical; /* TT Vertical header, if present */ - TT_Int num_names; /* number of name records */ + FT_Int num_names; /* number of name records */ TT_NameTable name_table; /* name table */ TT_OS2 os2; /* TrueType OS/2 table */ TT_Postscript postscript; /* TrueType Postscript table */ - TT_Int num_charmaps; + FT_Int num_charmaps; TT_CharMap charmaps; /* array of TT_CharMapRec */ /* a pointer to the function used to seek a stream to the start of */ @@ -1593,10 +1300,10 @@ TT_PCLT pclt; /* embedded bitmaps support */ - TT_Int num_sbit_strikes; + FT_Int num_sbit_strikes; TT_SBit_Strike* sbit_strikes; - TT_Int num_sbit_scales; + FT_Int num_sbit_scales; TT_SBit_Scale* sbit_scales; /* postscript names table */ @@ -1609,24 +1316,24 @@ /***********************************************************************/ /* the glyph locations */ - TT_UShort num_locations; - TT_Long* glyph_locations; + FT_UShort num_locations; + FT_Long* glyph_locations; /* the font program, if any */ - TT_ULong font_program_size; - TT_Byte* font_program; + FT_ULong font_program_size; + FT_Byte* font_program; /* the cvt program, if any */ - TT_ULong cvt_program_size; - TT_Byte* cvt_program; + FT_ULong cvt_program_size; + FT_Byte* cvt_program; /* the original, unscaled, control value table */ - TT_ULong cvt_size; - TT_Short* cvt; + FT_ULong cvt_size; + FT_Short* cvt; /* the format 0 kerning table, if any */ - TT_Int num_kern_pairs; - TT_Int kern_table_index; + FT_Int num_kern_pairs; + FT_Int kern_table_index; TT_Kern_0_Pair* kern_pairs; /* a pointer to the bytecode interpreter to use. This is also */ diff --git a/include/freetype/tttags.h b/include/freetype/tttags.h index f7e9af5ec..ed00d3da1 100644 --- a/include/freetype/tttags.h +++ b/include/freetype/tttags.h @@ -26,6 +26,8 @@ #define TTAG_cvt FT_MAKE_TAG( 'c', 'v', 't', ' ' ) #define TTAG_CFF FT_MAKE_TAG( 'C', 'F', 'F', ' ' ) #define TTAG_DSIG FT_MAKE_TAG( 'D', 'S', 'I', 'G' ) +#define TTAG_bdat FT_MAKE_TAG( 'b', 'd', 'a', 't' ) +#define TTAG_bloc FT_MAKE_TAG( 'b', 'l', 'o', 'c' ) #define TTAG_EBDT FT_MAKE_TAG( 'E', 'B', 'D', 'T' ) #define TTAG_EBLC FT_MAKE_TAG( 'E', 'B', 'L', 'C' ) #define TTAG_EBSC FT_MAKE_TAG( 'E', 'B', 'S', 'C' ) diff --git a/src/base/ftoutln.c b/src/base/ftoutln.c index 93d8f457c..fb84cb7d9 100644 --- a/src/base/ftoutln.c +++ b/src/base/ftoutln.c @@ -566,135 +566,6 @@ } - /*************************************************************************/ - /* */ - /* */ - /* FT_Done_GlyphZone */ - /* */ - /* */ - /* Deallocates a glyph zone. */ - /* */ - /* */ - /* zone :: A pointer to the target glyph zone. */ - /* */ - BASE_FUNC( void ) FT_Done_GlyphZone( FT_GlyphZone* zone ) - { - FT_Memory memory = zone->memory; - - - FREE( zone->contours ); - FREE( zone->tags ); - FREE( zone->cur ); - FREE( zone->org ); - - zone->max_points = zone->n_points = 0; - zone->max_contours = zone->n_contours = 0; - } - - - /*************************************************************************/ - /* */ - /* */ - /* FT_New_GlyphZone */ - /* */ - /* */ - /* Allocates a new glyph zone. */ - /* */ - /* */ - /* memory :: A handle to the current memory object. */ - /* */ - /* maxPoints :: The capacity of glyph zone in points. */ - /* */ - /* maxContours :: The capacity of glyph zone in contours. */ - /* */ - /* */ - /* zone :: A pointer to the target glyph zone record. */ - /* */ - /* */ - /* FreeType error code. 0 means success. */ - /* */ - BASE_FUNC( FT_Error ) FT_New_GlyphZone( FT_Memory memory, - FT_UShort maxPoints, - FT_Short maxContours, - FT_GlyphZone* zone ) - { - FT_Error error; - - - if ( maxPoints > 0 ) - maxPoints += 2; - - MEM_Set( zone, 0, sizeof ( *zone ) ); - zone->memory = memory; - - if ( ALLOC_ARRAY( zone->org, maxPoints * 2, FT_F26Dot6 ) || - ALLOC_ARRAY( zone->cur, maxPoints * 2, FT_F26Dot6 ) || - ALLOC_ARRAY( zone->tags, maxPoints, FT_Byte ) || - ALLOC_ARRAY( zone->contours, maxContours, FT_UShort ) ) - { - FT_Done_GlyphZone( zone ); - } - - return error; - } - - - /*************************************************************************/ - /* */ - /* */ - /* FT_Update_GlyphZone */ - /* */ - /* */ - /* Checks the size of a zone and reallocates it if necessary. */ - /* */ - /* */ - /* newPoints :: The new capacity for points. We add two slots for */ - /* phantom points. */ - /* */ - /* newContours :: The new capacity for contours. */ - /* */ - /* */ - /* zone :: The address of the target zone. */ - /* */ - BASE_FUNC( FT_Error ) FT_Update_GlyphZone( FT_GlyphZone* zone, - FT_UShort newPoints, - FT_Short newContours ) - { - FT_Error error = FT_Err_Ok; - FT_Memory memory = zone->memory; - - - newPoints += 2; - - if ( zone->max_points < newPoints ) - { - /* reallocate the points arrays */ - if ( REALLOC_ARRAY( zone->org, zone->max_points * 2, - newPoints * 2, FT_F26Dot6 ) || - REALLOC_ARRAY( zone->cur, zone->max_points * 2, - newPoints * 2, FT_F26Dot6 ) || - REALLOC_ARRAY( zone->tags, zone->max_points * 2, - newPoints, FT_Byte ) ) - goto Exit; - - zone->max_points = newPoints; - } - - if ( zone->max_contours < newContours ) - { - /* reallocate the contours array */ - if ( REALLOC_ARRAY( zone->contours, zone->max_contours, - newContours, FT_UShort ) ) - goto Exit; - - zone->max_contours = newContours; - } - - Exit: - return error; - } - - /*************************************************************************/ /* */ /* */ diff --git a/src/cff/t2driver.c b/src/cff/t2driver.c index e596aa520..ec5d49df2 100644 --- a/src/cff/t2driver.c +++ b/src/cff/t2driver.c @@ -52,8 +52,8 @@ #undef PAIR_TAG -#define PAIR_TAG( left, right ) ( ( (TT_ULong)left << 16 ) | \ - (TT_ULong)right ) +#define PAIR_TAG( left, right ) ( ( (FT_ULong)left << 16 ) | \ + (FT_ULong)right ) /*************************************************************************/ @@ -89,10 +89,10 @@ /* They can be implemented by format-specific interfaces. */ /* */ static - TT_Error Get_Kerning( TT_Face face, - TT_UInt left_glyph, - TT_UInt right_glyph, - TT_Vector* kerning ) + FT_Error Get_Kerning( TT_Face face, + FT_UInt left_glyph, + FT_UInt right_glyph, + FT_Vector* kerning ) { TT_Kern_0_Pair* pair; @@ -106,8 +106,8 @@ if ( face->kern_pairs ) { /* there are some kerning pairs in this font file! */ - TT_ULong search_tag = PAIR_TAG( left_glyph, right_glyph ); - TT_Long left, right; + FT_ULong search_tag = PAIR_TAG( left_glyph, right_glyph ); + FT_Long left, right; left = 0; @@ -115,8 +115,8 @@ while ( left <= right ) { - TT_Int middle = left + ( ( right - left ) >> 1 ); - TT_ULong cur_pair; + FT_Int middle = left + ( ( right - left ) >> 1 ); + FT_ULong cur_pair; pair = face->kern_pairs + middle; @@ -184,11 +184,11 @@ /* TrueType error code. 0 means success. */ /* */ static - TT_Error Set_Char_Sizes( T2_Size size, - TT_F26Dot6 char_width, - TT_F26Dot6 char_height, - TT_UInt horz_resolution, - TT_UInt vert_resolution ) + FT_Error Set_Char_Sizes( T2_Size size, + FT_F26Dot6 char_width, + FT_F26Dot6 char_height, + FT_UInt horz_resolution, + FT_UInt vert_resolution ) { FT_Size_Metrics* metrics = &size->metrics; T2_Face face = (T2_Face)size->face; @@ -213,8 +213,8 @@ metrics->x_scale = FT_DivFix( dim_x, face->root.units_per_EM ); metrics->y_scale = FT_DivFix( dim_y, face->root.units_per_EM ); - metrics->x_ppem = (TT_UShort)( dim_x >> 6 ); - metrics->y_ppem = (TT_UShort)( dim_y >> 6 ); + metrics->x_ppem = (FT_UShort)( dim_x >> 6 ); + metrics->y_ppem = (FT_UShort)( dim_y >> 6 ); } return T2_Reset_Size( size ); @@ -242,9 +242,9 @@ /* TrueType error code. 0 means success. */ /* */ static - TT_Error Set_Pixel_Sizes( T2_Size size, - TT_UInt pixel_width, - TT_UInt pixel_height ) + FT_Error Set_Pixel_Sizes( T2_Size size, + FT_UInt pixel_width, + FT_UInt pixel_height ) { UNUSED( pixel_width ); UNUSED( pixel_height ); @@ -280,12 +280,12 @@ /* TrueType error code. 0 means success. */ /* */ static - TT_Error Load_Glyph( T2_GlyphSlot slot, + FT_Error Load_Glyph( T2_GlyphSlot slot, T2_Size size, - TT_UShort glyph_index, - TT_UInt load_flags ) + FT_UShort glyph_index, + FT_UInt load_flags ) { - TT_Error error; + FT_Error error; if ( !slot ) @@ -343,10 +343,10 @@ /* Glyph index. 0 means `undefined character code'. */ /* */ static - TT_UInt Get_Char_Index( TT_CharMap charmap, - TT_Long charcode ) + FT_UInt Get_Char_Index( TT_CharMap charmap, + FT_Long charcode ) { - TT_Error error; + FT_Error error; T2_Face face; TT_CMapTable* cmap; diff --git a/src/cff/t2gload.c b/src/cff/t2gload.c index f42a5b68f..c1e4ae9d8 100644 --- a/src/cff/t2gload.c +++ b/src/cff/t2gload.c @@ -299,9 +299,9 @@ /* */ /* The bias value. */ static - TT_Int t2_compute_bias( TT_UInt num_subrs ) + FT_Int t2_compute_bias( FT_UInt num_subrs ) { - TT_Int result; + FT_Int result; if ( num_subrs < 1240 ) @@ -363,8 +363,8 @@ /* check that there is enough room for `count' more points */ static - TT_Error check_points( T2_Builder* builder, - TT_Int count ) + FT_Error check_points( T2_Builder* builder, + FT_Int count ) { FT_Outline* base = &builder->base; FT_Outline* outline = &builder->current; @@ -378,20 +378,20 @@ /* realloc points table if necessary */ if ( count >= builder->max_points ) { - TT_Error error; + FT_Error error; FT_Memory memory = builder->memory; - TT_Int increment = outline->points - base->points; - TT_Int current = builder->max_points; + FT_Int increment = outline->points - base->points; + FT_Int current = builder->max_points; while ( builder->max_points < count ) builder->max_points += 8; if ( REALLOC_ARRAY( base->points, current, - builder->max_points, TT_Vector ) || + builder->max_points, FT_Vector ) || REALLOC_ARRAY( base->tags, current, - builder->max_points, TT_Byte ) ) + builder->max_points, FT_Byte ) ) { builder->error = error; return error; @@ -408,17 +408,17 @@ /* add a new point, do not check space */ static void add_point( T2_Builder* builder, - TT_Pos x, - TT_Pos y, - TT_Byte flag ) + FT_Pos x, + FT_Pos y, + FT_Byte flag ) { FT_Outline* outline = &builder->current; if ( builder->load_points ) { - TT_Vector* point = outline->points + outline->n_points; - TT_Byte* control = (FT_Byte*)outline->tags + outline->n_points; + FT_Vector* point = outline->points + outline->n_points; + FT_Byte* control = (FT_Byte*)outline->tags + outline->n_points; point->x = x >> 16; @@ -434,11 +434,11 @@ /* check room for a new on-curve point, then add it */ static - TT_Error add_point1( T2_Builder* builder, - TT_Pos x, - TT_Pos y ) + FT_Error add_point1( T2_Builder* builder, + FT_Pos x, + FT_Pos y ) { - TT_Error error; + FT_Error error; error = check_points( builder, 1 ); @@ -451,7 +451,7 @@ /* check room for a new contour, then add it */ static - TT_Error add_contour( T2_Builder* builder ) + FT_Error add_contour( T2_Builder* builder ) { FT_Outline* base = &builder->base; FT_Outline* outline = &builder->current; @@ -467,16 +467,16 @@ if ( base->n_contours + outline->n_contours >= builder->max_contours && builder->load_points ) { - TT_Error error; + FT_Error error; FT_Memory memory = builder->memory; - TT_Int increment = outline->contours - base->contours; - TT_Int current = builder->max_contours; + FT_Int increment = outline->contours - base->contours; + FT_Int current = builder->max_contours; builder->max_contours += 4; if ( REALLOC_ARRAY( base->contours, - current, builder->max_contours, TT_Short ) ) + current, builder->max_contours, FT_Short ) ) { builder->error = error; return error; @@ -496,14 +496,14 @@ /* if a path was begun, add its first on-curve point */ static - TT_Error start_point( T2_Builder* builder, - TT_Pos x, - TT_Pos y ) + FT_Error start_point( T2_Builder* builder, + FT_Pos x, + FT_Pos y ) { /* test whether we are building a new contour */ if ( !builder->path_begun ) { - TT_Error error; + FT_Error error; builder->path_begun = 1; @@ -553,19 +553,19 @@ /* TrueType error code. 0 means success. */ /* */ LOCAL_FUNC - TT_Error T2_Parse_CharStrings( T2_Decoder* decoder, - TT_Byte* charstring_base, - TT_Int charstring_len ) + FT_Error T2_Parse_CharStrings( T2_Decoder* decoder, + FT_Byte* charstring_base, + FT_Int charstring_len ) { - TT_Error error; + FT_Error error; T2_Decoder_Zone* zone; - TT_Byte* ip; - TT_Byte* limit; + FT_Byte* ip; + FT_Byte* limit; T2_Builder* builder = &decoder->builder; FT_Outline* outline; - TT_Pos x, y; - TT_Fixed seed; - TT_Fixed* stack; + FT_Pos x, y; + FT_Fixed seed; + FT_Fixed* stack; /* set default width */ @@ -602,8 +602,8 @@ while ( ip < limit ) { T2_Operator op; - TT_Byte v; - TT_Byte count; + FT_Byte v; + FT_Byte count; /********************************************************************/ @@ -613,8 +613,8 @@ v = *ip++; if ( v >= 32 || v == 28 ) { - TT_Int shift = 16; - TT_Long val; + FT_Int shift = 16; + FT_Long val; /* this is an operand, push it on the stack */ @@ -665,9 +665,9 @@ } else { - TT_Fixed* args = decoder->top; - TT_Int num_args = args - decoder->stack; - TT_Int req_args; + FT_Fixed* args = decoder->top; + FT_Int num_args = args - decoder->stack; + FT_Int req_args; /* find operator */ @@ -947,7 +947,7 @@ case t2_op_hlineto: case t2_op_vlineto: { - TT_Int phase = ( op == t2_op_hlineto ); + FT_Int phase = ( op == t2_op_hlineto ); FT_TRACE4(( op == t2_op_hlineto ? " hlineto" : @@ -1074,7 +1074,7 @@ case t2_op_vhcurveto: case t2_op_hvcurveto: { - TT_Int phase; + FT_Int phase; FT_TRACE4(( op == t2_op_vhcurveto ? " vhcurveto" : @@ -1128,7 +1128,7 @@ case t2_op_rlinecurve: case t2_op_rcurveline: { - TT_Int mod6 = num_args % 6; + FT_Int mod6 = num_args % 6; FT_TRACE4(( op == t2_op_rcurveline ? " rcurveline" : @@ -1227,7 +1227,7 @@ case t2_op_random: { - TT_Fixed rand; + FT_Fixed rand; FT_TRACE4(( " rand" )); @@ -1256,9 +1256,9 @@ if ( args[0] > 0 ) { - TT_Int count = 9; - TT_Fixed root = args[0]; - TT_Fixed new_root; + FT_Int count = 9; + FT_Fixed root = args[0]; + FT_Fixed new_root; for (;;) @@ -1282,7 +1282,7 @@ case t2_op_exch: { - TT_Fixed tmp; + FT_Fixed tmp; FT_TRACE4(( " exch" )); @@ -1296,7 +1296,7 @@ case t2_op_index: { - TT_Int index = args[0] >> 16; + FT_Int index = args[0] >> 16; FT_TRACE4(( " index" )); @@ -1312,8 +1312,8 @@ case t2_op_roll: { - TT_Int count = (FT_Int)( args[0] >> 16 ); - TT_Int index = (FT_Int)( args[1] >> 16 ); + FT_Int count = (FT_Int)( args[0] >> 16 ); + FT_Int index = (FT_Int)( args[1] >> 16 ); FT_TRACE4(( " roll" )); @@ -1329,8 +1329,8 @@ { while ( index > 0 ) { - TT_Fixed tmp = args[count - 1]; - TT_Int i; + FT_Fixed tmp = args[count - 1]; + FT_Int i; for ( i = count - 2; i >= 0; i-- ) @@ -1343,8 +1343,8 @@ { while (index < 0) { - TT_Fixed tmp = args[0]; - TT_Int i; + FT_Fixed tmp = args[0]; + FT_Int i; for ( i = 0; i < count - 1; i++ ) @@ -1366,8 +1366,8 @@ case t2_op_put: { - TT_Fixed val = args[0]; - TT_Int index = (FT_Int)( args[1] >> 16 ); + FT_Fixed val = args[0]; + FT_Int index = (FT_Int)( args[1] >> 16 ); FT_TRACE4(( " put" )); @@ -1453,7 +1453,7 @@ case t2_op_callsubr: { - TT_UInt index = (FT_UInt)( ( args[0] >> 16 ) + + FT_UInt index = (FT_UInt)( ( args[0] >> 16 ) + decoder->locals_bias ); @@ -1492,7 +1492,7 @@ case t2_op_callgsubr: { - TT_UInt index = (FT_UInt)( ( args[0] >> 16 ) + + FT_UInt index = (FT_UInt)( ( args[0] >> 16 ) + decoder->globals_bias ); @@ -1600,12 +1600,12 @@ LOCAL_FUNC - TT_Error T2_Compute_Max_Advance( TT_Face face, - TT_Int* max_advance ) + FT_Error T2_Compute_Max_Advance( TT_Face face, + FT_Int* max_advance ) { - TT_Error error = 0; + FT_Error error = 0; T2_Decoder decoder; - TT_Int glyph_index; + FT_Int glyph_index; CFF_Font* cff = (CFF_Font*)face->other; @@ -1622,8 +1622,8 @@ for ( glyph_index = 0; glyph_index < face->root.num_glyphs; glyph_index++ ) { - TT_Byte* charstring; - TT_ULong charstring_len; + FT_Byte* charstring; + FT_ULong charstring_len; /* now get load the unscaled outline */ @@ -1666,15 +1666,15 @@ LOCAL_FUNC - TT_Error T2_Load_Glyph( T2_GlyphSlot glyph, + FT_Error T2_Load_Glyph( T2_GlyphSlot glyph, T2_Size size, - TT_Int glyph_index, - TT_Int load_flags ) + FT_Int glyph_index, + FT_Int load_flags ) { - TT_Error error; + FT_Error error; T2_Decoder decoder; TT_Face face = (TT_Face)glyph->root.face; - TT_Bool hinting; + FT_Bool hinting; CFF_Font* cff = (CFF_Font*)face->other; @@ -1693,14 +1693,14 @@ glyph->root.format = ft_glyph_format_none; { - TT_Byte* charstring; - TT_ULong charstring_len; + FT_Byte* charstring; + FT_ULong charstring_len; T2_Init_Decoder( &decoder, face, size, glyph ); decoder.builder.no_recurse = - (FT_Bool)( load_flags & FT_LOAD_NO_RECURSE ); + (FT_Bool)( (load_flags & FT_LOAD_NO_RECURSE) != 0 ); /* now load the unscaled outline */ error = T2_Access_Element( &cff->charstrings_index, glyph_index, @@ -1768,11 +1768,11 @@ if ( ( load_flags & FT_LOAD_NO_SCALE ) == 0 ) { /* scale the outline and the metrics */ - TT_Int n; + FT_Int n; FT_Outline* cur = &decoder.builder.base; - TT_Vector* vec = cur->points; - TT_Fixed x_scale = glyph->x_scale; - TT_Fixed y_scale = glyph->y_scale; + FT_Vector* vec = cur->points; + FT_Fixed x_scale = glyph->x_scale; + FT_Fixed y_scale = glyph->y_scale; /* First of all, scale the points */ diff --git a/src/cff/t2gload.h b/src/cff/t2gload.h index 07329fb80..fb6a48833 100644 --- a/src/cff/t2gload.h +++ b/src/cff/t2gload.h @@ -92,27 +92,27 @@ FT_Outline current; /* the current glyph outline */ FT_Outline base; /* the composite glyph outline */ - TT_Int max_points; /* capacity of base outline in points */ - TT_Int max_contours; /* capacity of base outline in contours */ + FT_Int max_points; /* capacity of base outline in points */ + FT_Int max_contours; /* capacity of base outline in contours */ - TT_Vector last; + FT_Vector last; - TT_Fixed scale_x; - TT_Fixed scale_y; + FT_Fixed scale_x; + FT_Fixed scale_y; - TT_Pos pos_x; - TT_Pos pos_y; + FT_Pos pos_x; + FT_Pos pos_y; - TT_Vector left_bearing; - TT_Vector advance; + FT_Vector left_bearing; + FT_Vector advance; - TT_BBox bbox; /* bounding box */ - TT_Bool path_begun; - TT_Bool load_points; - TT_Bool no_recurse; + FT_BBox bbox; /* bounding box */ + FT_Bool path_begun; + FT_Bool load_points; + FT_Bool no_recurse; - TT_Error error; /* only used for memory errors */ - TT_Bool metrics_only; + FT_Error error; /* only used for memory errors */ + FT_Bool metrics_only; } T2_Builder; @@ -121,9 +121,9 @@ typedef struct T2_Decoder_Zone_ { - TT_Byte* base; - TT_Byte* limit; - TT_Byte* cursor; + FT_Byte* base; + FT_Byte* limit; + FT_Byte* cursor; } T2_Decoder_Zone; @@ -133,32 +133,32 @@ T2_Builder builder; CFF_Font* cff; - TT_Fixed stack[T2_MAX_OPERANDS + 1]; - TT_Fixed* top; + FT_Fixed stack[T2_MAX_OPERANDS + 1]; + FT_Fixed* top; T2_Decoder_Zone zones[T2_MAX_SUBRS_CALLS + 1]; T2_Decoder_Zone* zone; - TT_Int flex_state; - TT_Int num_flex_vectors; - TT_Vector flex_vectors[7]; + FT_Int flex_state; + FT_Int num_flex_vectors; + FT_Vector flex_vectors[7]; - TT_Pos glyph_width; - TT_Pos nominal_width; + FT_Pos glyph_width; + FT_Pos nominal_width; - TT_Bool read_width; - TT_Int num_hints; - TT_Fixed* buildchar; - TT_Int len_buildchar; + FT_Bool read_width; + FT_Int num_hints; + FT_Fixed* buildchar; + FT_Int len_buildchar; - TT_UInt num_locals; - TT_UInt num_globals; + FT_UInt num_locals; + FT_UInt num_globals; - TT_Int locals_bias; - TT_Int globals_bias; + FT_Int locals_bias; + FT_Int globals_bias; - TT_Byte** locals; - TT_Byte** globals; + FT_Byte** locals; + FT_Byte** globals; } T2_Decoder; @@ -174,22 +174,22 @@ /* Compute the maximum advance width of a font through quick parsing */ LOCAL_DEF - TT_Error T2_Compute_Max_Advance( TT_Face face, - TT_Int* max_advance ); + FT_Error T2_Compute_Max_Advance( TT_Face face, + FT_Int* max_advance ); #endif /* This function is exported, because it is used by the T1Dump utility */ LOCAL_DEF - TT_Error T2_Parse_CharStrings( T2_Decoder* decoder, - TT_Byte* charstring_base, - TT_Int charstring_len ); + FT_Error T2_Parse_CharStrings( T2_Decoder* decoder, + FT_Byte* charstring_base, + FT_Int charstring_len ); LOCAL_DEF - TT_Error T2_Load_Glyph( T2_GlyphSlot glyph, + FT_Error T2_Load_Glyph( T2_GlyphSlot glyph, T2_Size size, - TT_Int glyph_index, - TT_Int load_flags ); + FT_Int glyph_index, + FT_Int load_flags ); #ifdef __cplusplus diff --git a/src/cff/t2load.c b/src/cff/t2load.c index d5e990b8b..6d16f60e4 100644 --- a/src/cff/t2load.c +++ b/src/cff/t2load.c @@ -39,10 +39,10 @@ /* read a CFF offset from memory */ static - TT_ULong t2_get_offset( TT_Byte* p, - TT_Byte off_size ) + FT_ULong t2_get_offset( FT_Byte* p, + FT_Byte off_size ) { - TT_ULong result; + FT_ULong result; for ( result = 0; off_size > 0; off_size-- ) @@ -53,13 +53,13 @@ static - TT_Error t2_new_cff_index( CFF_Index* index, + FT_Error t2_new_cff_index( CFF_Index* index, FT_Stream stream, - TT_Bool load ) + FT_Bool load ) { - TT_Error error; + FT_Error error; FT_Memory memory = stream->memory; - TT_UShort count; + FT_UShort count; MEM_Set( index, 0, sizeof ( *index ) ); @@ -68,10 +68,10 @@ if ( !READ_UShort( count ) && count > 0 ) { - TT_Byte* p; - TT_Byte offsize; - TT_ULong data_size; - TT_ULong* poff; + FT_Byte* p; + FT_Byte offsize; + FT_ULong data_size; + FT_ULong* poff; /* there is at least one element; read the offset size */ @@ -82,16 +82,16 @@ index->stream = stream; index->count = count; index->off_size = offsize; - data_size = (TT_ULong)( count + 1 ) * offsize; + data_size = (FT_ULong)( count + 1 ) * offsize; if ( ALLOC_ARRAY( index->offsets, count + 1, FT_ULong ) || ACCESS_Frame( data_size ) ) goto Exit; poff = index->offsets; - p = (TT_Byte*)stream->cursor; + p = (FT_Byte*)stream->cursor; - for ( ; (TT_Short)count >= 0; count-- ) + for ( ; (FT_Short)count >= 0; count-- ) { poff[0] = t2_get_offset( p, offsize ); poff++; @@ -143,18 +143,18 @@ static - TT_Error t2_explicit_cff_index( CFF_Index* index, - TT_Byte*** table ) + FT_Error t2_explicit_cff_index( CFF_Index* index, + FT_Byte*** table ) { - TT_Error error = 0; + FT_Error error = 0; FT_Memory memory = index->stream->memory; - TT_UInt n, offset, old_offset; - TT_Byte** t; + FT_UInt n, offset, old_offset; + FT_Byte** t; *table = 0; - if ( index->count > 0 && !ALLOC_ARRAY( t, index->count + 1, TT_Byte* ) ) + if ( index->count > 0 && !ALLOC_ARRAY( t, index->count + 1, FT_Byte* ) ) { old_offset = 1; for ( n = 0; n <= index->count; n++ ) @@ -175,18 +175,18 @@ LOCAL_FUNC - TT_Error T2_Access_Element( CFF_Index* index, - TT_UInt element, - TT_Byte** pbytes, - TT_ULong* pbyte_len ) + FT_Error T2_Access_Element( CFF_Index* index, + FT_UInt element, + FT_Byte** pbytes, + FT_ULong* pbyte_len ) { - TT_Error error = 0; + FT_Error error = 0; if ( index && index->count > element ) { /* compute start and end offsets */ - TT_ULong off1, off2; + FT_ULong off1, off2; off1 = index->offsets[element]; @@ -241,7 +241,7 @@ LOCAL_FUNC void T2_Forget_Element( CFF_Index* index, - TT_Byte** pbytes ) + FT_Byte** pbytes ) { if ( index->bytes == 0 ) { @@ -254,14 +254,14 @@ LOCAL_FUNC - TT_String* T2_Get_Name( CFF_Index* index, - TT_UInt element ) + FT_String* T2_Get_Name( CFF_Index* index, + FT_UInt element ) { FT_Memory memory = index->stream->memory; - TT_Byte* bytes; - TT_ULong byte_len; - TT_Error error; - TT_String* name = 0; + FT_Byte* bytes; + FT_ULong byte_len; + FT_Error error; + FT_String* name = 0; error = T2_Access_Element( index, element, &bytes, &byte_len ); @@ -283,8 +283,8 @@ #if 0 /* unused until we fully support pure-CFF fonts */ LOCAL_FUNC - TT_String* T2_Get_String( CFF_Index* index, - TT_UInt sid, + FT_String* T2_Get_String( CFF_Index* index, + FT_UInt sid, PSNames_Interface* interface ) { /* if it is not a standard string, return it */ @@ -293,18 +293,18 @@ /* that's a standard string, fetch a copy from the PSName module */ { - TT_String* name = 0; + FT_String* name = 0; const char* adobe_name = interface->adobe_std_strings( sid ); - TT_UInt len; + FT_UInt len; if ( adobe_name ) { FT_Memory memory = index->stream->memory; - TT_Error error; + FT_Error error; - len = (TT_UInt)strlen( adobe_name ); + len = (FT_UInt)strlen( adobe_name ); if ( !ALLOC( name, len + 1 ) ) { MEM_Copy( name, adobe_name, len ); @@ -321,7 +321,7 @@ LOCAL_FUNC FT_Error T2_Load_CFF_Font( FT_Stream stream, - TT_Int face_index, + FT_Int face_index, CFF_Font* font ) { static const FT_Frame_Field cff_header_fields[] = @@ -382,8 +382,8 @@ if ( face_index >= 0 ) { T2_Parser parser; - TT_Byte* dict; - TT_ULong dict_len; + FT_Byte* dict; + FT_ULong dict_len; CFF_Index* index = &font->top_dict_index; CFF_Top_Dict* top = &font->top_dict; @@ -419,8 +419,8 @@ priv->blue_shift = 7; priv->blue_fuzz = 1; priv->lenIV = -1; - priv->expansion_factor = (TT_Fixed)0.06 * 0x10000L; - priv->blue_scale = (TT_Fixed)0.039625 * 0x10000L; + priv->expansion_factor = (FT_Fixed)0.06 * 0x10000L; + priv->blue_scale = (FT_Fixed)0.039625 * 0x10000L; T2_Parser_Init( &parser, T2CODE_PRIVATE, priv ); @@ -429,8 +429,8 @@ goto Exit; error = T2_Parser_Run( &parser, - (TT_Byte*)stream->cursor, - (TT_Byte*)stream->limit ); + (FT_Byte*)stream->cursor, + (FT_Byte*)stream->limit ); FORGET_Frame(); if ( error ) goto Exit; diff --git a/src/cff/t2load.h b/src/cff/t2load.h index b388f988f..05244e0d1 100644 --- a/src/cff/t2load.h +++ b/src/cff/t2load.h @@ -32,25 +32,25 @@ #if 0 /* will be used later for pure-CFF font support */ LOCAL_DEF - TT_String* T2_Get_String( CFF_Index* index, - TT_UInt sid, + FT_String* T2_Get_String( CFF_Index* index, + FT_UInt sid, PSNames_Interface* interface ); #endif LOCAL_DEF - TT_Error T2_Access_Element( CFF_Index* index, - TT_UInt element, - TT_Byte** pbytes, - TT_ULong* pbyte_len ); + FT_Error T2_Access_Element( CFF_Index* index, + FT_UInt element, + FT_Byte** pbytes, + FT_ULong* pbyte_len ); LOCAL_DEF void T2_Forget_Element( CFF_Index* index, - TT_Byte** pbytes ); + FT_Byte** pbytes ); LOCAL_DEF - TT_Error T2_Load_CFF_Font( FT_Stream stream, - TT_Int face_index, + FT_Error T2_Load_CFF_Font( FT_Stream stream, + FT_Int face_index, CFF_Font* font ); LOCAL_DEF diff --git a/src/cff/t2objs.c b/src/cff/t2objs.c index b85619f32..44826ee1d 100644 --- a/src/cff/t2objs.c +++ b/src/cff/t2objs.c @@ -77,7 +77,7 @@ FT_Int num_params, FT_Parameter* params ) { - TT_Error error; + FT_Error error; FT_Driver sfnt_driver; SFNT_Interface* sfnt; @@ -250,7 +250,7 @@ /* TrueType error code. 0 means success. */ /* */ LOCAL_DEF - TT_Error T2_Reset_Size( T2_Size size ) + FT_Error T2_Reset_Size( T2_Size size ) { T2_Face face = (T2_Face)size->face; FT_Size_Metrics* metrics = &size->metrics; @@ -291,7 +291,7 @@ /* TrueType error code. 0 means success. */ /* */ LOCAL_FUNC - TT_Error T2_Init_GlyphSlot( T2_GlyphSlot slot ) + FT_Error T2_Init_GlyphSlot( T2_GlyphSlot slot ) { FT_Library library = slot->root.face->driver->library; @@ -345,18 +345,9 @@ /* TrueType error code. 0 means success. */ /* */ LOCAL_FUNC - TT_Error T2_Init_Driver( T2_Driver driver ) + FT_Error T2_Init_Driver( T2_Driver driver ) { - FT_Memory memory = driver->root.memory; - FT_Error error; - - - error = FT_New_GlyphZone( memory, 0, 0, &driver->zone ); - if ( error ) - return error; - /* init extension registry if needed */ - #ifdef TT_CONFIG_OPTION_EXTEND_ENGINE return TT_Init_Extensions( driver ); #else @@ -380,13 +371,9 @@ void T2_Done_Driver( T2_Driver driver ) { /* destroy extensions registry if needed */ - #ifdef TT_CONFIG_OPTION_EXTEND_ENGINE TT_Done_Extensions( driver ); #endif - - /* remove the loading glyph zone */ - FT_Done_GlyphZone( &driver->zone ); } diff --git a/src/cff/t2objs.h b/src/cff/t2objs.h index 4672c9bf6..23e13a43f 100644 --- a/src/cff/t2objs.h +++ b/src/cff/t2objs.h @@ -66,14 +66,14 @@ { FT_GlyphSlotRec root; - TT_Bool hint; - TT_Bool scaled; + FT_Bool hint; + FT_Bool scaled; - TT_Int max_points; - TT_Int max_contours; + FT_Int max_points; + FT_Int max_contours; - TT_Fixed x_scale; - TT_Fixed y_scale; + FT_Fixed x_scale; + FT_Fixed y_scale; } T2_GlyphSlotRec, *T2_GlyphSlot; @@ -85,9 +85,9 @@ /* */ typedef struct T2_Transform_ { - TT_Fixed xx, xy; /* transformation matrix coefficients */ - TT_Fixed yx, yy; - TT_F26Dot6 ox, oy; /* offsets */ + FT_Fixed xx, xy; /* transformation matrix coefficients */ + FT_Fixed yx, yy; + FT_F26Dot6 ox, oy; /* offsets */ } T2_Transform; @@ -99,7 +99,6 @@ typedef struct T2_DriverRec_ { FT_DriverRec root; - FT_GlyphZone zone; /* glyph loader points zone */ void* extension_component; @@ -113,8 +112,8 @@ LOCAL_DEF FT_Error T2_Init_Face( FT_Stream stream, T2_Face face, - TT_Int face_index, - TT_Int num_params, + FT_Int face_index, + FT_Int num_params, FT_Parameter* params ); LOCAL_DEF @@ -132,7 +131,7 @@ void T2_Done_Size( T2_Size size ); LOCAL_DEF - TT_Error T2_Reset_Size( T2_Size size ); + FT_Error T2_Reset_Size( T2_Size size ); /*************************************************************************/ @@ -140,7 +139,7 @@ /* GlyphSlot functions */ /* */ LOCAL_DEF - TT_Error T2_Init_GlyphSlot( T2_GlyphSlot slot ); + FT_Error T2_Init_GlyphSlot( T2_GlyphSlot slot ); LOCAL_DEF void T2_Done_GlyphSlot( T2_GlyphSlot slot ); @@ -151,7 +150,7 @@ /* Driver functions */ /* */ LOCAL_DEF - TT_Error T2_Init_Driver( T2_Driver driver ); + FT_Error T2_Init_Driver( T2_Driver driver ); LOCAL_DEF void T2_Done_Driver( T2_Driver driver ); diff --git a/src/cff/t2parse.c b/src/cff/t2parse.c index 90659dca9..cab4d7200 100644 --- a/src/cff/t2parse.c +++ b/src/cff/t2parse.c @@ -49,24 +49,24 @@ /* now generate handlers for the most simple fields */ - typedef TT_Error (*T2_Field_Reader)( T2_Parser* parser ); + typedef FT_Error (*T2_Field_Reader)( T2_Parser* parser ); typedef struct T2_Field_Handler_ { int kind; int code; - TT_UInt offset; - TT_Byte size; + FT_UInt offset; + FT_Byte size; T2_Field_Reader reader; - TT_UInt array_max; - TT_UInt count_offset; + FT_UInt array_max; + FT_UInt count_offset; } T2_Field_Handler; LOCAL_FUNC void T2_Parser_Init( T2_Parser* parser, - TT_UInt code, + FT_UInt code, void* object ) { MEM_Set( parser, 0, sizeof ( *parser ) ); @@ -79,12 +79,12 @@ /* reads an integer */ static - TT_Long parse_t2_integer( TT_Byte* start, - TT_Byte* limit ) + FT_Long parse_t2_integer( FT_Byte* start, + FT_Byte* limit ) { - TT_Byte* p = start; - TT_Int v = *p++; - TT_Long val = 0; + FT_Byte* p = start; + FT_Int v = *p++; + FT_Long val = 0; if ( v == 28 ) @@ -92,7 +92,7 @@ if ( p + 2 > limit ) goto Bad; - val = (TT_Short)( ( (TT_Int)p[0] << 8 ) | p[1] ); + val = (FT_Short)( ( (FT_Int)p[0] << 8 ) | p[1] ); p += 2; } else if ( v == 29 ) @@ -100,9 +100,9 @@ if ( p + 4 > limit ) goto Bad; - val = ( (TT_Long)p[0] << 24 ) | - ( (TT_Long)p[1] << 16 ) | - ( (TT_Long)p[2] << 8 ) | p[3]; + val = ( (FT_Long)p[0] << 24 ) | + ( (FT_Long)p[1] << 16 ) | + ( (FT_Long)p[2] << 8 ) | p[3]; p += 4; } else if ( v < 247 ) @@ -137,15 +137,15 @@ /* reads a real */ static - TT_Fixed parse_t2_real( TT_Byte* start, - TT_Byte* limit, - TT_Int power_ten ) + FT_Fixed parse_t2_real( FT_Byte* start, + FT_Byte* limit, + FT_Int power_ten ) { - TT_Byte* p = start; - TT_Long num, divider, result, exp; - TT_Int sign = 0, exp_sign = 0; - TT_Byte nib; - TT_Byte phase; + FT_Byte* p = start; + FT_Long num, divider, result, exp; + FT_Int sign = 0, exp_sign = 0; + FT_Byte nib; + FT_Byte phase; result = 0; @@ -260,7 +260,7 @@ /* reads a number, either integer or real */ static - TT_Long t2_parse_num( TT_Byte** d ) + FT_Long t2_parse_num( FT_Byte** d ) { return ( **d == 30 ? ( parse_t2_real( d[0], d[1], 0 ) >> 16 ) : parse_t2_integer( d[0], d[1] ) ); @@ -269,7 +269,7 @@ /* reads a floating point number, either integer or real */ static - TT_Fixed t2_parse_fixed( TT_Byte** d ) + FT_Fixed t2_parse_fixed( FT_Byte** d ) { return ( **d == 30 ? parse_t2_real( d[0], d[1], 0 ) : parse_t2_integer( d[0], d[1] ) << 16 ); @@ -277,12 +277,12 @@ static - TT_Error parse_font_matrix( T2_Parser* parser ) + FT_Error parse_font_matrix( T2_Parser* parser ) { CFF_Top_Dict* dict = (CFF_Top_Dict*)parser->object; - TT_Matrix* matrix = &dict->font_matrix; - TT_Byte** data = parser->stack; - TT_Error error; + FT_Matrix* matrix = &dict->font_matrix; + FT_Byte** data = parser->stack; + FT_Error error; error = T2_Err_Stack_Underflow; @@ -301,12 +301,12 @@ static - TT_Error parse_font_bbox( T2_Parser* parser ) + FT_Error parse_font_bbox( T2_Parser* parser ) { CFF_Top_Dict* dict = (CFF_Top_Dict*)parser->object; FT_BBox* bbox = &dict->font_bbox; - TT_Byte** data = parser->stack; - TT_Error error; + FT_Byte** data = parser->stack; + FT_Error error; error = T2_Err_Stack_Underflow; @@ -325,11 +325,11 @@ static - TT_Error parse_private_dict( T2_Parser* parser ) + FT_Error parse_private_dict( T2_Parser* parser ) { CFF_Top_Dict* dict = (CFF_Top_Dict*)parser->object; - TT_Byte** data = parser->stack; - TT_Error error; + FT_Byte** data = parser->stack; + FT_Error error; error = T2_Err_Stack_Underflow; @@ -346,20 +346,20 @@ static - TT_Error parse_cid_ros( T2_Parser* parser ) + FT_Error parse_cid_ros( T2_Parser* parser ) { CFF_Top_Dict* dict = (CFF_Top_Dict*)parser->object; - TT_Byte** data = parser->stack; - TT_Error error; + FT_Byte** data = parser->stack; + FT_Error error; error = T2_Err_Stack_Underflow; if ( parser->top >= parser->stack + 3 ) { - dict->cid_registry = (TT_UInt)t2_parse_num( data++ ); - dict->cid_ordering = (TT_UInt)t2_parse_num( data++ ); - dict->cid_supplement = (TT_ULong)t2_parse_num( data ); + dict->cid_registry = (FT_UInt)t2_parse_num( data++ ); + dict->cid_ordering = (FT_UInt)t2_parse_num( data++ ); + dict->cid_supplement = (FT_ULong)t2_parse_num( data ); error = 0; } @@ -393,7 +393,7 @@ { \ kind, \ code | T2CODE, \ - (TT_UInt)(char*)&T2_REF( T2TYPE, name ), \ + (FT_UInt)(char*)&T2_REF( T2TYPE, name ), \ sizeof( T2_REF( T2TYPE, name ) ), \ 0 \ }, @@ -403,11 +403,11 @@ { \ t2_kind_delta, \ code | T2CODE, \ - (TT_UInt)(char*)&T2_REF( T2TYPE, name ), \ + (FT_UInt)(char*)&T2_REF( T2TYPE, name ), \ sizeof( T2_REF( T2TYPE, name ) ), \ 0, \ max, \ - (TT_UInt)(char*)&T2_REF( T2TYPE, num_ ## name ) \ + (FT_UInt)(char*)&T2_REF( T2TYPE, num_ ## name ) \ }, #define T2CODE_TOPDICT 0x1000 @@ -421,12 +421,12 @@ LOCAL_FUNC - TT_Error T2_Parser_Run( T2_Parser* parser, - TT_Byte* start, - TT_Byte* limit ) + FT_Error T2_Parser_Run( T2_Parser* parser, + FT_Byte* start, + FT_Byte* limit ) { - TT_Byte* p = start; - TT_Error error = 0; + FT_Byte* p = start; + FT_Error error = 0; parser->top = parser->stack; @@ -436,7 +436,7 @@ while ( p < limit ) { - TT_Byte v = *p; + FT_Byte v = *p; if ( v >= 27 && v != 31 ) @@ -477,8 +477,8 @@ /* this is not a number, hence it's an operator. Compute its code */ /* and look for it in our current list. */ - TT_UInt code; - TT_Int num_args = parser->top - parser->stack; + FT_UInt code; + FT_Int num_args = parser->top - parser->stack; const T2_Field_Handler* field; @@ -501,8 +501,8 @@ if ( field->code == code ) { /* we found our field's handler; read it */ - TT_Long val; - TT_Byte* q = (TT_Byte*)parser->object + field->offset; + FT_Long val; + FT_Byte* q = (FT_Byte*)parser->object + field->offset; switch ( field->kind ) @@ -520,30 +520,30 @@ switch ( field->size ) { case 1: - *(TT_Byte*)q = (TT_Byte)val; + *(FT_Byte*)q = (FT_Byte)val; break; case 2: - *(TT_Short*)q = (TT_Short)val; + *(FT_Short*)q = (FT_Short)val; break; default: - *(TT_Long*)q = val; + *(FT_Long*)q = val; } break; case t2_kind_delta: { - TT_Byte* qcount = (TT_Byte*)parser->object + + FT_Byte* qcount = (FT_Byte*)parser->object + field->count_offset; - TT_Long val; - TT_Byte** data = parser->stack; + FT_Long val; + FT_Byte** data = parser->stack; if ( num_args > field->array_max ) num_args = field->array_max; /* store count */ - *qcount = (TT_Byte)num_args; + *qcount = (FT_Byte)num_args; val = 0; while ( num_args > 0 ) @@ -552,13 +552,13 @@ switch ( field->size ) { case 1: - *(TT_Byte*)q = (TT_Byte)val; + *(FT_Byte*)q = (FT_Byte)val; break; case 2: - *(TT_Short*)q = (TT_Short)val; + *(FT_Short*)q = (FT_Short)val; break; default: - *(TT_Long*)q = val; + *(FT_Long*)q = val; } q += field->size; diff --git a/src/cff/t2parse.h b/src/cff/t2parse.h index 2e6325570..2238444b7 100644 --- a/src/cff/t2parse.h +++ b/src/cff/t2parse.h @@ -35,14 +35,14 @@ typedef struct T2_Parser_ { - TT_Byte* start; - TT_Byte* limit; - TT_Byte* cursor; + FT_Byte* start; + FT_Byte* limit; + FT_Byte* cursor; - TT_Byte* stack[T2_MAX_STACK_DEPTH + 1]; - TT_Byte** top; + FT_Byte* stack[T2_MAX_STACK_DEPTH + 1]; + FT_Byte** top; - TT_UInt object_code; + FT_UInt object_code; void* object; } T2_Parser; @@ -50,13 +50,13 @@ LOCAL_DEF void T2_Parser_Init( T2_Parser* parser, - TT_UInt code, + FT_UInt code, void* object ); LOCAL_DEF - TT_Error T2_Parser_Run( T2_Parser* parser, - TT_Byte* start, - TT_Byte* limit ); + FT_Error T2_Parser_Run( T2_Parser* parser, + FT_Byte* start, + FT_Byte* limit ); #ifdef __cplusplus diff --git a/src/cid/cidafm.c b/src/cid/cidafm.c index 7a4145f1d..bbd5a8ccc 100644 --- a/src/cid/cidafm.c +++ b/src/cid/cidafm.c @@ -55,13 +55,13 @@ /* read a glyph name and return the equivalent glyph index */ static - T1_UInt afm_atoindex( T1_Byte** start, - T1_Byte* limit, + FT_UInt afm_atoindex( FT_Byte** start, + FT_Byte* limit, T1_Font* type1 ) { - T1_Byte* p = *start; - T1_Int len; - T1_UInt result = 0; + FT_Byte* p = *start; + FT_Int len; + FT_UInt result = 0; char temp[64]; @@ -79,7 +79,7 @@ if ( len > 0 && len < 64 ) { - T1_Int n; + FT_Int n; /* copy glyph name to intermediate array */ @@ -106,10 +106,10 @@ /* read an integer */ static - int afm_atoi( T1_Byte** start, - T1_Byte* limit ) + int afm_atoi( FT_Byte** start, + FT_Byte* limit ) { - T1_Byte* p = *start; + FT_Byte* p = *start; int sum = 0; int sign = 1; @@ -136,7 +136,7 @@ #undef KERN_INDEX -#define KERN_INDEX( g1, g2 ) ( ( (T1_ULong)g1 << 16 ) | g2 ) +#define KERN_INDEX( g1, g2 ) ( ( (FT_ULong)g1 << 16 ) | g2 ) /* compare two kerning pairs */ @@ -147,8 +147,8 @@ T1_Kern_Pair* pair1 = (T1_Kern_Pair*)a; T1_Kern_Pair* pair2 = (T1_Kern_Pair*)b; - T1_ULong index1 = KERN_INDEX( pair1->glyph1, pair1->glyph2 ); - T1_ULong index2 = KERN_INDEX( pair2->glyph1, pair2->glyph2 ); + FT_ULong index1 = KERN_INDEX( pair1->glyph1, pair1->glyph2 ); + FT_ULong index2 = KERN_INDEX( pair2->glyph1, pair2->glyph2 ); return ( index1 - index2 ); @@ -157,15 +157,15 @@ /* parse an AFM file - for now, only read the kerning pairs */ LOCAL_FUNC - T1_Error CID_Read_AFM( FT_Face t1_face, + FT_Error CID_Read_AFM( FT_Face t1_face, FT_Stream stream ) { - T1_Error error; + FT_Error error; FT_Memory memory = stream->memory; - T1_Byte* start; - T1_Byte* limit; - T1_Byte* p; - T1_Int count = 0; + FT_Byte* start; + FT_Byte* limit; + FT_Byte* p; + FT_Int count = 0; T1_Kern_Pair* pair; T1_Font* type1 = &((T1_Face)t1_face)->type1; T1_AFM* afm = 0; @@ -174,8 +174,8 @@ if ( ACCESS_Frame( stream->size ) ) return error; - start = (T1_Byte*)stream->cursor; - limit = (T1_Byte*)stream->limit; + start = (FT_Byte*)stream->cursor; + limit = (FT_Byte*)stream->limit; p = start; /* we are now going to count the occurences of "KP" or "KPX" in */ @@ -207,7 +207,7 @@ { if ( IS_KERN_PAIR( p ) ) { - T1_Byte* q; + FT_Byte* q; /* skip keyword (KP or KPX) */ @@ -244,12 +244,12 @@ /* find the kerning for a given glyph pair */ LOCAL_FUNC void CID_Get_Kerning( T1_AFM* afm, - T1_UInt glyph1, - T1_UInt glyph2, - T1_Vector* kerning ) + FT_UInt glyph1, + FT_UInt glyph2, + FT_Vector* kerning ) { T1_Kern_Pair *min, *mid, *max; - T1_ULong index = KERN_INDEX( glyph1, glyph2 ); + FT_ULong index = KERN_INDEX( glyph1, glyph2 ); /* simple binary search */ @@ -258,7 +258,7 @@ while ( min <= max ) { - T1_ULong midi; + FT_ULong midi; mid = min + ( max - min ) / 2; diff --git a/src/cid/cidafm.h b/src/cid/cidafm.h index 9c795780d..89d47f2eb 100644 --- a/src/cid/cidafm.h +++ b/src/cid/cidafm.h @@ -23,15 +23,15 @@ typedef struct T1_Kern_Pair_ { - T1_UInt glyph1; - T1_UInt glyph2; - T1_Vector kerning; + FT_UInt glyph1; + FT_UInt glyph2; + FT_Vector kerning; } T1_Kern_Pair; typedef struct T1_AFM_ { - T1_Int num_pairs; + FT_Int num_pairs; T1_Kern_Pair* kern_pairs; } T1_AFM; @@ -40,7 +40,7 @@ #if 0 LOCAL_DEF -T1_Error CID_Read_AFM( FT_Face face, +FT_Error CID_Read_AFM( FT_Face face, FT_Stream stream ); LOCAL_DEF @@ -49,9 +49,9 @@ void CID_Done_AFM( FT_Memory memory, LOCAL_DEF void CID_Get_Kerning( T1_AFM* afm, - T1_UInt glyph1, - T1_UInt glyph2, - T1_Vector* kerning ); + FT_UInt glyph1, + FT_UInt glyph2, + FT_Vector* kerning ); #endif diff --git a/src/cid/cidgload.c b/src/cid/cidgload.c index 981937bd0..99ff5c111 100644 --- a/src/cid/cidgload.c +++ b/src/cid/cidgload.c @@ -34,8 +34,8 @@ /* forward */ static - T1_Error cid_load_glyph( CID_Decoder* decoder, - T1_UInt glyph_index ); + FT_Error cid_load_glyph( CID_Decoder* decoder, + FT_UInt glyph_index ); typedef enum T1_Operator_ @@ -76,7 +76,7 @@ } T1_Operator; - static const T1_Int t1_args_count[op_max] = + static const FT_Int t1_args_count[op_max] = { 0, /* none */ 0, /* endchar */ @@ -233,8 +233,8 @@ /* check that there is enough room for `count' more points */ static - T1_Error check_points( CID_Builder* builder, - T1_Int count ) + FT_Error check_points( CID_Builder* builder, + FT_Int count ) { FT_Outline* base = &builder->base; FT_Outline* outline = &builder->current; @@ -248,20 +248,20 @@ /* realloc points table if necessary */ if ( count >= builder->max_points ) { - T1_Error error; + FT_Error error; FT_Memory memory = builder->memory; - T1_Int increment = outline->points - base->points; - T1_Int current = builder->max_points; + FT_Int increment = outline->points - base->points; + FT_Int current = builder->max_points; while ( builder->max_points < count ) builder->max_points += 8; if ( REALLOC_ARRAY( base->points, current, - builder->max_points, T1_Vector ) || + builder->max_points, FT_Vector ) || REALLOC_ARRAY( base->tags, current, - builder->max_points, T1_Byte ) ) + builder->max_points, FT_Byte ) ) { builder->error = error; return error; @@ -278,17 +278,17 @@ /* add a new point, do not check space */ static void add_point( CID_Builder* builder, - T1_Pos x, - T1_Pos y, - T1_Byte flag ) + FT_Pos x, + FT_Pos y, + FT_Byte flag ) { FT_Outline* outline = &builder->current; if ( builder->load_points ) { - T1_Vector* point = outline->points + outline->n_points; - T1_Byte* control = (FT_Byte*)outline->tags + outline->n_points; + FT_Vector* point = outline->points + outline->n_points; + FT_Byte* control = (FT_Byte*)outline->tags + outline->n_points; point->x = x; @@ -304,11 +304,11 @@ /* check room for a new on-curve point, then add it */ static - T1_Error add_point1( CID_Builder* builder, - T1_Pos x, - T1_Pos y ) + FT_Error add_point1( CID_Builder* builder, + FT_Pos x, + FT_Pos y ) { - T1_Error error; + FT_Error error; error = check_points( builder, 1 ); @@ -321,7 +321,7 @@ /* check room for a new contour, then add it */ static - T1_Error add_contour( CID_Builder* builder ) + FT_Error add_contour( CID_Builder* builder ) { FT_Outline* base = &builder->base; FT_Outline* outline = &builder->current; @@ -337,16 +337,16 @@ if ( base->n_contours + outline->n_contours >= builder->max_contours && builder->load_points ) { - T1_Error error; + FT_Error error; FT_Memory memory = builder->memory; - T1_Int increment = outline->contours - base->contours; - T1_Int current = builder->max_contours; + FT_Int increment = outline->contours - base->contours; + FT_Int current = builder->max_contours; builder->max_contours += 4; if ( REALLOC_ARRAY( base->contours, - current, builder->max_contours, T1_Short ) ) + current, builder->max_contours, FT_Short ) ) { builder->error = error; return error; @@ -366,14 +366,14 @@ /* if a path was begun, add its first on-curve point */ static - T1_Error start_point( CID_Builder* builder, - T1_Pos x, - T1_Pos y ) + FT_Error start_point( CID_Builder* builder, + FT_Pos x, + FT_Pos y ) { /* test whether we are building a new contour */ if ( !builder->path_begun ) { - T1_Error error; + FT_Error error; builder->path_begun = 1; @@ -420,11 +420,11 @@ /* glyph wasn't found. */ /* */ static - T1_Int lookup_glyph_by_stdcharcode( CID_Face face, - T1_Int charcode ) + FT_Int lookup_glyph_by_stdcharcode( CID_Face face, + FT_Int charcode ) { - T1_Int n; - const T1_String* glyph_name; + FT_Int n; + const FT_String* glyph_name; PSNames_Interface* psnames = (PSNames_Interface*)face->psnames; @@ -437,7 +437,7 @@ for ( n = 0; n < face->cid.cid_count; n++ ) { - T1_String* name = (T1_String*)face->type1.glyph_names[n]; + FT_String* name = (FT_String*)face->type1.glyph_names[n]; if ( name && strcmp( name, glyph_name ) == 0 ) @@ -477,17 +477,17 @@ /* */ static FT_Error t1operator_seac( CID_Decoder* decoder, - T1_Pos asb, - T1_Pos adx, - T1_Pos ady, - T1_Int bchar, - T1_Int achar ) + FT_Pos asb, + FT_Pos adx, + FT_Pos ady, + FT_Int bchar, + FT_Int achar ) { - T1_Error error; - T1_Int bchar_index, achar_index, n_base_points; + FT_Error error; + FT_Int bchar_index, achar_index, n_base_points; FT_Outline* cur = &decoder->builder.current; FT_Outline* base = &decoder->builder.base; - T1_Vector left_bearing, advance; + FT_Vector left_bearing, advance; bchar_index = bchar; @@ -582,7 +582,7 @@ /* adjust contours in accented character outline */ if ( decoder->builder.load_points ) { - T1_Int n; + FT_Int n; for ( n = 0; n < cur->n_contours; n++ ) @@ -629,17 +629,17 @@ /* Type1 error code. 0 means success. */ /* */ LOCAL_FUNC - T1_Error CID_Parse_CharStrings( CID_Decoder* decoder, - T1_Byte* charstring_base, - T1_Int charstring_len ) + FT_Error CID_Parse_CharStrings( CID_Decoder* decoder, + FT_Byte* charstring_base, + FT_Int charstring_len ) { - T1_Error error; + FT_Error error; CID_Decoder_Zone* zone; - T1_Byte* ip; - T1_Byte* limit; + FT_Byte* ip; + FT_Byte* limit; CID_Builder* builder = &decoder->builder; FT_Outline* outline; - T1_Pos x, y; + FT_Pos x, y; /* First of all, initialize the decoder */ @@ -662,9 +662,9 @@ /* now, execute loop */ while ( ip < limit ) { - T1_Int* top = decoder->top; + FT_Int* top = decoder->top; T1_Operator op = op_none; - T1_Long value = 0; + FT_Long value = 0; /********************************************************************/ @@ -851,7 +851,7 @@ case 2: /* add flex vectors ------------------------ */ { - T1_Int index; + FT_Int index; if ( top[0] != 0 ) @@ -865,7 +865,7 @@ add_point( builder, x, y, - (T1_Byte)( index==3 || index==6 ) ); + (FT_Byte)( index==3 || index==6 ) ); } break; @@ -930,9 +930,9 @@ case 18: /* multiple masters */ { T1_Blend* blend = decoder->blend; - T1_UInt num_points, nn, mm; - T1_Int* delta; - T1_Int* values; + FT_UInt num_points, nn, mm; + FT_Int* delta; + FT_Int* values; if ( !blend ) { @@ -971,7 +971,7 @@ values = top; for ( nn = 0; nn < num_points; nn++ ) { - T1_Int x = values[0]; + FT_Int x = values[0]; for ( mm = 1; mm < blend->num_designs; mm++ ) @@ -995,7 +995,7 @@ } else /* general operator */ { - T1_Int num_args = t1_args_count[op]; + FT_Int num_args = t1_args_count[op]; if ( top - decoder->stack < num_args ) @@ -1190,7 +1190,7 @@ case op_callsubr: { - T1_Int index; + FT_Int index; FT_TRACE4(( " callsubr" )); @@ -1329,12 +1329,12 @@ LOCAL_FUNC - T1_Error CID_Compute_Max_Advance( CID_Face face, - T1_Int* max_advance ) + FT_Error CID_Compute_Max_Advance( CID_Face face, + FT_Int* max_advance ) { - T1_Error error; + FT_Error error; CID_Decoder decoder; - T1_Int glyph_index; + FT_Int glyph_index; *max_advance = 0; @@ -1382,17 +1382,17 @@ static - T1_Error cid_load_glyph( CID_Decoder* decoder, - T1_UInt glyph_index ) + FT_Error cid_load_glyph( CID_Decoder* decoder, + FT_UInt glyph_index ) { CID_Face face = decoder->builder.face; CID_Info* cid = &face->cid; - T1_Byte* p; - T1_UInt entry_len = cid->fd_bytes + cid->gd_bytes; - T1_UInt fd_select; - T1_ULong off1, glyph_len; + FT_Byte* p; + FT_UInt entry_len = cid->fd_bytes + cid->gd_bytes; + FT_UInt fd_select; + FT_ULong off1, glyph_len; FT_Stream stream = face->root.stream; - T1_Error error = 0; + FT_Error error = 0; /* read the CID font dict index and charstring offset from the CIDMap */ @@ -1401,9 +1401,9 @@ ACCESS_Frame( 2 * entry_len ) ) goto Exit; - p = (T1_Byte*)stream->cursor; - fd_select = (T1_UInt) cid_get_offset( &p, cid->fd_bytes ); - off1 = (T1_ULong)cid_get_offset( &p, cid->gd_bytes ); + p = (FT_Byte*)stream->cursor; + fd_select = (FT_UInt) cid_get_offset( &p, cid->fd_bytes ); + off1 = (FT_ULong)cid_get_offset( &p, cid->gd_bytes ); p += cid->fd_bytes; glyph_len = cid_get_offset( &p, cid->gd_bytes ) - off1; @@ -1414,8 +1414,8 @@ if ( glyph_len > 0 ) { CID_FontDict* dict; - T1_Byte* charstring; - T1_UInt lenIV; + FT_Byte* charstring; + FT_UInt lenIV; FT_Memory memory = face->root.memory; @@ -1452,15 +1452,15 @@ LOCAL_FUNC - T1_Error CID_Load_Glyph( T1_GlyphSlot glyph, + FT_Error CID_Load_Glyph( T1_GlyphSlot glyph, T1_Size size, - T1_Int glyph_index, - T1_Int load_flags ) + FT_Int glyph_index, + FT_Int load_flags ) { - T1_Error error; + FT_Error error; CID_Decoder decoder; CID_Face face = (CID_Face)glyph->root.face; - T1_Bool hinting; + FT_Bool hinting; if ( load_flags & FT_LOAD_NO_RECURSE ) @@ -1534,11 +1534,11 @@ if ( ( load_flags & FT_LOAD_NO_SCALE ) == 0 ) { /* scale the outline and the metrics */ - T1_Int n; + FT_Int n; FT_Outline* cur = &decoder.builder.base; - T1_Vector* vec = cur->points; - T1_Fixed x_scale = glyph->x_scale; - T1_Fixed y_scale = glyph->y_scale; + FT_Vector* vec = cur->points; + FT_Fixed x_scale = glyph->x_scale; + FT_Fixed y_scale = glyph->y_scale; /* First of all, scale the points */ diff --git a/src/cid/cidgload.h b/src/cid/cidgload.h index 7bf44ebf5..408908928 100644 --- a/src/cid/cidgload.h +++ b/src/cid/cidgload.h @@ -87,27 +87,27 @@ FT_Outline current; /* the current glyph outline */ FT_Outline base; /* the composite glyph outline */ - T1_Int max_points; /* capacity of base outline in points */ - T1_Int max_contours; /* capacity of base outline in contours */ + FT_Int max_points; /* capacity of base outline in points */ + FT_Int max_contours; /* capacity of base outline in contours */ - T1_Vector last; + FT_Vector last; - T1_Fixed scale_x; - T1_Fixed scale_y; + FT_Fixed scale_x; + FT_Fixed scale_y; - T1_Pos pos_x; - T1_Pos pos_y; + FT_Pos pos_x; + FT_Pos pos_y; - T1_Vector left_bearing; - T1_Vector advance; + FT_Vector left_bearing; + FT_Vector advance; - T1_BBox bbox; /* bounding box */ - T1_Bool path_begun; - T1_Bool load_points; - T1_Bool no_recurse; + FT_BBox bbox; /* bounding box */ + FT_Bool path_begun; + FT_Bool load_points; + FT_Bool no_recurse; - T1_Error error; /* only used for memory errors */ - T1_Bool metrics_only; + FT_Error error; /* only used for memory errors */ + FT_Bool metrics_only; } CID_Builder; @@ -116,9 +116,9 @@ typedef struct CID_Decoder_Zone_ { - T1_Byte* base; - T1_Byte* limit; - T1_Byte* cursor; + FT_Byte* base; + FT_Byte* limit; + FT_Byte* cursor; } CID_Decoder_Zone; @@ -127,19 +127,19 @@ { CID_Builder builder; - T1_Int stack[T1_MAX_CHARSTRINGS_OPERANDS]; - T1_Int* top; + FT_Int stack[T1_MAX_CHARSTRINGS_OPERANDS]; + FT_Int* top; CID_Decoder_Zone zones[T1_MAX_SUBRS_CALLS + 1]; CID_Decoder_Zone* zone; - T1_Matrix font_matrix; + FT_Matrix font_matrix; CID_Subrs* subrs; - T1_UInt lenIV; + FT_UInt lenIV; - T1_Int flex_state; - T1_Int num_flex_vectors; - T1_Vector flex_vectors[7]; + FT_Int flex_state; + FT_Int num_flex_vectors; + FT_Vector flex_vectors[7]; } CID_Decoder; @@ -162,22 +162,22 @@ /* Compute the maximum advance width of a font through quick parsing */ LOCAL_DEF - T1_Error CID_Compute_Max_Advance( CID_Face face, - T1_Int* max_advance ); + FT_Error CID_Compute_Max_Advance( CID_Face face, + FT_Int* max_advance ); #endif /* This function is exported, because it is used by the T1Dump utility */ LOCAL_DEF - T1_Error CID_Parse_CharStrings( CID_Decoder* decoder, - T1_Byte* charstring_base, - T1_Int charstring_len ); + FT_Error CID_Parse_CharStrings( CID_Decoder* decoder, + FT_Byte* charstring_base, + FT_Int charstring_len ); LOCAL_DEF - T1_Error CID_Load_Glyph( T1_GlyphSlot glyph, + FT_Error CID_Load_Glyph( T1_GlyphSlot glyph, T1_Size size, - T1_Int glyph_index, - T1_Int load_flags ); + FT_Int glyph_index, + FT_Int load_flags ); #ifdef __cplusplus diff --git a/src/cid/cidload.c b/src/cid/cidload.c index 9dc6f4a6e..8bf4aa92d 100644 --- a/src/cid/cidload.c +++ b/src/cid/cidload.c @@ -40,11 +40,11 @@ /* read a single offset */ LOCAL_FUNC - T1_Long cid_get_offset( T1_Byte** start, - T1_Byte offsize ) + FT_Long cid_get_offset( FT_Byte** start, + FT_Byte offsize ) { - T1_Long result; - T1_Byte* p = *start; + FT_Long result; + FT_Byte* p = *start; for ( result = 0; offsize > 0; offsize-- ) @@ -56,13 +56,13 @@ LOCAL_FUNC - void cid_decrypt( T1_Byte* buffer, - T1_Int length, - T1_UShort seed ) + void cid_decrypt( FT_Byte* buffer, + FT_Int length, + FT_UShort seed ) { while ( length > 0 ) { - T1_Byte plain; + FT_Byte plain; plain = ( *buffer ^ ( seed >> 8 ) ); @@ -83,13 +83,13 @@ static - T1_Error cid_load_keyword( CID_Face face, + FT_Error cid_load_keyword( CID_Face face, CID_Loader* loader, const T1_Field_Rec* keyword ) { - T1_Error error; + FT_Error error; CID_Parser* parser = &loader->parser; - T1_Byte* object; + FT_Byte* object; CID_Info* cid = &face->cid; @@ -104,11 +104,11 @@ switch ( keyword->location ) { case t1_field_cid_info: - object = (T1_Byte*)cid; + object = (FT_Byte*)cid; break; case t1_field_font_info: - object = (T1_Byte*)&cid->font_info; + object = (FT_Byte*)&cid->font_info; break; default: @@ -128,11 +128,11 @@ switch ( keyword->location ) { case t1_field_private: - object = (T1_Byte*)&dict->private_dict; + object = (FT_Byte*)&dict->private_dict; break; default: - object = (T1_Byte*)dict; + object = (FT_Byte*)dict; } } } @@ -150,11 +150,11 @@ static - T1_Error parse_font_bbox( CID_Face face, + FT_Error parse_font_bbox( CID_Face face, CID_Parser* parser ) { - T1_Short temp[4]; - T1_BBox* bbox = &face->cid.font_bbox; + FT_Short temp[4]; + FT_BBox* bbox = &face->cid.font_bbox; (void)CID_ToCoordArray( parser, 4, temp ); @@ -169,12 +169,12 @@ static - T1_Error parse_font_matrix( CID_Face face, + FT_Error parse_font_matrix( CID_Face face, CID_Parser* parser ) { - T1_Matrix* matrix; + FT_Matrix* matrix; CID_FontDict* dict; - T1_Fixed temp[4]; + FT_Fixed temp[4]; if ( parser->num_dict >= 0 ) @@ -195,26 +195,26 @@ static - T1_Error parse_fd_array( CID_Face face, + FT_Error parse_fd_array( CID_Face face, CID_Parser* parser ) { CID_Info* cid = &face->cid; FT_Memory memory = face->root.memory; - T1_Error error = T1_Err_Ok; - T1_Long num_dicts; + FT_Error error = T1_Err_Ok; + FT_Long num_dicts; num_dicts = CID_ToInt( parser ); if ( !cid->font_dicts ) { - T1_Int n; + FT_Int n; if ( ALLOC_ARRAY( cid->font_dicts, num_dicts, CID_FontDict ) ) goto Exit; - cid->num_dicts = (T1_UInt)num_dicts; + cid->num_dicts = (FT_UInt)num_dicts; /* don't forget to set a few defaults */ for ( n = 0; n < cid->num_dicts; n++ ) @@ -252,7 +252,7 @@ static void skip_whitespace( CID_Parser* parser ) { - T1_Byte* cur = parser->cursor; + FT_Byte* cur = parser->cursor; while ( cur < parser->limit && isspace( *cur ) ) @@ -263,10 +263,10 @@ static - T1_Error parse_dict( CID_Face face, + FT_Error parse_dict( CID_Face face, CID_Loader* loader, - T1_Byte* base, - T1_Long size ) + FT_Byte* base, + FT_Long size ) { CID_Parser* parser = &loader->parser; @@ -276,8 +276,8 @@ parser->error = 0; { - T1_Byte* cur = base; - T1_Byte* limit = cur + size; + FT_Byte* cur = base; + FT_Byte* limit = cur + size; for ( ;cur < limit; cur++ ) @@ -296,8 +296,8 @@ /* look for immediates */ else if ( *cur == '/' && cur + 2 < limit ) { - T1_Byte* cur2; - T1_Int len; + FT_Byte* cur2; + FT_Int len; cur++; @@ -315,17 +315,17 @@ for (;;) { - T1_Byte* name; + FT_Byte* name; - name = (T1_Byte*)keyword->ident; + name = (FT_Byte*)keyword->ident; if ( !name ) break; if ( cur[0] == name[0] && - len == (T1_Int)strlen( (const char*)name ) ) + len == (FT_Int)strlen( (const char*)name ) ) { - T1_Int n; + FT_Int n; for ( n = 1; n < len; n++ ) @@ -357,16 +357,16 @@ /* read the subrmap and the subrs of each font dict */ static - T1_Error cid_read_subrs( CID_Face face ) + FT_Error cid_read_subrs( CID_Face face ) { CID_Info* cid = &face->cid; FT_Memory memory = face->root.memory; FT_Stream stream = face->root.stream; - T1_Error error; - T1_UInt n; + FT_Error error; + FT_UInt n; CID_Subrs* subr; - T1_UInt max_offsets = 0; - T1_ULong* offsets = 0; + FT_UInt max_offsets = 0; + FT_ULong* offsets = 0; if ( ALLOC_ARRAY( face->subrs, cid->num_dicts, CID_Subrs ) ) @@ -376,18 +376,18 @@ for ( n = 0; n < cid->num_dicts; n++, subr++ ) { CID_FontDict* dict = cid->font_dicts + n; - T1_UInt count, num_subrs = dict->num_subrs; - T1_ULong data_len; - T1_Byte* p; + FT_UInt count, num_subrs = dict->num_subrs; + FT_ULong data_len; + FT_Byte* p; /* reallocate offsets array if needed */ if ( num_subrs + 1 > max_offsets ) { - T1_UInt new_max = ( num_subrs + 1 + 3 ) & -4; + FT_UInt new_max = ( num_subrs + 1 + 3 ) & -4; - if ( REALLOC_ARRAY( offsets, max_offsets, new_max, T1_ULong ) ) + if ( REALLOC_ARRAY( offsets, max_offsets, new_max, FT_ULong ) ) goto Fail; max_offsets = new_max; @@ -408,7 +408,7 @@ /* allocate, and read them */ data_len = offsets[num_subrs] - offsets[0]; - if ( ALLOC_ARRAY( subr->code, num_subrs+1, T1_Byte* ) || + if ( ALLOC_ARRAY( subr->code, num_subrs+1, FT_Byte* ) || ALLOC( subr->code[0], data_len ) ) goto Fail; @@ -419,7 +419,7 @@ /* set up pointers */ for ( count = 1; count <= num_subrs; count++ ) { - T1_UInt len; + FT_UInt len; len = offsets[count] - offsets[count - 1]; @@ -429,7 +429,7 @@ /* decrypt subroutines */ for ( count = 0; count < num_subrs; count++ ) { - T1_UInt len; + FT_UInt len; len = offsets[count + 1] - offsets[count]; @@ -481,11 +481,11 @@ LOCAL_FUNC - T1_Error CID_Open_Face( CID_Face face ) + FT_Error CID_Open_Face( CID_Face face ) { CID_Loader loader; CID_Parser* parser; - T1_Error error; + FT_Error error; t1_init_loader( &loader, face ); diff --git a/src/cid/cidload.h b/src/cid/cidload.h index b90bb866c..dccfd386c 100644 --- a/src/cid/cidload.h +++ b/src/cid/cidload.h @@ -30,22 +30,22 @@ typedef struct CID_Loader_ { CID_Parser parser; /* parser used to read the stream */ - T1_Int num_chars; /* number of characters in encoding */ + FT_Int num_chars; /* number of characters in encoding */ } CID_Loader; LOCAL_DEF - T1_Long cid_get_offset( T1_Byte** start, - T1_Byte offsize ); + FT_Long cid_get_offset( FT_Byte** start, + FT_Byte offsize ); LOCAL_DEF - void cid_decrypt( T1_Byte* buffer, - T1_Int length, - T1_UShort seed ); + void cid_decrypt( FT_Byte* buffer, + FT_Int length, + FT_UShort seed ); LOCAL_DEF - T1_Error CID_Open_Face( CID_Face face ); + FT_Error CID_Open_Face( CID_Face face ); #ifdef __cplusplus diff --git a/src/cid/cidobjs.c b/src/cid/cidobjs.c index 0fa535c1b..495712b25 100644 --- a/src/cid/cidobjs.c +++ b/src/cid/cidobjs.c @@ -75,7 +75,7 @@ /* Type1 error code. 0 means success. */ /* */ LOCAL_DEF - T1_Error CID_Init_Size( T1_Size size ) + FT_Error CID_Init_Size( T1_Size size ) { size->valid = 0; @@ -99,7 +99,7 @@ /* Type1 error code. 0 means success. */ /* */ LOCAL_FUNC - T1_Error CID_Reset_Size( T1_Size size ) + FT_Error CID_Reset_Size( T1_Size size ) { /* recompute ascender, descender, etc. */ CID_Face face = (CID_Face)size->root.face; @@ -204,13 +204,13 @@ /* Type1 error code. 0 means success. */ /* */ LOCAL_FUNC - T1_Error CID_Init_Face( FT_Stream stream, + FT_Error CID_Init_Face( FT_Stream stream, CID_Face face, - T1_Int face_index, - T1_Int num_params, + FT_Int face_index, + FT_Int num_params, FT_Parameter* params ) { - T1_Error error; + FT_Error error; PSNames_Interface* psnames; UNUSED( num_params ); @@ -323,7 +323,7 @@ /* compute max advance width for proportional fonts */ if ( !face->type1.font_info.is_fixed_pitch ) { - T1_Int max_advance; + FT_Int max_advance; error = T1_Compute_Max_Advance( face, &max_advance ); @@ -461,7 +461,7 @@ /* Type1 error code. 0 means success. */ /* */ LOCAL_FUNC - T1_Error CID_Init_GlyphSlot( T1_GlyphSlot glyph ) + FT_Error CID_Init_GlyphSlot( T1_GlyphSlot glyph ) { FT_Library library = glyph->root.face->driver->library; @@ -489,7 +489,7 @@ /* Type1 error code. 0 means success. */ /* */ LOCAL_FUNC - T1_Error CID_Init_Driver( T1_Driver driver ) + FT_Error CID_Init_Driver( T1_Driver driver ) { UNUSED( driver ); diff --git a/src/cid/cidobjs.h b/src/cid/cidobjs.h index a0c4746f1..3db7558d5 100644 --- a/src/cid/cidobjs.h +++ b/src/cid/cidobjs.h @@ -94,7 +94,7 @@ typedef struct T1_SizeRec_ { FT_SizeRec root; - T1_Bool valid; + FT_Bool valid; T1_Size_Hints* hints; /* defined in the hinter. This allows */ /* us to experiment with different */ /* hinting schemes without having to */ @@ -107,14 +107,14 @@ { FT_GlyphSlotRec root; - T1_Bool hint; - T1_Bool scaled; + FT_Bool hint; + FT_Bool scaled; - T1_Int max_points; - T1_Int max_contours; + FT_Int max_points; + FT_Int max_contours; - T1_Fixed x_scale; - T1_Fixed y_scale; + FT_Fixed x_scale; + FT_Fixed y_scale; T1_Glyph_Hints* hints; /* defined in the hinter */ @@ -122,10 +122,10 @@ LOCAL_DEF - T1_Error CID_Init_Face( FT_Stream stream, + FT_Error CID_Init_Face( FT_Stream stream, CID_Face face, - T1_Int face_index, - T1_Int num_params, + FT_Int face_index, + FT_Int num_params, FT_Parameter* params ); LOCAL_DEF @@ -133,24 +133,24 @@ LOCAL_DEF - T1_Error CID_Init_Size( T1_Size size ); + FT_Error CID_Init_Size( T1_Size size ); LOCAL_DEF void CID_Done_Size( T1_Size size ); LOCAL_DEF - T1_Error CID_Reset_Size( T1_Size size ); + FT_Error CID_Reset_Size( T1_Size size ); LOCAL_DEF - T1_Error CID_Init_GlyphSlot( T1_GlyphSlot slot ); + FT_Error CID_Init_GlyphSlot( T1_GlyphSlot slot ); LOCAL_DEF void CID_Done_GlyphSlot( T1_GlyphSlot slot ); LOCAL_DEF - T1_Error CID_Init_Driver( T1_Driver driver ); + FT_Error CID_Init_Driver( T1_Driver driver ); LOCAL_DEF void CID_Done_Driver( T1_Driver driver ); diff --git a/src/cid/cidparse.c b/src/cid/cidparse.c index 89a7ffa63..e99f1f209 100644 --- a/src/cid/cidparse.c +++ b/src/cid/cidparse.c @@ -70,16 +70,16 @@ /* Type1 error code. 0 means success. */ /* */ LOCAL_FUNC - T1_Error T1_New_Table( T1_Table* table, - T1_Int count, + FT_Error T1_New_Table( T1_Table* table, + FT_Int count, FT_Memory memory ) { - T1_Error error; + FT_Error error; table->memory = memory; - if ( ALLOC_ARRAY( table->elements, count, T1_Byte* ) || - ALLOC_ARRAY( table->lengths, count, T1_Byte* ) ) + if ( ALLOC_ARRAY( table->elements, count, FT_Byte* ) || + ALLOC_ARRAY( table->lengths, count, FT_Byte* ) ) goto Exit; table->max_elems = count; @@ -99,11 +99,11 @@ static void shift_elements( T1_Table* table, - T1_Byte* old_base ) + FT_Byte* old_base ) { - T1_Long delta = table->block - old_base; - T1_Byte** offset = table->elements; - T1_Byte** limit = offset + table->max_elems; + FT_Long delta = table->block - old_base; + FT_Byte** offset = table->elements; + FT_Byte** limit = offset + table->max_elems; if ( delta ) @@ -116,12 +116,12 @@ static - T1_Error reallocate_t1_table( T1_Table* table, - T1_Int new_size ) + FT_Error reallocate_t1_table( T1_Table* table, + FT_Int new_size ) { FT_Memory memory = table->memory; - T1_Byte* old_base = table->block; - T1_Error error; + FT_Byte* old_base = table->block; + FT_Error error; /* realloc the base block */ @@ -161,10 +161,10 @@ /* reallocation fails. */ /* */ LOCAL_FUNC - T1_Error T1_Add_Table( T1_Table* table, - T1_Int index, + FT_Error T1_Add_Table( T1_Table* table, + FT_Int index, void* object, - T1_Int length ) + FT_Int length ) { if ( index < 0 || index > table->max_elems ) { @@ -175,8 +175,8 @@ /* grow the base block if needed */ if ( table->cursor + length > table->capacity ) { - T1_Error error; - T1_Int new_size = table->capacity; + FT_Error error; + FT_Int new_size = table->capacity; while ( new_size < table->cursor + length ) @@ -218,8 +218,8 @@ void T1_Done_Table( T1_Table* table ) { FT_Memory memory = table->memory; - T1_Error error; - T1_Byte* old_base; + FT_Error error; + FT_Byte* old_base; /* should never fail, as rec.cursor <= rec.size */ @@ -273,13 +273,13 @@ LOCAL_FUNC void CID_Skip_Spaces( CID_Parser* parser ) { - T1_Byte* cur = parser->cursor; - T1_Byte* limit = parser->limit; + FT_Byte* cur = parser->cursor; + FT_Byte* limit = parser->limit; while ( cur < limit ) { - T1_Byte c = *cur; + FT_Byte c = *cur; if ( !IS_T1_SPACE( c ) ) @@ -295,10 +295,10 @@ void CID_ToToken( CID_Parser* parser, T1_Token_Rec* token ) { - T1_Byte* cur; - T1_Byte* limit; - T1_Byte starter, ender; - T1_Int embed; + FT_Byte* cur; + FT_Byte* limit; + FT_Byte starter, ender; + FT_Int embed; token->type = t1_token_none; @@ -378,8 +378,8 @@ LOCAL_FUNC void CID_ToTokenArray( CID_Parser* parser, T1_Token_Rec* tokens, - T1_UInt max_tokens, - T1_Int* pnum_tokens ) + FT_UInt max_tokens, + FT_Int* pnum_tokens ) { T1_Token_Rec master; @@ -390,8 +390,8 @@ if ( master.type == t1_token_array ) { - T1_Byte* old_cursor = parser->cursor; - T1_Byte* old_limit = parser->limit; + FT_Byte* old_cursor = parser->cursor; + FT_Byte* old_limit = parser->limit; T1_Token_Rec* cur = tokens; T1_Token_Rec* limit = cur + max_tokens; @@ -423,18 +423,18 @@ static - T1_Long t1_toint( T1_Byte** cursor, - T1_Byte* limit ) + FT_Long t1_toint( FT_Byte** cursor, + FT_Byte* limit ) { - T1_Long result = 0; - T1_Byte* cur = *cursor; - T1_Byte c, d; + FT_Long result = 0; + FT_Byte* cur = *cursor; + FT_Byte c, d; for ( ; cur < limit; cur++ ) { c = *cur; - d = (T1_Byte)( c - '0' ); + d = (FT_Byte)( c - '0' ); if ( d < 10 ) break; @@ -449,7 +449,7 @@ { do { - d = (T1_Byte)( cur[0] - '0' ); + d = (FT_Byte)( cur[0] - '0' ); if ( d >= 10 ) break; @@ -469,14 +469,14 @@ static - T1_Long t1_tofixed( T1_Byte** cursor, - T1_Byte* limit, - T1_Long power_ten ) + FT_Long t1_tofixed( FT_Byte** cursor, + FT_Byte* limit, + FT_Long power_ten ) { - T1_Byte* cur = *cursor; - T1_Long num, divider, result; - T1_Int sign = 0; - T1_Byte d; + FT_Byte* cur = *cursor; + FT_Long num, divider, result; + FT_Int sign = 0; + FT_Byte d; if ( cur >= limit ) @@ -503,7 +503,7 @@ for (;;) { - d = (T1_Byte)( *cur - '0' ); + d = (FT_Byte)( *cur - '0' ); if ( d >= 10 ) break; if ( divider < 10000000L ) @@ -554,11 +554,11 @@ static - int t1_tobool( T1_Byte** cursor, - T1_Byte* limit ) + int t1_tobool( FT_Byte** cursor, + FT_Byte* limit ) { - T1_Byte* cur = *cursor; - T1_Bool result = 0; + FT_Byte* cur = *cursor; + FT_Bool result = 0; /* return 1 if we find a "true", 0 otherwise */ @@ -587,14 +587,14 @@ static - T1_Int t1_tocoordarray( T1_Byte** cursor, - T1_Byte* limit, - T1_Int max_coords, - T1_Short* coords ) + FT_Int t1_tocoordarray( FT_Byte** cursor, + FT_Byte* limit, + FT_Int max_coords, + FT_Short* coords ) { - T1_Byte* cur = *cursor; - T1_Int count = 0; - T1_Byte c, ender; + FT_Byte* cur = *cursor; + FT_Int count = 0; + FT_Byte c, ender; if ( cur >= limit ) @@ -632,7 +632,7 @@ if ( count >= max_coords || c == ender ) break; - coords[count] = (T1_Short)( t1_tofixed( &cur, limit, 0 ) >> 16 ); + coords[count] = (FT_Short)( t1_tofixed( &cur, limit, 0 ) >> 16 ); count++; if ( !ender ) @@ -646,15 +646,15 @@ static - T1_Int t1_tofixedarray( T1_Byte** cursor, - T1_Byte* limit, - T1_Int max_values, - T1_Fixed* values, - T1_Int power_ten ) + FT_Int t1_tofixedarray( FT_Byte** cursor, + FT_Byte* limit, + FT_Int max_values, + FT_Fixed* values, + FT_Int power_ten ) { - T1_Byte* cur = *cursor; - T1_Int count = 0; - T1_Byte c, ender; + FT_Byte* cur = *cursor; + FT_Int count = 0; + FT_Byte c, ender; if ( cur >= limit ) @@ -710,16 +710,16 @@ /* Loads a simple field (i.e. non-table) into the current */ /* list of objects */ LOCAL_FUNC - T1_Error CID_Load_Field( CID_Parser* parser, + FT_Error CID_Load_Field( CID_Parser* parser, const T1_Field_Rec* field, void* object ) { T1_Token_Rec token; - T1_Byte* cur; - T1_Byte* limit; - T1_UInt count; - T1_UInt index; - T1_Error error; + FT_Byte* cur; + FT_Byte* limit; + FT_UInt count; + FT_UInt index; + FT_Error error; CID_ToToken( parser, &token ); @@ -732,9 +732,9 @@ limit = token.limit; { - T1_Byte* q = (T1_Byte*)object + field->offset; - T1_Long val; - T1_String* string; + FT_Byte* q = (FT_Byte*)object + field->offset; + FT_Long val; + FT_String* string; switch ( field->type ) @@ -754,22 +754,22 @@ switch ( field->size ) { case 1: - *(T1_Byte*)q = (T1_Byte)val; + *(FT_Byte*)q = (FT_Byte)val; break; case 2: - *(T1_UShort*)q = (T1_UShort)val; + *(FT_UShort*)q = (FT_UShort)val; break; default: - *(T1_Long*)q = val; + *(FT_Long*)q = val; } break; case t1_field_string: { FT_Memory memory = parser->memory; - T1_UInt len = limit-cur; + FT_UInt len = limit-cur; if ( ALLOC( string, len + 1 ) ) @@ -778,7 +778,7 @@ MEM_Copy( string, cur, len ); string[len] = 0; - *(T1_String**)q = string; + *(FT_String**)q = string; } break; @@ -803,16 +803,16 @@ LOCAL_FUNC - T1_Error CID_Load_Field_Table( CID_Parser* parser, + FT_Error CID_Load_Field_Table( CID_Parser* parser, const T1_Field_Rec* field, void* object ) { T1_Token_Rec elements[CID_MAX_TABLE_ELEMENTS]; T1_Token_Rec* token; - T1_Int num_elements; - T1_Error error = 0; - T1_Byte* old_cursor; - T1_Byte* old_limit; + FT_Int num_elements; + FT_Error error = 0; + FT_Byte* old_cursor; + FT_Byte* old_limit; T1_Field_Rec fieldrec = *(T1_Field_Rec*)field; @@ -832,7 +832,7 @@ /* we store the elements count */ if ( field->count_offset ) - *(T1_Byte*)( (T1_Byte*)object + field->count_offset ) = num_elements; + *(FT_Byte*)( (FT_Byte*)object + field->count_offset ) = num_elements; /* we now load each element, adjusting the field.offset on each one */ token = elements; @@ -857,16 +857,16 @@ LOCAL_FUNC - T1_Long CID_ToInt( CID_Parser* parser ) + FT_Long CID_ToInt( CID_Parser* parser ) { return t1_toint( &parser->cursor, parser->limit ); } LOCAL_FUNC - T1_Int CID_ToCoordArray( CID_Parser* parser, - T1_Int max_coords, - T1_Short* coords ) + FT_Int CID_ToCoordArray( CID_Parser* parser, + FT_Int max_coords, + FT_Short* coords ) { return t1_tocoordarray( &parser->cursor, parser->limit, max_coords, coords ); @@ -874,10 +874,10 @@ LOCAL_FUNC - T1_Int CID_ToFixedArray( CID_Parser* parser, - T1_Int max_values, - T1_Fixed* values, - T1_Int power_ten ) + FT_Int CID_ToFixedArray( CID_Parser* parser, + FT_Int max_values, + FT_Fixed* values, + FT_Int power_ten ) { return t1_tofixedarray( &parser->cursor, parser->limit, max_values, values, power_ten ); @@ -916,10 +916,10 @@ FT_Stream stream, FT_Memory memory ) { - T1_Error error; - T1_ULong base_offset, offset, ps_len; - T1_Byte buffer[256 + 10]; - T1_Int buff_len; + FT_Error error; + FT_ULong base_offset, offset, ps_len; + FT_Byte buffer[256 + 10]; + FT_Int buff_len; MEM_Set( parser, 0, sizeof ( *parser ) ); @@ -946,7 +946,7 @@ buff_len = 256; for (;;) { - T1_Byte *p, *limit = buffer + 256; + FT_Byte *p, *limit = buffer + 256; /* fill input buffer */ buff_len -= 256; diff --git a/src/cid/cidparse.h b/src/cid/cidparse.h index cd94204c1..0c63b68d7 100644 --- a/src/cid/cidparse.h +++ b/src/cid/cidparse.h @@ -80,15 +80,15 @@ LOCAL_DEF - T1_Error T1_New_Table( T1_Table* table, - T1_Int count, + FT_Error T1_New_Table( T1_Table* table, + FT_Int count, T1_Memory memory ); LOCAL_DEF - T1_Error T1_Add_Table( T1_Table* table, - T1_Int index, + FT_Error T1_Add_Table( T1_Table* table, + FT_Int index, void* object, - T1_Int length ); + FT_Int length ); LOCAL_DEF void T1_Release_Table( T1_Table* table ); @@ -134,23 +134,23 @@ FT_Stream stream; FT_Memory memory; - T1_Byte* postscript; - T1_Int postscript_len; + FT_Byte* postscript; + FT_Int postscript_len; - T1_ULong data_offset; + FT_ULong data_offset; - T1_Byte* cursor; - T1_Byte* limit; - T1_Error error; + FT_Byte* cursor; + FT_Byte* limit; + FT_Error error; CID_Info* cid; - T1_Int num_dict; + FT_Int num_dict; } CID_Parser; LOCAL_DEF - T1_Error CID_New_Parser( CID_Parser* parser, + FT_Error CID_New_Parser( CID_Parser* parser, FT_Stream stream, FT_Memory memory ); @@ -165,18 +165,18 @@ /*************************************************************************/ LOCAL_DEF - T1_Long CID_ToInt( CID_Parser* parser ); + FT_Long CID_ToInt( CID_Parser* parser ); LOCAL_DEF - T1_Int CID_ToCoordArray( CID_Parser* parser, - T1_Int max_coords, - T1_Short* coords ); + FT_Int CID_ToCoordArray( CID_Parser* parser, + FT_Int max_coords, + FT_Short* coords ); LOCAL_DEF - T1_Int CID_ToFixedArray( CID_Parser* parser, - T1_Int max_values, - T1_Fixed* values, - T1_Int power_ten ); + FT_Int CID_ToFixedArray( CID_Parser* parser, + FT_Int max_values, + FT_Fixed* values, + FT_Int power_ten ); LOCAL_DEF void CID_Skip_Spaces( CID_Parser* parser ); @@ -199,8 +199,8 @@ /* a simple structure used to identify tokens */ typedef struct T1_Token_Rec_ { - T1_Byte* start; /* first character of token in input stream */ - T1_Byte* limit; /* first character after the token */ + FT_Byte* start; /* first character of token in input stream */ + FT_Byte* limit; /* first character after the token */ T1_Token_Type type; /* type of token.. */ } T1_Token_Rec; @@ -241,7 +241,7 @@ } T1_Field_Location; - typedef T1_Error (*CID_Field_Parser)( CID_Face face, + typedef FT_Error (*CID_Field_Parser)( CID_Face face, CID_Parser* parser ); /* structure type used to model object fields */ @@ -251,11 +251,11 @@ T1_Field_Location location; T1_Field_Type type; /* type of field */ CID_Field_Parser reader; - T1_UInt offset; /* offset of field in object */ - T1_UInt size; /* size of field in bytes */ - T1_UInt array_max; /* maximal number of elements for */ + FT_UInt offset; /* offset of field in object */ + FT_UInt size; /* size of field in bytes */ + FT_UInt array_max; /* maximal number of elements for */ /* array */ - T1_UInt count_offset; /* offset of element count for */ + FT_UInt count_offset; /* offset of element count for */ /* arrays */ } T1_Field_Rec; @@ -266,7 +266,7 @@ { \ _ident, T1CODE, _type, \ 0, \ - (T1_UInt)(char*)&T1_FIELD_REF( T1TYPE, _fname ), \ + (FT_UInt)(char*)&T1_FIELD_REF( T1TYPE, _fname ), \ sizeof ( T1_FIELD_REF( T1TYPE, _fname ) ), \ 0, 0 \ }, @@ -283,17 +283,17 @@ { \ _ident, T1CODE, _type, \ 0, \ - (T1_UInt)(char*)&T1_FIELD_REF( T1TYPE, _fname ), \ + (FT_UInt)(char*)&T1_FIELD_REF( T1TYPE, _fname ), \ sizeof ( T1_FIELD_REF( T1TYPE, _fname )[0] ), \ _max, \ - (T1_UInt)(char*)&T1_FIELD_REF( T1TYPE, num_ ## _fname ) \ + (FT_UInt)(char*)&T1_FIELD_REF( T1TYPE, num_ ## _fname ) \ }, #define T1_NEW_TABLE_FIELD2( _ident, _type, _fname, _max ) \ { \ _ident, T1CODE, _type, \ 0, \ - (T1_UInt)(char*)&T1_FIELD_REF( T1TYPE, _fname ), \ + (FT_UInt)(char*)&T1_FIELD_REF( T1TYPE, _fname ), \ sizeof ( T1_FIELD_REF( T1TYPE, _fname )[0] ), \ _max, 0 \ }, @@ -332,12 +332,12 @@ LOCAL_DEF - T1_Error CID_Load_Field( CID_Parser* parser, + FT_Error CID_Load_Field( CID_Parser* parser, const T1_Field_Rec* field, void* object ); LOCAL_DEF - T1_Error CID_Load_Field_Table( CID_Parser* parser, + FT_Error CID_Load_Field_Table( CID_Parser* parser, const T1_Field_Rec* field, void* object ); diff --git a/src/cid/cidriver.c b/src/cid/cidriver.c index 407f542e2..7f86d612c 100644 --- a/src/cid/cidriver.c +++ b/src/cid/cidriver.c @@ -66,7 +66,7 @@ /* */ static FTDriver_Interface Get_Interface( FT_Driver driver, - const T1_String* interface ) + const FT_String* interface ) { UNUSED( driver ); UNUSED( interface ); @@ -111,10 +111,10 @@ /* They can be implemented by format-specific interfaces. */ /* */ static - T1_Error Get_Kerning( T1_Face face, - T1_UInt left_glyph, - T1_UInt right_glyph, - T1_Vector* kerning ) + FT_Error Get_Kerning( T1_Face face, + FT_UInt left_glyph, + FT_UInt right_glyph, + FT_Vector* kerning ) { T1_AFM* afm; @@ -160,11 +160,11 @@ /* Type1 error code. 0 means success. */ /* */ static - T1_Error Set_Char_Sizes( T1_Size size, - T1_F26Dot6 char_width, - T1_F26Dot6 char_height, - T1_UInt horz_resolution, - T1_UInt vert_resolution ) + FT_Error Set_Char_Sizes( T1_Size size, + FT_F26Dot6 char_width, + FT_F26Dot6 char_height, + FT_UInt horz_resolution, + FT_UInt vert_resolution ) { UNUSED( char_width ); UNUSED( char_height ); @@ -197,9 +197,9 @@ /* Type1 error code. 0 means success. */ /* */ static - T1_Error Set_Pixel_Sizes( T1_Size size, - T1_Int pixel_width, - T1_Int pixel_height ) + FT_Error Set_Pixel_Sizes( T1_Size size, + FT_Int pixel_width, + FT_Int pixel_height ) { UNUSED( pixel_width ); UNUSED( pixel_height ); @@ -225,11 +225,11 @@ /* Glyph index. 0 means `undefined character code'. */ /* */ static - T1_UInt Get_Char_Index( FT_CharMap charmap, - T1_Long charcode ) + FT_UInt Get_Char_Index( FT_CharMap charmap, + FT_Long charcode ) { T1_Face face; - T1_UInt result = 0; + FT_UInt result = 0; PSNames_Interface* psnames; @@ -245,7 +245,7 @@ case ft_encoding_unicode: /* use the `PSNames' module to synthetize the Unicode charmap */ result = psnames->lookup_unicode( &face->unicode_map, - (T1_ULong)charcode ); + (FT_ULong)charcode ); /* the function returns 0xFFFF if the Unicode charcode has */ /* no corresponding glyph. */ @@ -275,8 +275,8 @@ default: if ( charcode < 256 ) { - T1_UInt code; - T1_Int n; + FT_UInt code; + FT_Int n; const char* glyph_name; diff --git a/src/sfnt/sfobjs.c b/src/sfnt/sfobjs.c index 63cde406a..3b0f654b7 100644 --- a/src/sfnt/sfobjs.c +++ b/src/sfnt/sfobjs.c @@ -50,13 +50,13 @@ /* Character string. NULL if no name is present. */ /* */ static - TT_String* Get_Name( TT_Face face, - TT_UShort nameid ) + FT_String* Get_Name( TT_Face face, + FT_UShort nameid ) { FT_Memory memory = face->root.memory; - TT_UShort n; + FT_UShort n; TT_NameRec* rec; - TT_Bool wide_chars = 1; + FT_Bool wide_chars = 1; rec = face->name_table.names; @@ -65,7 +65,7 @@ if ( rec->nameID == nameid ) { /* found the name - now create an ASCII string from it */ - TT_Bool found = 0; + FT_Bool found = 0; /* test for Microsoft English language */ @@ -89,16 +89,16 @@ /* found a Unicode name */ if ( found ) { - TT_String* string; - TT_UInt len; + FT_String* string; + FT_UInt len; if ( wide_chars ) { - TT_UInt m; + FT_UInt m; - len = (TT_UInt)rec->stringLength / 2; + len = (FT_UInt)rec->stringLength / 2; if ( MEM_Alloc( string, len + 1 ) ) return NULL; @@ -173,13 +173,13 @@ LOCAL_FUNC - TT_Error SFNT_Init_Face( FT_Stream stream, + FT_Error SFNT_Init_Face( FT_Stream stream, TT_Face face, - TT_Int face_index, - TT_Int num_params, + FT_Int face_index, + FT_Int num_params, FT_Parameter* params ) { - TT_Error error; + FT_Error error; SFNT_Interface* sfnt; PSNames_Interface* psnames; SFNT_Header sfnt_header; @@ -254,13 +254,13 @@ LOCAL_FUNC - TT_Error SFNT_Load_Face( FT_Stream stream, + FT_Error SFNT_Load_Face( FT_Stream stream, TT_Face face, - TT_Int face_index, - TT_Int num_params, + FT_Int face_index, + FT_Int num_params, FT_Parameter* params ) { - TT_Error error; + FT_Error error; SFNT_Interface* sfnt = (SFNT_Interface*)face->sfnt; @@ -305,9 +305,9 @@ /* now set up root fields */ { FT_Face root = &face->root; - TT_Int flags; + FT_Int flags; TT_CharMap charmap; - TT_Int n; + FT_Int n; FT_Memory memory; @@ -378,8 +378,8 @@ for ( n = 0; n < root->num_charmaps; n++, charmap++ ) { - TT_Int platform = charmap->cmap.platformID; - TT_Int encoding = charmap->cmap.platformEncodingID; + FT_Int platform = charmap->cmap.platformID; + FT_Int encoding = charmap->cmap.platformEncodingID; charmap->root.face = (FT_Face)face; @@ -502,7 +502,7 @@ /* freeing the character mapping tables */ if (sfnt && sfnt->load_charmaps ) { - TT_UShort n; + FT_UShort n; for ( n = 0; n < face->num_charmaps; n++ ) diff --git a/src/sfnt/sfobjs.h b/src/sfnt/sfobjs.h index 564ed26b0..ac7d34d69 100644 --- a/src/sfnt/sfobjs.h +++ b/src/sfnt/sfobjs.h @@ -24,17 +24,17 @@ LOCAL_DEF - TT_Error SFNT_Init_Face( FT_Stream stream, + FT_Error SFNT_Init_Face( FT_Stream stream, TT_Face face, - TT_Int face_index, - TT_Int num_params, + FT_Int face_index, + FT_Int num_params, FT_Parameter* params ); LOCAL_DEF - TT_Error SFNT_Load_Face( FT_Stream stream, + FT_Error SFNT_Load_Face( FT_Stream stream, TT_Face face, - TT_Int face_index, - TT_Int num_params, + FT_Int face_index, + FT_Int num_params, FT_Parameter* params ); LOCAL_DEF diff --git a/src/sfnt/ttcmap.c b/src/sfnt/ttcmap.c index e91fa254c..e91d3336c 100644 --- a/src/sfnt/ttcmap.c +++ b/src/sfnt/ttcmap.c @@ -33,14 +33,14 @@ #define FT_COMPONENT trace_ttcmap - static TT_UInt code_to_index0( TT_CMapTable* charmap, - TT_ULong char_code ); - static TT_UInt code_to_index2( TT_CMapTable* charmap, - TT_ULong char_code ); - static TT_UInt code_to_index4( TT_CMapTable* charmap, - TT_ULong char_code ); - static TT_UInt code_to_index6( TT_CMapTable* charmap, - TT_ULong char_code ); + static FT_UInt code_to_index0( TT_CMapTable* charmap, + FT_ULong char_code ); + static FT_UInt code_to_index2( TT_CMapTable* charmap, + FT_ULong char_code ); + static FT_UInt code_to_index4( TT_CMapTable* charmap, + FT_ULong char_code ); + static FT_UInt code_to_index6( TT_CMapTable* charmap, + FT_ULong char_code ); /*************************************************************************/ @@ -67,15 +67,15 @@ /* released. */ /* */ LOCAL_FUNC - TT_Error TT_CharMap_Load( TT_Face face, + FT_Error TT_CharMap_Load( TT_Face face, TT_CMapTable* cmap, FT_Stream stream ) { - TT_Error error; + FT_Error error; FT_Memory memory; - TT_UShort num_SH, num_Seg, i; + FT_UShort num_SH, num_Seg, i; - TT_UShort u, l; + FT_UShort u, l; TT_CMap0* cmap0; TT_CMap2* cmap2; @@ -112,7 +112,7 @@ /* allocate subheader keys */ - if ( ALLOC_ARRAY( cmap2->subHeaderKeys, 256, TT_UShort ) || + if ( ALLOC_ARRAY( cmap2->subHeaderKeys, 256, FT_UShort ) || ACCESS_Frame( 512L ) ) goto Fail; @@ -155,7 +155,7 @@ /* load glyph IDs */ - if ( ALLOC_ARRAY( cmap2->glyphIdArray, l, TT_UShort ) || + if ( ALLOC_ARRAY( cmap2->glyphIdArray, l, FT_UShort ) || ACCESS_Frame( l * 2L ) ) goto Fail; @@ -215,7 +215,7 @@ /* load IDs */ - if ( ALLOC_ARRAY( cmap4->glyphIdArray, l, TT_UShort ) || + if ( ALLOC_ARRAY( cmap4->glyphIdArray, l, FT_UShort ) || ACCESS_Frame( l * 2L ) ) goto Fail; @@ -244,7 +244,7 @@ if ( ALLOC_ARRAY( cmap6->glyphIdArray, cmap6->entryCount, - TT_Short ) || + FT_Short ) || ACCESS_Frame( l * 2L ) ) goto Fail; @@ -284,7 +284,7 @@ /* TrueType error code. 0 means success. */ /* */ LOCAL_FUNC - TT_Error TT_CharMap_Free( TT_Face face, + FT_Error TT_CharMap_Free( TT_Face face, TT_CMapTable* cmap ) { FT_Memory memory; @@ -346,8 +346,8 @@ /* Glyph index into the glyphs array. 0 if the glyph does not exist. */ /* */ static - TT_UInt code_to_index0( TT_CMapTable* cmap, - TT_ULong charCode ) + FT_UInt code_to_index0( TT_CMapTable* cmap, + FT_ULong charCode ) { TT_CMap0* cmap0 = &cmap->c.cmap0; @@ -372,19 +372,19 @@ /* Glyph index into the glyphs array. 0 if the glyph does not exist. */ /* */ static - TT_UInt code_to_index2( TT_CMapTable* cmap, - TT_ULong charCode ) + FT_UInt code_to_index2( TT_CMapTable* cmap, + FT_ULong charCode ) { - TT_UInt result, index1, offset; - TT_UInt char_lo; - TT_ULong char_hi; + FT_UInt result, index1, offset; + FT_UInt char_lo; + FT_ULong char_hi; TT_CMap2SubHeader* sh2; TT_CMap2* cmap2; cmap2 = &cmap->c.cmap2; result = 0; - char_lo = (TT_UInt)( charCode & 0xFF ); + char_lo = (FT_UInt)( charCode & 0xFF ); char_hi = charCode >> 8; if ( char_hi == 0 ) @@ -436,10 +436,10 @@ /* Glyph index into the glyphs array. 0 if the glyph does not exist. */ /* */ static - TT_UInt code_to_index4( TT_CMapTable* cmap, - TT_ULong charCode ) + FT_UInt code_to_index4( TT_CMapTable* cmap, + FT_ULong charCode ) { - TT_UInt result, index1, segCount; + FT_UInt result, index1, segCount; TT_CMap4* cmap4; TT_CMap4Segment *seg4, *limit; @@ -461,8 +461,8 @@ /* the cache is to significantly speed up charcode to glyph index */ /* conversion. */ - if ( (TT_ULong)(charCode - seg4->startCount) < - (TT_ULong)(seg4->endCount - seg4->startCount) ) + if ( (FT_ULong)(charCode - seg4->startCount) < + (FT_ULong)(seg4->endCount - seg4->startCount) ) goto Found; for ( seg4 = cmap4->segments; seg4 < limit; seg4++ ) @@ -519,11 +519,11 @@ /* Glyph index into the glyphs array. 0 if the glyph does not exist. */ /* */ static - TT_UInt code_to_index6( TT_CMapTable* cmap, - TT_ULong charCode ) + FT_UInt code_to_index6( TT_CMapTable* cmap, + FT_ULong charCode ) { TT_CMap6* cmap6; - TT_UInt result = 0; + FT_UInt result = 0; cmap6 = &cmap->c.cmap6; diff --git a/src/sfnt/ttcmap.h b/src/sfnt/ttcmap.h index 3439469fd..609972a90 100644 --- a/src/sfnt/ttcmap.h +++ b/src/sfnt/ttcmap.h @@ -27,12 +27,12 @@ LOCAL_DEF - TT_Error TT_CharMap_Load( TT_Face face, + FT_Error TT_CharMap_Load( TT_Face face, TT_CMapTable* cmap, FT_Stream input ); LOCAL_DEF - TT_Error TT_CharMap_Free( TT_Face face, + FT_Error TT_CharMap_Free( TT_Face face, TT_CMapTable* cmap ); #ifdef __cplusplus diff --git a/src/sfnt/ttload.c b/src/sfnt/ttload.c index aad9047af..effb9d1aa 100644 --- a/src/sfnt/ttload.c +++ b/src/sfnt/ttload.c @@ -52,7 +52,7 @@ /* */ LOCAL_FUNC TT_Table* TT_LookUp_Table( TT_Face face, - TT_ULong tag ) + FT_ULong tag ) { TT_Table* entry; TT_Table* limit; @@ -60,10 +60,10 @@ FT_TRACE3(( "TT_LookUp_Table: %08p, `%c%c%c%c'\n", face, - (TT_Char)( tag >> 24 ), - (TT_Char)( tag >> 16 ), - (TT_Char)( tag >> 8 ), - (TT_Char)( tag ) )); + (FT_Char)( tag >> 24 ), + (FT_Char)( tag >> 16 ), + (FT_Char)( tag >> 8 ), + (FT_Char)( tag ) )); entry = face->dir_tables; limit = entry + face->num_tables; @@ -99,13 +99,13 @@ /* TrueType error code. 0 means success. */ /* */ LOCAL_FUNC - TT_Error TT_Goto_Table( TT_Face face, - TT_ULong tag, + FT_Error TT_Goto_Table( TT_Face face, + FT_ULong tag, FT_Stream stream, - TT_ULong* length ) + FT_ULong* length ) { TT_Table* table; - TT_Error error; + FT_Error error; table = TT_LookUp_Table( face, tag ); @@ -152,13 +152,13 @@ /* values of `search_range', `entry_selector', and `range_shift'. */ /* */ LOCAL_FUNC - TT_Error TT_Load_SFNT_Header( TT_Face face, + FT_Error TT_Load_SFNT_Header( TT_Face face, FT_Stream stream, - TT_Long face_index, + FT_Long face_index, SFNT_Header* sfnt ) { - TT_Error error; - TT_ULong format_tag; + FT_Error error; + FT_ULong format_tag; FT_Memory memory = stream->memory; const FT_Frame_Field sfnt_header_fields[] = @@ -196,7 +196,7 @@ if ( format_tag == TTAG_ttcf ) { - TT_Int n; + FT_Int n; FT_TRACE3(( "TT_Load_SFNT_Header: file is a collection\n" )); @@ -209,7 +209,7 @@ /* now read the offsets of each font in the file */ if ( ALLOC_ARRAY( face->ttc_header.TableDirectory, face->ttc_header.DirCount, - TT_ULong ) || + FT_ULong ) || ACCESS_Frame( face->ttc_header.DirCount * 4L ) ) goto Exit; @@ -238,8 +238,8 @@ /* now, check the values of `num_tables', `seach_range', etc. */ { - TT_UInt num_tables = sfnt->num_tables; - TT_ULong entry_selector = 1L << sfnt->entry_selector; + FT_UInt num_tables = sfnt->num_tables; + FT_ULong entry_selector = 1L << sfnt->entry_selector; /* IMPORTANT: Many fonts have an incorrect `search_range' value, so */ @@ -281,11 +281,11 @@ /* The stream cursor must be at the font file's origin. */ /* */ LOCAL_FUNC - TT_Error TT_Load_Directory( TT_Face face, + FT_Error TT_Load_Directory( TT_Face face, FT_Stream stream, SFNT_Header* sfnt ) { - TT_Error error; + FT_Error error; FT_Memory memory = stream->memory; TT_Table *entry, *limit; @@ -317,10 +317,10 @@ entry->Length = GET_Long(); FT_TRACE2(( " %c%c%c%c - %08lx - %08lx\n", - (TT_Char)( entry->Tag >> 24 ), - (TT_Char)( entry->Tag >> 16 ), - (TT_Char)( entry->Tag >> 8 ), - (TT_Char)( entry->Tag ), + (FT_Char)( entry->Tag >> 24 ), + (FT_Char)( entry->Tag >> 16 ), + (FT_Char)( entry->Tag >> 8 ), + (FT_Char)( entry->Tag ), entry->Offset, entry->Length )); } @@ -376,16 +376,16 @@ /* TrueType error code. 0 means success. */ /* */ LOCAL_FUNC - TT_Error TT_Load_Any( TT_Face face, - TT_ULong tag, - TT_Long offset, + FT_Error TT_Load_Any( TT_Face face, + FT_ULong tag, + FT_Long offset, void* buffer, - TT_Long* length ) + FT_Long* length ) { - TT_Error error; + FT_Error error; FT_Stream stream; TT_Table* table; - TT_ULong size; + FT_ULong size; if ( tag != 0 ) @@ -439,10 +439,10 @@ /* TrueType error code. 0 means success. */ /* */ LOCAL_FUNC - TT_Error TT_Load_Header( TT_Face face, + FT_Error TT_Load_Header( TT_Face face, FT_Stream stream ) { - TT_Error error; + FT_Error error; TT_Header* header; static const FT_Frame_Field header_fields[] = @@ -510,10 +510,10 @@ /* TrueType error code. 0 means success. */ /* */ LOCAL_FUNC - TT_Error TT_Load_MaxProfile( TT_Face face, + FT_Error TT_Load_MaxProfile( TT_Face face, FT_Stream stream ) { - TT_Error error; + FT_Error error; TT_MaxProfile* maxProfile = &face->max_profile; const FT_Frame_Field maxp_fields[] = @@ -563,7 +563,7 @@ face->root.max_contours = MAX( maxProfile->maxCompositeContours, maxProfile->maxContours ); - face->max_components = (TT_ULong)maxProfile->maxComponentElements + + face->max_components = (FT_ULong)maxProfile->maxComponentElements + maxProfile->maxComponentDepth; /* XXX: some fonts have maxComponents set to 0; we will */ @@ -600,15 +600,15 @@ /* TrueType error code. 0 means success. */ /* */ static - TT_Error TT_Load_Metrics( TT_Face face, + FT_Error TT_Load_Metrics( TT_Face face, FT_Stream stream, - TT_Bool vertical ) + FT_Bool vertical ) { - TT_Error error; + FT_Error error; FT_Memory memory = stream->memory; - TT_ULong table_len; - TT_Long num_shorts, num_longs, num_shorts_checked; + FT_ULong table_len; + FT_Long num_shorts, num_longs, num_shorts_checked; TT_LongMetrics** longs; TT_ShortMetrics** shorts; @@ -701,7 +701,7 @@ /* fonts usually only, nothing serious will happen */ if ( num_shorts > num_shorts_checked && num_shorts_checked > 0 ) { - TT_Short val = *(shorts)[num_shorts_checked - 1]; + FT_Short val = *(shorts)[num_shorts_checked - 1]; limit = *shorts + num_shorts; @@ -736,11 +736,11 @@ /* TrueType error code. 0 means success. */ /* */ LOCAL_FUNC - TT_Error TT_Load_Metrics_Header( TT_Face face, + FT_Error TT_Load_Metrics_Header( TT_Face face, FT_Stream stream, - TT_Bool vertical ) + FT_Bool vertical ) { - TT_Error error; + FT_Error error; TT_HoriHeader* header; const FT_Frame_Field metrics_header_fields[] = @@ -832,14 +832,14 @@ /* TrueType error code. 0 means success. */ /* */ LOCAL_FUNC - TT_Error TT_Load_Names( TT_Face face, + FT_Error TT_Load_Names( TT_Face face, FT_Stream stream ) { - TT_Error error; + FT_Error error; FT_Memory memory = stream->memory; - TT_ULong table_pos, table_len; - TT_ULong storageSize; + FT_ULong table_pos, table_len; + FT_ULong storageSize; TT_NameTable* names; @@ -901,12 +901,12 @@ for ( ; cur < limit; cur ++ ) { - TT_ULong upper; + FT_ULong upper; (void)READ_Fields( name_record_fields, cur ); - upper = (TT_ULong)( cur->stringOffset + cur->stringLength ); + upper = (FT_ULong)( cur->stringOffset + cur->stringLength ); if ( upper > storageSize ) storageSize = upper; } @@ -942,7 +942,7 @@ for ( ; cur < limit; cur++ ) { - TT_UInt j; + FT_UInt j; FT_TRACE3(( "%d %d %x %d\n ", @@ -956,10 +956,10 @@ if ( cur->string ) for ( j = 0; j < cur->stringLength; j++ ) { - TT_Char c = *(cur->string + j); + FT_Char c = *(cur->string + j); - if ( (TT_Byte)c < 128 ) + if ( (FT_Byte)c < 128 ) FT_TRACE3(( "%c", c )); } } @@ -1023,12 +1023,12 @@ /* TrueType error code. 0 means success. */ /* */ LOCAL_FUNC - TT_Error TT_Load_CMap( TT_Face face, + FT_Error TT_Load_CMap( TT_Face face, FT_Stream stream ) { - TT_Error error; + FT_Error error; FT_Memory memory = stream->memory; - TT_Long table_start; + FT_Long table_start; TT_CMapDir cmap_dir; const FT_Frame_Field cmap_fields[] = @@ -1090,7 +1090,7 @@ cmap->loaded = FALSE; cmap->platformID = GET_UShort(); cmap->platformEncodingID = GET_UShort(); - cmap->offset = (TT_ULong)GET_Long(); + cmap->offset = (FT_ULong)GET_Long(); } FORGET_Frame(); @@ -1101,7 +1101,7 @@ TT_CMapTable* cmap = &charmap->cmap; - if ( FILE_Seek( table_start + (TT_Long)cmap->offset ) || + if ( FILE_Seek( table_start + (FT_Long)cmap->offset ) || READ_Fields( cmap_rec_fields, cmap ) ) goto Exit; @@ -1132,10 +1132,10 @@ /* TrueType error code. 0 means success. */ /* */ LOCAL_FUNC - TT_Error TT_Load_OS2( TT_Face face, + FT_Error TT_Load_OS2( TT_Face face, FT_Stream stream ) { - TT_Error error; + FT_Error error; TT_OS2* os2; const FT_Frame_Field os2_fields[] = @@ -1266,10 +1266,10 @@ /* TrueType error code. 0 means success. */ /* */ LOCAL_FUNC - TT_Error TT_Load_PostScript( TT_Face face, + FT_Error TT_Load_PostScript( TT_Face face, FT_Stream stream ) { - TT_Error error; + FT_Error error; TT_Postscript* post = &face->postscript; static const FT_Frame_Field post_fields[] = @@ -1321,7 +1321,7 @@ /* TrueType error code. 0 means success. */ /* */ LOCAL_FUNC - TT_Error TT_Load_PCLT( TT_Face face, + FT_Error TT_Load_PCLT( TT_Face face, FT_Stream stream ) { static const FT_Frame_Field pclt_fields[] = @@ -1347,7 +1347,7 @@ FT_FRAME_END }; - TT_Error error; + FT_Error error; TT_PCLT* pclt = &face->pclt; @@ -1392,13 +1392,13 @@ /* TrueType error code. 0 means success. */ /* */ LOCAL_FUNC - TT_Error TT_Load_Gasp( TT_Face face, + FT_Error TT_Load_Gasp( TT_Face face, FT_Stream stream ) { - TT_Error error; + FT_Error error; FT_Memory memory = stream->memory; - TT_UInt j,num_ranges; + FT_UInt j,num_ranges; TT_GaspRange* gaspranges; @@ -1464,13 +1464,13 @@ /* TrueType error code. 0 means success. */ /* */ LOCAL_FUNC - TT_Error TT_Load_Kern( TT_Face face, + FT_Error TT_Load_Kern( TT_Face face, FT_Stream stream ) { - TT_Error error; + FT_Error error; FT_Memory memory = stream->memory; - TT_UInt n, num_tables, version; + FT_UInt n, num_tables, version; /* the kern table is optional. exit silently if it is missing */ @@ -1488,8 +1488,8 @@ for ( n = 0; n < num_tables; n++ ) { - TT_UInt coverage; - TT_UInt length; + FT_UInt coverage; + FT_UInt length; if ( ACCESS_Frame( 6L ) ) @@ -1503,7 +1503,7 @@ if ( coverage == 0x0001 ) { - TT_UInt num_pairs; + FT_UInt num_pairs; TT_Kern_0_Pair* pair; TT_Kern_0_Pair* limit; @@ -1569,15 +1569,15 @@ /* TrueType error code. 0 means success. */ /* */ LOCAL_FUNC - TT_Error TT_Load_Hdmx( TT_Face face, + FT_Error TT_Load_Hdmx( TT_Face face, FT_Stream stream ) { - TT_Error error; + FT_Error error; FT_Memory memory = stream->memory; TT_Hdmx* hdmx = &face->hdmx; - TT_Long num_glyphs; - TT_Long record_size; + FT_Long num_glyphs; + FT_Long record_size; hdmx->version = 0; @@ -1651,7 +1651,7 @@ { if ( face ) { - TT_Int n; + FT_Int n; FT_Memory memory = face->root.driver->memory; diff --git a/src/sfnt/ttload.h b/src/sfnt/ttload.h index 02bf36907..800de4b49 100644 --- a/src/sfnt/ttload.h +++ b/src/sfnt/ttload.h @@ -35,75 +35,75 @@ LOCAL_DEF TT_Table* TT_LookUp_Table( TT_Face face, - TT_ULong tag ); + FT_ULong tag ); LOCAL_DEF - TT_Error TT_Goto_Table( TT_Face face, - TT_ULong tag, + FT_Error TT_Goto_Table( TT_Face face, + FT_ULong tag, FT_Stream stream, - TT_ULong* length ); + FT_ULong* length ); LOCAL_DEF - TT_Error TT_Load_SFNT_Header( TT_Face face, + FT_Error TT_Load_SFNT_Header( TT_Face face, FT_Stream stream, - TT_Long face_index, + FT_Long face_index, SFNT_Header* sfnt ); LOCAL_DEF - TT_Error TT_Load_Directory( TT_Face face, + FT_Error TT_Load_Directory( TT_Face face, FT_Stream stream, SFNT_Header* sfnt ); LOCAL_DEF - TT_Error TT_Load_Any( TT_Face face, - TT_ULong tag, - TT_Long offset, + FT_Error TT_Load_Any( TT_Face face, + FT_ULong tag, + FT_Long offset, void* buffer, - TT_Long* length ); + FT_Long* length ); LOCAL_DEF - TT_Error TT_Load_Header( TT_Face face, + FT_Error TT_Load_Header( TT_Face face, FT_Stream stream ); LOCAL_DEF - TT_Error TT_Load_Metrics_Header( TT_Face face, + FT_Error TT_Load_Metrics_Header( TT_Face face, FT_Stream stream, - TT_Bool vertical ); + FT_Bool vertical ); LOCAL_DEF - TT_Error TT_Load_CMap( TT_Face face, + FT_Error TT_Load_CMap( TT_Face face, FT_Stream stream ); LOCAL_DEF - TT_Error TT_Load_MaxProfile( TT_Face face, + FT_Error TT_Load_MaxProfile( TT_Face face, FT_Stream stream ); LOCAL_DEF - TT_Error TT_Load_Names( TT_Face face, + FT_Error TT_Load_Names( TT_Face face, FT_Stream stream ); LOCAL_DEF - TT_Error TT_Load_OS2( TT_Face face, + FT_Error TT_Load_OS2( TT_Face face, FT_Stream stream ); LOCAL_DEF - TT_Error TT_Load_PostScript( TT_Face face, + FT_Error TT_Load_PostScript( TT_Face face, FT_Stream stream ); LOCAL_DEF - TT_Error TT_Load_Hdmx( TT_Face face, + FT_Error TT_Load_Hdmx( TT_Face face, FT_Stream stream ); LOCAL_DEF - TT_Error TT_Load_PCLT( TT_Face face, + FT_Error TT_Load_PCLT( TT_Face face, FT_Stream stream ); LOCAL_DEF @@ -115,12 +115,12 @@ LOCAL_DEF - TT_Error TT_Load_Kern( TT_Face face, + FT_Error TT_Load_Kern( TT_Face face, FT_Stream stream ); LOCAL_DEF - TT_Error TT_Load_Gasp( TT_Face face, + FT_Error TT_Load_Gasp( TT_Face face, FT_Stream stream ); diff --git a/src/sfnt/ttpost.c b/src/sfnt/ttpost.c index 697dd1c18..513078295 100644 --- a/src/sfnt/ttpost.c +++ b/src/sfnt/ttpost.c @@ -50,7 +50,7 @@ #include -#define MAC_NAME( x ) ( (TT_String*)psnames->macintosh_name( x ) ) +#define MAC_NAME( x ) ( (FT_String*)psnames->macintosh_name( x ) ) #else /* FT_CONFIG_OPTION_POSTSCRIPT_NAMES */ @@ -62,7 +62,7 @@ /* the 258 default Mac PS glyph names */ - TT_String* TT_Post_Default_Names[258] = + FT_String* TT_Post_Default_Names[258] = { /* 0 */ ".notdef", ".null", "CR", "space", "exclam", @@ -148,17 +148,17 @@ static - TT_Error Load_Format_20( TT_Face face, + FT_Error Load_Format_20( TT_Face face, FT_Stream stream ) { FT_Memory memory = stream->memory; - TT_Error error; + FT_Error error; - TT_Int num_glyphs; - TT_Int num_names; + FT_Int num_glyphs; + FT_Int num_names; - TT_UShort* glyph_indices = 0; - TT_Char** name_strings = 0; + FT_UShort* glyph_indices = 0; + FT_Char** name_strings = 0; if ( READ_UShort( num_glyphs ) ) @@ -178,10 +178,10 @@ /* load the indices */ { - TT_Int n; + FT_Int n; - if ( ALLOC_ARRAY ( glyph_indices, num_glyphs, TT_UShort ) || + if ( ALLOC_ARRAY ( glyph_indices, num_glyphs, FT_UShort ) || ACCESS_Frame( num_glyphs * 2L ) ) goto Fail; @@ -193,14 +193,14 @@ /* compute number of names stored in table */ { - TT_Int n; + FT_Int n; num_names = 0; for ( n = 0; n < num_glyphs; n++ ) { - TT_Int index; + FT_Int index; index = glyph_indices[n]; @@ -215,19 +215,19 @@ /* now load the name strings */ { - TT_Int n; + FT_Int n; - if ( ALLOC_ARRAY( name_strings, num_names, TT_Char* ) ) + if ( ALLOC_ARRAY( name_strings, num_names, FT_Char* ) ) goto Fail; for ( n = 0; n < num_names; n++ ) { - TT_UInt len; + FT_UInt len; if ( READ_Byte ( len ) || - ALLOC_ARRAY( name_strings[n], len+1, TT_Char ) || + ALLOC_ARRAY( name_strings[n], len+1, FT_Char ) || FILE_Read ( name_strings[n], len ) ) goto Fail1; @@ -250,7 +250,7 @@ Fail1: { - TT_Int n; + FT_Int n; for ( n = 0; n < num_names; n++ ) @@ -267,14 +267,14 @@ static - TT_Error Load_Format_25( TT_Face face, + FT_Error Load_Format_25( TT_Face face, FT_Stream stream ) { FT_Memory memory = stream->memory; - TT_Error error; + FT_Error error; - TT_Int num_glyphs; - TT_Char* offset_table = 0; + FT_Int num_glyphs; + FT_Char* offset_table = 0; /* UNDOCUMENTED! This value appears only in the Apple TT specs. */ @@ -294,12 +294,12 @@ /* now check the offset table */ { - TT_Int n; + FT_Int n; for ( n = 0; n < num_glyphs; n++ ) { - TT_Long index = (TT_Long)n + offset_table[n]; + FT_Long index = (FT_Long)n + offset_table[n]; if ( index < 0 || index > num_glyphs ) @@ -330,10 +330,10 @@ static - TT_Error Load_Post_Names( TT_Face face ) + FT_Error Load_Post_Names( TT_Face face ) { FT_Stream stream; - TT_Error error; + FT_Error error; /* get a stream for the face's resource */ stream = face->root.stream; @@ -379,7 +379,7 @@ case 0x00020000L: { TT_Post_20* table = &names->names.format_20; - TT_UInt n; + FT_UInt n; FREE( table->glyph_indices ); @@ -430,11 +430,11 @@ /* TrueType error code. 0 means success. */ /* */ LOCAL_FUNC - TT_Error TT_Get_PS_Name( TT_Face face, - TT_UInt index, - TT_String** PSname ) + FT_Error TT_Get_PS_Name( TT_Face face, + FT_UInt index, + FT_String** PSname ) { - TT_Error error; + FT_Error error; TT_Post_Names* names; #ifdef FT_CONFIG_OPTION_POSTSCRIPT_NAMES @@ -445,7 +445,7 @@ if ( !face ) return TT_Err_Invalid_Face_Handle; - if ( index >= (TT_UInt)face->root.num_glyphs ) + if ( index >= (FT_UInt)face->root.num_glyphs ) return TT_Err_Invalid_Glyph_Index; #ifdef FT_CONFIG_OPTION_POSTSCRIPT_NAMES @@ -480,13 +480,13 @@ if ( index < table->num_glyphs ) { - TT_UShort name_index = table->glyph_indices[index]; + FT_UShort name_index = table->glyph_indices[index]; if ( name_index < 258 ) *PSname = MAC_NAME( name_index ); else - *PSname = (TT_String*)table->glyph_names[name_index - 258]; + *PSname = (FT_String*)table->glyph_names[name_index - 258]; } } break; diff --git a/src/sfnt/ttpost.h b/src/sfnt/ttpost.h index ceb7c5999..266f010f2 100644 --- a/src/sfnt/ttpost.h +++ b/src/sfnt/ttpost.h @@ -33,9 +33,9 @@ extern "C" { LOCAL_DEF - TT_Error TT_Get_PS_Name( TT_Face face, - TT_UInt index, - TT_String** PSname ); + FT_Error TT_Get_PS_Name( TT_Face face, + FT_UInt index, + FT_String** PSname ); LOCAL_DEF void TT_Free_Post_Names( TT_Face face ); diff --git a/src/sfnt/ttsbit.c b/src/sfnt/ttsbit.c index f8ef409d8..ecfb88e69 100644 --- a/src/sfnt/ttsbit.c +++ b/src/sfnt/ttsbit.c @@ -63,18 +63,18 @@ /* */ static void blit_sbit( FT_Bitmap* target, - TT_Byte* source, - TT_Int line_bits, - TT_Bool byte_padded, - TT_Int x_offset, - TT_Int y_offset ) + FT_Byte* source, + FT_Int line_bits, + FT_Bool byte_padded, + FT_Int x_offset, + FT_Int y_offset ) { - TT_Byte* line_buff; - TT_Int line_incr; - TT_Int height; + FT_Byte* line_buff; + FT_Int line_incr; + FT_Int height; - TT_UShort acc; - TT_Byte loaded; + FT_UShort acc; + FT_Byte loaded; /* first of all, compute starting write position */ @@ -102,10 +102,10 @@ for ( height = target->rows; height > 0; height-- ) { - TT_Byte* cur = line_buff; /* current write cursor */ - TT_Int count = line_bits; /* # of bits to extract per line */ - TT_Byte shift = x_offset & 7; /* current write shift */ - TT_Byte space = 8 - shift; + FT_Byte* cur = line_buff; /* current write cursor */ + FT_Int count = line_bits; /* # of bits to extract per line */ + FT_Byte shift = x_offset & 7; /* current write shift */ + FT_Byte space = 8 - shift; /* first of all, read individual source bytes */ @@ -115,18 +115,18 @@ { do { - TT_Byte val; + FT_Byte val; /* ensure that there are at least 8 bits in the accumulator */ if ( loaded < 8 ) { - acc |= (TT_UShort)*source++ << ( 8 - loaded ); + acc |= (FT_UShort)*source++ << ( 8 - loaded ); loaded += 8; } /* now write one byte */ - val = (TT_Byte)( acc >> 8 ); + val = (FT_Byte)( acc >> 8 ); if ( shift ) { cur[0] |= val >> shift; @@ -150,18 +150,18 @@ /* now write remaining bits (count < 8) */ if ( count > 0 ) { - TT_Byte val; + FT_Byte val; /* ensure that there are at least `count' bits in the accumulator */ if ( loaded < count ) { - acc |= (TT_UShort)*source++ << ( 8 - loaded ); + acc |= (FT_UShort)*source++ << ( 8 - loaded ); loaded += 8; } /* now write remaining bits */ - val = ( (TT_Byte)( acc >> 8 ) ) & ~( 0xFF >> count ); + val = ( (FT_Byte)( acc >> 8 ) ) & ~( 0xFF >> count ); cur[0] |= val >> shift; if ( count > space ) @@ -214,10 +214,10 @@ /* TrueType error code. 0 means success. */ /* */ static - TT_Error Load_SBit_Const_Metrics( TT_SBit_Range* range, + FT_Error Load_SBit_Const_Metrics( TT_SBit_Range* range, FT_Stream stream ) { - TT_Error error; + FT_Error error; if ( READ_ULong( range->image_size ) ) @@ -246,12 +246,12 @@ /* TrueType error code. 0 means success. */ /* */ static - TT_Error Load_SBit_Range_Codes( TT_SBit_Range* range, + FT_Error Load_SBit_Range_Codes( TT_SBit_Range* range, FT_Stream stream, - TT_Bool load_offsets ) + FT_Bool load_offsets ) { - TT_Error error; - TT_ULong count, n, size; + FT_Error error; + FT_ULong count, n, size; FT_Memory memory = stream->memory; @@ -263,7 +263,7 @@ /* Allocate glyph offsets table if needed */ if ( load_offsets ) { - if ( ALLOC_ARRAY( range->glyph_offsets, count, TT_ULong ) ) + if ( ALLOC_ARRAY( range->glyph_offsets, count, FT_ULong ) ) goto Exit; size = count * 4L; @@ -272,7 +272,7 @@ size = count * 2L; /* Allocate glyph codes table and access frame */ - if ( ALLOC_ARRAY ( range->glyph_codes, count, TT_UShort ) || + if ( ALLOC_ARRAY ( range->glyph_codes, count, FT_UShort ) || ACCESS_Frame( size ) ) goto Exit; @@ -281,7 +281,7 @@ range->glyph_codes[n] = GET_UShort(); if ( load_offsets ) - range->glyph_offsets[n] = (TT_ULong)range->image_offset + + range->glyph_offsets[n] = (FT_ULong)range->image_offset + GET_UShort(); } @@ -309,10 +309,10 @@ /* TrueType error code. 0 means success. */ /* */ static - TT_Error Load_SBit_Range( TT_SBit_Range* range, + FT_Error Load_SBit_Range( TT_SBit_Range* range, FT_Stream stream ) { - TT_Error error; + FT_Error error; FT_Memory memory = stream->memory; @@ -321,9 +321,9 @@ case 1: /* variable metrics with 4-byte offsets */ case 3: /* variable metrics with 2-byte offsets */ { - TT_ULong num_glyphs, n; - TT_Int size_elem; - TT_Bool large = ( range->index_format == 1 ); + FT_ULong num_glyphs, n; + FT_Int size_elem; + FT_Bool large = ( range->index_format == 1 ); num_glyphs = range->last_glyph - range->first_glyph + 1L; @@ -333,12 +333,12 @@ size_elem = large ? 4 : 2; if ( ALLOC_ARRAY( range->glyph_offsets, - num_glyphs, TT_ULong ) || + num_glyphs, FT_ULong ) || ACCESS_Frame( num_glyphs * size_elem ) ) goto Exit; for ( n = 0; n < num_glyphs; n++ ) - range->glyph_offsets[n] = (TT_ULong)( range->image_offset + + range->glyph_offsets[n] = (FT_ULong)( range->image_offset + ( large ? GET_ULong() : GET_UShort() ) ); FORGET_Frame(); @@ -384,14 +384,14 @@ /* TrueType error code. 0 means success. */ /* */ LOCAL_FUNC - TT_Error TT_Load_SBit_Strikes( TT_Face face, + FT_Error TT_Load_SBit_Strikes( TT_Face face, FT_Stream stream ) { - TT_Error error = 0; + FT_Error error = 0; FT_Memory memory = stream->memory; - TT_Fixed version; - TT_ULong num_strikes; - TT_ULong table_base; + FT_Fixed version; + FT_ULong num_strikes; + FT_ULong table_base; const FT_Frame_Field sbit_line_metrics_fields[] = { @@ -440,6 +440,8 @@ /* this table is optional */ error = face->goto_table( face, TTAG_EBLC, stream, 0 ); + if (error) + error = face->goto_table( face, TTAG_bloc, stream, 0 ); if ( error ) { error = 0; @@ -474,7 +476,7 @@ /* now read each strike table separately */ { TT_SBit_Strike* strike = face->sbit_strikes; - TT_ULong count = num_strikes; + FT_ULong count = num_strikes; if ( ACCESS_Frame( 48L * num_strikes ) ) @@ -499,13 +501,13 @@ /* allocate the index ranges for each strike table */ { TT_SBit_Strike* strike = face->sbit_strikes; - TT_ULong count = num_strikes; + FT_ULong count = num_strikes; while ( count > 0 ) { TT_SBit_Range* range; - TT_ULong count2 = strike->num_ranges; + FT_ULong count2 = strike->num_ranges; if ( ALLOC_ARRAY( strike->sbit_ranges, @@ -632,10 +634,10 @@ /* TrueType error code. 0 means the glyph index was found. */ /* */ static - TT_Error Find_SBit_Range( TT_UInt glyph_index, + FT_Error Find_SBit_Range( FT_UInt glyph_index, TT_SBit_Strike* strike, TT_SBit_Range** arange, - TT_ULong* aglyph_offset ) + FT_ULong* aglyph_offset ) { TT_SBit_Range *range, *range_limit; @@ -657,7 +659,7 @@ if ( glyph_index >= range->first_glyph && glyph_index <= range->last_glyph ) { - TT_UShort delta = glyph_index - range->first_glyph; + FT_UShort delta = glyph_index - range->first_glyph; switch ( range->index_format ) @@ -675,7 +677,7 @@ case 4: case 5: { - TT_ULong n; + FT_ULong n; for ( n = 0; n < range->num_glyphs; n++ ) @@ -737,14 +739,14 @@ /* TT_Err_Invalid_Argument if no sbit exists for the requested glyph. */ /* */ static - TT_Error Find_SBit_Image( TT_Face face, - TT_UInt glyph_index, - TT_Int x_ppem, - TT_Int y_ppem, + FT_Error Find_SBit_Image( TT_Face face, + FT_UInt glyph_index, + FT_Int x_ppem, + FT_Int y_ppem, TT_SBit_Range** arange, TT_SBit_Strike** astrike, - TT_ULong* aglyph_offset ) + FT_ULong* aglyph_offset ) { TT_SBit_Strike* strike = face->sbit_strikes; TT_SBit_Strike* strike_limit = strike + face->num_sbit_strikes; @@ -757,7 +759,7 @@ { if ( strike->x_ppem == x_ppem && strike->y_ppem == y_ppem ) { - TT_Error error; + FT_Error error; error = Find_SBit_Range( glyph_index, strike, @@ -809,11 +811,11 @@ /* function exit. */ /* */ static - TT_Error Load_SBit_Metrics( FT_Stream stream, + FT_Error Load_SBit_Metrics( FT_Stream stream, TT_SBit_Range* range, TT_SBit_Metrics* metrics ) { - TT_Error error = TT_Err_Ok; + FT_Error error = TT_Err_Ok; switch ( range->image_format ) @@ -912,9 +914,9 @@ /* */ /***********************************************************************/ - TT_Int rows, count; - TT_Long line_len; - TT_Byte* line; + FT_Int rows, count; + FT_Long line_len; + FT_Byte* line; /***********************************************************************/ @@ -923,15 +925,15 @@ /* them if they're empty. */ /* */ { - line = (TT_Byte*)map->buffer; + line = (FT_Byte*)map->buffer; rows = map->rows; line_len = map->pitch; for ( count = 0; count < rows; count++ ) { - TT_Byte* cur = line; - TT_Byte* limit = line + line_len; + FT_Byte* cur = line; + FT_Byte* limit = line + line_len; for ( ; cur < limit; cur++ ) @@ -950,7 +952,7 @@ /* now, crop the empty upper lines */ if ( count > 0 ) { - line = (TT_Byte*)map->buffer; + line = (FT_Byte*)map->buffer; MEM_Move( line, line + count * line_len, (rows - count) * line_len ); @@ -968,12 +970,12 @@ /* second, crop the lower lines */ /* */ { - line = (TT_Byte*)map->buffer + (rows - 1) * line_len; + line = (FT_Byte*)map->buffer + (rows - 1) * line_len; for ( count = 0; count < rows; count++ ) { - TT_Byte* cur = line; - TT_Byte* limit = line + line_len; + FT_Byte* cur = line; + FT_Byte* limit = line + line_len; for ( ; cur < limit; cur++ ) @@ -999,10 +1001,10 @@ /* */ do { - TT_Byte* limit; + FT_Byte* limit; - line = (TT_Byte*)map->buffer; + line = (FT_Byte*)map->buffer; limit = line + rows * line_len; for ( ; line < limit; line += line_len ) @@ -1010,20 +1012,20 @@ goto Found_Left; /* shift the whole glyph one pixel to the left */ - line = (TT_Byte*)map->buffer; + line = (FT_Byte*)map->buffer; limit = line + rows * line_len; for ( ; line < limit; line += line_len ) { - TT_Int n, width = map->width; - TT_Byte old; - TT_Byte* cur = line; + FT_Int n, width = map->width; + FT_Byte old; + FT_Byte* cur = line; old = cur[0] << 1; for ( n = 8; n < width; n += 8 ) { - TT_Byte val; + FT_Byte val; val = cur[1]; @@ -1049,12 +1051,12 @@ /* */ do { - TT_Int right = map->width - 1; - TT_Byte* limit; - TT_Byte mask; + FT_Int right = map->width - 1; + FT_Byte* limit; + FT_Byte mask; - line = (TT_Byte*)map->buffer + ( right >> 3 ); + line = (FT_Byte*)map->buffer + ( right >> 3 ); limit = line + rows * line_len; mask = 0x80 >> ( right & 7 ); @@ -1080,15 +1082,15 @@ static - TT_Error Load_SBit_Single( FT_Bitmap* map, - TT_Int x_offset, - TT_Int y_offset, - TT_Int pix_bits, - TT_UShort image_format, + FT_Error Load_SBit_Single( FT_Bitmap* map, + FT_Int x_offset, + FT_Int y_offset, + FT_Int pix_bits, + FT_UShort image_format, TT_SBit_Metrics* metrics, FT_Stream stream ) { - TT_Error error; + FT_Error error; /* check that the source bitmap fits into the target pixmap */ @@ -1101,11 +1103,11 @@ } { - TT_Int glyph_width = metrics->width; - TT_Int glyph_height = metrics->height; - TT_Int glyph_size; - TT_Int line_bits = pix_bits * glyph_width; - TT_Bool pad_bytes = 0; + FT_Int glyph_width = metrics->width; + FT_Int glyph_height = metrics->height; + FT_Int glyph_size; + FT_Int line_bits = pix_bits * glyph_width; + FT_Bool pad_bytes = 0; /* compute size of glyph image */ @@ -1114,7 +1116,7 @@ case 1: /* byte-padded formats */ case 6: { - TT_Int line_length; + FT_Int line_length; switch ( pix_bits ) @@ -1148,7 +1150,7 @@ /* don't forget to multiply `x_offset' by `map->pix_bits' as */ /* the sbit blitter doesn't make a difference between pixmap */ /* depths. */ - blit_sbit( map, (TT_Byte*)stream->cursor, line_bits, pad_bytes, + blit_sbit( map, (FT_Byte*)stream->cursor, line_bits, pad_bytes, x_offset * pix_bits, y_offset ); FORGET_Frame(); @@ -1160,18 +1162,18 @@ static - TT_Error Load_SBit_Image( TT_SBit_Strike* strike, + FT_Error Load_SBit_Image( TT_SBit_Strike* strike, TT_SBit_Range* range, - TT_ULong ebdt_pos, - TT_ULong glyph_offset, + FT_ULong ebdt_pos, + FT_ULong glyph_offset, FT_Bitmap* map, - TT_Int x_offset, - TT_Int y_offset, + FT_Int x_offset, + FT_Int y_offset, FT_Stream stream, TT_SBit_Metrics* metrics ) { FT_Memory memory = stream->memory; - TT_Error error; + FT_Error error; /* place stream at beginning of glyph data and read metrics */ @@ -1188,7 +1190,7 @@ /* final pixmap buffer */ if ( map->buffer == 0 ) { - TT_Long size; + FT_Long size; map->width = metrics->width; @@ -1256,7 +1258,7 @@ { TT_SBit_Component* components; TT_SBit_Component* comp; - TT_UShort num_components, count; + FT_UShort num_components, count; if ( READ_UShort( num_components ) || @@ -1284,7 +1286,7 @@ { TT_SBit_Range* elem_range; TT_SBit_Metrics elem_metrics; - TT_ULong elem_offset; + FT_ULong elem_offset; /* find the range for this element */ @@ -1354,18 +1356,18 @@ /* The `map.buffer' field is always freed before the glyph is loaded. */ /* */ LOCAL_FUNC - TT_Error TT_Load_SBit_Image( TT_Face face, - TT_Int x_ppem, - TT_Int y_ppem, - TT_UInt glyph_index, - TT_UInt load_flags, + FT_Error TT_Load_SBit_Image( TT_Face face, + FT_Int x_ppem, + FT_Int y_ppem, + FT_UInt glyph_index, + FT_UInt load_flags, FT_Stream stream, FT_Bitmap* map, TT_SBit_Metrics* metrics ) { - TT_Error error; + FT_Error error; FT_Memory memory = stream->memory; - TT_ULong ebdt_pos, glyph_offset; + FT_ULong ebdt_pos, glyph_offset; TT_SBit_Strike* strike; TT_SBit_Range* range; @@ -1381,6 +1383,8 @@ /* the font file */ error = face->goto_table( face, TTAG_EBDT, stream, 0 ); if ( error ) + error = face->goto_table( face, TTAG_bdat, stream, 0 ); + if (error) goto Exit; ebdt_pos = FILE_Pos(); @@ -1403,8 +1407,8 @@ if ( strike->flags & 1 ) { /* in case of a horizontal strike only */ - TT_Int advance; - TT_Int top; + FT_Int advance; + FT_Int top; advance = strike->hori.ascender - strike->hori.descender; diff --git a/src/sfnt/ttsbit.h b/src/sfnt/ttsbit.h index 90ac39df8..4c5232ec0 100644 --- a/src/sfnt/ttsbit.h +++ b/src/sfnt/ttsbit.h @@ -23,18 +23,18 @@ LOCAL_DEF - TT_Error TT_Load_SBit_Strikes( TT_Face face, + FT_Error TT_Load_SBit_Strikes( TT_Face face, FT_Stream stream ); LOCAL_DEF void TT_Free_SBit_Strikes( TT_Face face ); LOCAL_DEF - TT_Error TT_Load_SBit_Image( TT_Face face, - TT_Int x_ppem, - TT_Int y_ppem, - TT_UInt glyph_index, - TT_UInt load_flags, + FT_Error TT_Load_SBit_Image( TT_Face face, + FT_Int x_ppem, + FT_Int y_ppem, + FT_UInt glyph_index, + FT_UInt load_flags, FT_Stream stream, FT_Bitmap* map, TT_SBit_Metrics* metrics ); diff --git a/src/truetype/ttdriver.c b/src/truetype/ttdriver.c index 55ef702ad..23b1b5cd0 100644 --- a/src/truetype/ttdriver.c +++ b/src/truetype/ttdriver.c @@ -49,8 +49,8 @@ #undef PAIR_TAG -#define PAIR_TAG( left, right ) ( ( (TT_ULong)left << 16 ) | \ - (TT_ULong)right ) +#define PAIR_TAG( left, right ) ( ( (FT_ULong)left << 16 ) | \ + (FT_ULong)right ) /*************************************************************************/ @@ -86,10 +86,10 @@ /* They can be implemented by format-specific interfaces. */ /* */ static - TT_Error Get_Kerning( TT_Face face, - TT_UInt left_glyph, - TT_UInt right_glyph, - TT_Vector* kerning ) + FT_Error Get_Kerning( TT_Face face, + FT_UInt left_glyph, + FT_UInt right_glyph, + FT_Vector* kerning ) { TT_Kern_0_Pair* pair; @@ -103,8 +103,8 @@ if ( face->kern_pairs ) { /* there are some kerning pairs in this font file! */ - TT_ULong search_tag = PAIR_TAG( left_glyph, right_glyph ); - TT_Long left, right; + FT_ULong search_tag = PAIR_TAG( left_glyph, right_glyph ); + FT_Long left, right; left = 0; @@ -112,8 +112,8 @@ while ( left <= right ) { - TT_Int middle = left + ( ( right - left ) >> 1 ); - TT_ULong cur_pair; + FT_Int middle = left + ( ( right - left ) >> 1 ); + FT_ULong cur_pair; pair = face->kern_pairs + middle; @@ -181,15 +181,15 @@ /* TrueType error code. 0 means success. */ /* */ static - TT_Error Set_Char_Sizes( TT_Size size, - TT_F26Dot6 char_width, - TT_F26Dot6 char_height, - TT_UInt horz_resolution, - TT_UInt vert_resolution ) + FT_Error Set_Char_Sizes( TT_Size size, + FT_F26Dot6 char_width, + FT_F26Dot6 char_height, + FT_UInt horz_resolution, + FT_UInt vert_resolution ) { FT_Size_Metrics* metrics = &size->root.metrics; TT_Face face = (TT_Face)size->root.face; - TT_Long dim_x, dim_y; + FT_Long dim_x, dim_y; /* This bit flag, when set, indicates that the pixel size must be */ @@ -210,8 +210,8 @@ metrics->x_scale = FT_DivFix( dim_x, face->root.units_per_EM ); metrics->y_scale = FT_DivFix( dim_y, face->root.units_per_EM ); - metrics->x_ppem = (TT_UShort)( dim_x >> 6 ); - metrics->y_ppem = (TT_UShort)( dim_y >> 6 ); + metrics->x_ppem = (FT_UShort)( dim_x >> 6 ); + metrics->y_ppem = (FT_UShort)( dim_y >> 6 ); } size->ttmetrics.valid = FALSE; @@ -241,9 +241,9 @@ /* TrueType error code. 0 means success. */ /* */ static - TT_Error Set_Pixel_Sizes( TT_Size size, - TT_UInt pixel_width, - TT_UInt pixel_height ) + FT_Error Set_Pixel_Sizes( TT_Size size, + FT_UInt pixel_width, + FT_UInt pixel_height ) { UNUSED( pixel_width ); UNUSED( pixel_height ); @@ -283,12 +283,12 @@ /* TrueType error code. 0 means success. */ /* */ static - TT_Error Load_Glyph( TT_GlyphSlot slot, + FT_Error Load_Glyph( TT_GlyphSlot slot, TT_Size size, - TT_UShort glyph_index, - TT_UInt load_flags ) + FT_UShort glyph_index, + FT_UInt load_flags ) { - TT_Error error; + FT_Error error; if ( !slot ) @@ -353,10 +353,10 @@ /* Glyph index. 0 means `undefined character code'. */ /* */ static - TT_UInt Get_Char_Index( TT_CharMap charmap, - TT_Long charcode ) + FT_UInt Get_Char_Index( TT_CharMap charmap, + FT_Long charcode ) { - TT_Error error; + FT_Error error; TT_Face face; TT_CMapTable* cmap; diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c index 20cd40ac0..a1be11f21 100644 --- a/src/truetype/ttgload.c +++ b/src/truetype/ttgload.c @@ -56,6 +56,7 @@ #define USE_MY_METRICS 0x200 + /*************************************************************************/ /* */ /* */ @@ -83,12 +84,12 @@ /* */ LOCAL_FUNC void TT_Get_Metrics( TT_HoriHeader* header, - TT_UInt index, - TT_Short* bearing, - TT_UShort* advance ) + FT_UInt index, + FT_Short* bearing, + FT_UShort* advance ) { TT_LongMetrics* longs_m; - TT_UShort k = header->number_Of_HMetrics; + FT_UShort k = header->number_Of_HMetrics; if ( index < k ) @@ -113,10 +114,10 @@ /* */ static void Get_HMetrics( TT_Face face, - TT_UInt index, - TT_Bool check, - TT_Short* lsb, - TT_UShort* aw ) + FT_UInt index, + FT_Bool check, + FT_Short* lsb, + FT_UShort* aw ) { TT_Get_Metrics( &face->horizontal, index, lsb, aw ); @@ -131,11 +132,10 @@ /* found in the font's `hdmx' table (if any). */ /* */ static - TT_Byte* Get_Advance_Widths( TT_Face face, - TT_UShort ppem ) + FT_Byte* Get_Advance_Widths( TT_Face face, + FT_UShort ppem ) { - TT_UShort n; - + FT_UShort n; for ( n = 0; n < face->hdmx.num_records; n++ ) if ( face->hdmx.records[n].ppem == ppem ) @@ -146,10 +146,10 @@ #define cur_to_org( n, zone ) \ - MEM_Copy( (zone)->org, (zone)->cur, n * sizeof ( TT_Vector ) ) + MEM_Copy( (zone)->org, (zone)->cur, n * sizeof ( FT_Vector ) ) #define org_to_cur( n, zone ) \ - MEM_Copy( (zone)->cur, (zone)->org, n * sizeof ( TT_Vector ) ) + MEM_Copy( (zone)->cur, (zone)->org, n * sizeof ( FT_Vector ) ) /*************************************************************************/ @@ -157,13 +157,12 @@ /* Translates an array of coordinates. */ /* */ static - void translate_array( TT_UInt n, - TT_Vector* coords, - TT_Pos delta_x, - TT_Pos delta_y ) + void translate_array( FT_UInt n, + FT_Vector* coords, + FT_Pos delta_x, + FT_Pos delta_y ) { - TT_UInt k; - + FT_UInt k; if ( delta_x ) for ( k = 0; k < n; k++ ) @@ -181,12 +180,11 @@ /* assemble composite glyphs. */ /* */ static - void mount_zone( FT_GlyphZone* source, - FT_GlyphZone* target ) + void mount_zone( TT_GlyphZone* source, + TT_GlyphZone* target ) { - TT_UInt np; - TT_Int nc; - + FT_UInt np; + FT_Int nc; np = source->n_points; nc = source->n_contours; @@ -217,18 +215,18 @@ /* glyphs elements will be loaded with this routine. */ /* */ static - TT_Error Load_Simple( TT_Loader* load, - TT_UInt byte_count, - TT_Int n_contours, - TT_Bool debug ) + FT_Error Load_Simple( TT_Loader* load, + FT_UInt byte_count, + FT_Int n_contours, + FT_Bool debug ) { - TT_Error error; + FT_Error error; FT_Stream stream = load->stream; - FT_GlyphZone* zone = &load->zone; + TT_GlyphZone* zone = &load->zone; TT_Face face = load->face; - TT_UShort n_ins; - TT_Int n, n_points; + FT_UShort n_ins; + FT_Int n, n_points; /* simple check */ @@ -304,9 +302,9 @@ /* reading the point tags */ { - TT_Byte* flag = load->zone.tags; - TT_Byte* limit = flag + n_points; - TT_Byte c, count; + FT_Byte* flag = load->zone.tags; + FT_Byte* limit = flag + n_points; + FT_Byte c, count; for ( ; flag < limit; flag++ ) @@ -323,15 +321,15 @@ /* reading the X coordinates */ { - TT_Vector* vec = zone->org; - TT_Vector* limit = vec + n_points; - TT_Byte* flag = zone->tags; - TT_Pos x = 0; + FT_Vector* vec = zone->org; + FT_Vector* limit = vec + n_points; + FT_Byte* flag = zone->tags; + FT_Pos x = 0; for ( ; vec < limit; vec++, flag++ ) { - TT_Pos y = 0; + FT_Pos y = 0; if ( *flag & 2 ) @@ -351,15 +349,15 @@ /* reading the Y coordinates */ { - TT_Vector* vec = zone->org; - TT_Vector* limit = vec + n_points; - TT_Byte* flag = zone->tags; - TT_Pos x = 0; + FT_Vector* vec = zone->org; + FT_Vector* limit = vec + n_points; + FT_Byte* flag = zone->tags; + FT_Pos x = 0; for ( ; vec < limit; vec++, flag++ ) { - TT_Pos y = 0; + FT_Pos y = 0; if ( *flag & 4 ) @@ -384,8 +382,8 @@ /* We need the left side bearing and advance width. */ { - TT_Vector* pp1; - TT_Vector* pp2; + FT_Vector* pp1; + FT_Vector* pp2; /* pp1 = xMin - lsb */ @@ -422,10 +420,10 @@ } else { - TT_Vector* vec = zone->org; - TT_Vector* limit = vec + n_points; - TT_Fixed x_scale = load->size->root.metrics.x_scale; - TT_Fixed y_scale = load->size->root.metrics.y_scale; + FT_Vector* vec = zone->org; + FT_Vector* limit = vec + n_points; + FT_Fixed x_scale = load->size->root.metrics.x_scale; + FT_Fixed y_scale = load->size->root.metrics.y_scale; /* first scale the glyph points */ @@ -442,7 +440,7 @@ } else { - TT_Pos x = zone->org[n_points-2].x; + FT_Pos x = zone->org[n_points-2].x; x = ( ( x + 32 ) & -64 ) - x; @@ -457,7 +455,7 @@ if ( n_ins > 0 ) { load->exec->is_composite = FALSE; - load->exec->pedantic_hinting = (TT_Bool)(load->load_flags & + load->exec->pedantic_hinting = (FT_Bool)(load->load_flags & FT_LOAD_PEDANTIC); load->exec->pts = *zone; load->exec->pts.n_points += 2; @@ -495,22 +493,22 @@ /* TT_Loader object. */ /* */ static - TT_Error load_truetype_glyph( TT_Loader* loader, - TT_UInt glyph_index ) + FT_Error load_truetype_glyph( TT_Loader* loader, + FT_UInt glyph_index ) { FT_Stream stream = loader->stream; - TT_Error error; + FT_Error error; TT_Face face = loader->face; - TT_ULong offset; - TT_Int num_subglyphs = 0, contours_count; - TT_UInt index, num_points, num_contours, count; - TT_Fixed x_scale, y_scale; - TT_ULong ins_offset; + FT_ULong offset; + FT_Int num_subglyphs = 0, contours_count; + FT_UInt index, num_points, num_contours, count; + FT_Fixed x_scale, y_scale; + FT_ULong ins_offset; /* check glyph index */ index = glyph_index; - if ( index >= (TT_UInt)face->root.num_glyphs ) + if ( index >= (FT_UInt)face->root.num_glyphs ) { error = TT_Err_Invalid_Glyph_Index; goto Fail; @@ -531,12 +529,12 @@ /* get horizontal metrics */ { - TT_Short left_bearing; - TT_UShort advance_width; + FT_Short left_bearing; + FT_UShort advance_width; Get_HMetrics( face, index, - (TT_Bool)!(loader->load_flags & + (FT_Bool)!(loader->load_flags & FT_LOAD_IGNORE_GLOBAL_ADVANCE_WIDTH), &left_bearing, &advance_width ); @@ -549,7 +547,7 @@ offset = face->glyph_locations[index]; count = 0; - if ( index < (TT_UInt)face->num_locations - 1 ) + if ( index < (FT_UInt)face->num_locations - 1 ) count = face->glyph_locations[index + 1] - offset; if ( count == 0 ) @@ -624,14 +622,14 @@ if ( contours_count >= 0 ) { - TT_UInt num_base_points; + FT_UInt num_base_points; #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER error = Load_Simple( loader, count, contours_count, - (TT_Bool)( loader->size && + (FT_Bool)( loader->size && loader->size->debug ) ); #else error = Load_Simple( loader, count, contours_count, 0 ); @@ -646,7 +644,7 @@ num_base_points = loader->base.n_points; { - TT_UInt k; + FT_UInt k; for ( k = 0; k < num_contours; k++ ) @@ -680,8 +678,8 @@ num_subglyphs = 0; do { - TT_Fixed xx, xy, yy, yx; - TT_UInt total_subglyphs; + FT_Fixed xx, xy, yy, yx; + FT_UInt total_subglyphs; /* grow the `glyph->subglyphs' table if necessary */ @@ -689,7 +687,7 @@ if ( total_subglyphs >= glyph->max_subglyphs ) { - TT_UInt new_max = glyph->max_subglyphs; + FT_UInt new_max = glyph->max_subglyphs; FT_Memory memory = loader->face->root.memory; @@ -727,20 +725,20 @@ if ( subglyph->flags & WE_HAVE_A_SCALE ) { - xx = (TT_Fixed)GET_Short() << 2; + xx = (FT_Fixed)GET_Short() << 2; yy = xx; } else if ( subglyph->flags & WE_HAVE_AN_XY_SCALE ) { - xx = (TT_Fixed)GET_Short() << 2; - yy = (TT_Fixed)GET_Short() << 2; + xx = (FT_Fixed)GET_Short() << 2; + yy = (FT_Fixed)GET_Short() << 2; } else if ( subglyph->flags & WE_HAVE_A_2X2 ) { - xx = (TT_Fixed)GET_Short() << 2; - xy = (TT_Fixed)GET_Short() << 2; - yx = (TT_Fixed)GET_Short() << 2; - yy = (TT_Fixed)GET_Short() << 2; + xx = (FT_Fixed)GET_Short() << 2; + xy = (FT_Fixed)GET_Short() << 2; + yx = (FT_Fixed)GET_Short() << 2; + yy = (FT_Fixed)GET_Short() << 2; } subglyph->transform.xx = xx; @@ -784,7 +782,7 @@ /*********************************************************************/ /* Now, read each subglyph independently.. */ { - TT_Int n, num_base_points, num_new_points; + FT_Int n, num_base_points, num_new_points; subglyph = glyph->subglyphs + glyph->num_subglyphs; glyph->num_subglyphs += num_subglyphs; @@ -792,8 +790,8 @@ for ( n = 0; n < num_subglyphs; n++, subglyph++ ) { - TT_Vector pp1, pp2; - TT_Pos x, y; + FT_Vector pp1, pp2; + FT_Pos x, y; pp1 = loader->pp1; @@ -827,14 +825,14 @@ WE_HAVE_AN_XY_SCALE | WE_HAVE_A_2X2 ) ) { - TT_Vector* cur = loader->zone.cur; - TT_Vector* org = loader->zone.org; - TT_Vector* limit = cur + num_new_points; + FT_Vector* cur = loader->zone.cur; + FT_Vector* org = loader->zone.org; + FT_Vector* limit = cur + num_new_points; for ( ; cur < limit; cur++, org++ ) { - TT_Pos nx, ny; + FT_Pos nx, ny; nx = FT_MulFix( cur->x, subglyph->transform.xx ) + @@ -861,12 +859,12 @@ if ( !( subglyph->flags & ARGS_ARE_XY_VALUES ) ) { - TT_Int k = subglyph->arg1; - TT_UInt l = subglyph->arg2; + FT_Int k = subglyph->arg1; + FT_UInt l = subglyph->arg2; if ( k >= num_base_points || - l >= (TT_UInt)num_new_points ) + l >= (FT_UInt)num_new_points ) { error = TT_Err_Invalid_Composite; goto Fail; @@ -913,11 +911,11 @@ loader->exec && subglyph->flags & WE_HAVE_INSTR ) { - TT_UShort n_ins; + FT_UShort n_ins; TT_ExecContext exec = loader->exec; - TT_UInt n_points = loader->base.n_points; - FT_GlyphZone* pts; - TT_Vector* pp1; + FT_UInt n_points = loader->base.n_points; + TT_GlyphZone* pts; + FT_Vector* pp1; /* read size of instructions */ @@ -973,7 +971,7 @@ } { - TT_UInt k; + FT_UInt k; for ( k = 0; k < n_points; k++ ) @@ -987,7 +985,7 @@ { exec->is_composite = TRUE; exec->pedantic_hinting = - (TT_Bool)(loader->load_flags & FT_LOAD_PEDANTIC); + (FT_Bool)(loader->load_flags & FT_LOAD_PEDANTIC); error = TT_Run_Context( exec, loader->size->debug ); if ( error && exec->pedantic_hinting ) @@ -1018,13 +1016,13 @@ static void compute_glyph_metrics( TT_Loader* loader, - TT_UInt glyph_index ) + FT_UInt glyph_index ) { - TT_UInt num_points = loader->base.n_points; - TT_UInt num_contours = loader->base.n_contours; - TT_BBox bbox; + FT_UInt num_points = loader->base.n_points; + FT_UInt num_contours = loader->base.n_contours; + FT_BBox bbox; TT_Face face = loader->face; - TT_Fixed x_scale, y_scale; + FT_Fixed x_scale, y_scale; TT_GlyphSlot glyph = loader->glyph; TT_Size size = loader->size; @@ -1048,7 +1046,7 @@ if ( glyph->format != ft_glyph_format_composite ) { - TT_UInt u; + FT_UInt u; for ( u = 0; u < num_points + 2; u++ ) @@ -1065,7 +1063,7 @@ glyph->outline.n_contours = num_contours; /* translate array so that (0,0) is the glyph's origin */ - translate_array( (TT_UShort)( num_points + 2 ), + translate_array( (FT_UShort)( num_points + 2 ), glyph->outline.points, -loader->pp1.x, 0 ); @@ -1087,10 +1085,10 @@ /* get the device-independent scaled horizontal metrics; */ /* take care of fixed-pitch fonts... */ { - TT_Pos left_bearing; - TT_Pos advance; + FT_Pos left_bearing; + FT_Pos advance; - TT_Pos lsb2, adv2; + FT_Pos lsb2, adv2; left_bearing = loader->left_bearing; @@ -1113,8 +1111,8 @@ if ( !( loader->load_flags & FT_LOAD_NO_SCALE ) && loader->load_flags & FT_LOAD_LINEAR ) { - TT_Pos em_size = face->root.units_per_EM; - TT_Pos pixel_size = (TT_Pos)face->root.size->metrics.x_ppem << 16; + FT_Pos em_size = face->root.units_per_EM; + FT_Pos pixel_size = (FT_Pos)face->root.size->metrics.x_ppem << 16; lsb2 = FT_MulDiv( lsb2, pixel_size, em_size ); @@ -1133,13 +1131,13 @@ /* up some metrics by `hand'... */ { - TT_Short top_bearing; /* vertical top side bearing (EM units) */ - TT_UShort advance_height; /* vertical advance height (EM units) */ + FT_Short top_bearing; /* vertical top side bearing (EM units) */ + FT_UShort advance_height; /* vertical advance height (EM units) */ - TT_Pos left; /* scaled vertical left side bearing */ - TT_Pos Top; /* scaled original vertical top side bearing */ - TT_Pos top; /* scaled vertical top side bearing */ - TT_Pos advance; /* scaled vertical advance height */ + FT_Pos left; /* scaled vertical left side bearing */ + FT_Pos Top; /* scaled original vertical top side bearing */ + FT_Pos top; /* scaled vertical top side bearing */ + FT_Pos advance; /* scaled vertical advance height */ /* Get the unscaled `tsb' and `ah' */ @@ -1171,14 +1169,14 @@ if ( face->os2.version != 0xFFFF ) { top_bearing = face->os2.sTypoLineGap / 2; - advance_height = (TT_UShort)( face->os2.sTypoAscender - + advance_height = (FT_UShort)( face->os2.sTypoAscender - face->os2.sTypoDescender + face->os2.sTypoLineGap ); } else { top_bearing = face->horizontal.Line_Gap / 2; - advance_height = (TT_UShort)( face->horizontal.Ascender + + advance_height = (FT_UShort)( face->horizontal.Ascender + face->horizontal.Descender + face->horizontal.Line_Gap ); } @@ -1205,16 +1203,16 @@ /* compute metrics2 fields */ { - TT_Pos vtb2 = top_bearing; - TT_Pos adv2 = advance_height; + FT_Pos vtb2 = top_bearing; + FT_Pos adv2 = advance_height; /* scale to 16.16 format if required */ if ( !( loader->load_flags & FT_LOAD_NO_SCALE ) && loader->load_flags & FT_LOAD_LINEAR ) { - TT_Pos em_size = face->root.units_per_EM; - TT_Pos pixel_size = face->root.size->metrics.y_ppem; + FT_Pos em_size = face->root.units_per_EM; + FT_Pos pixel_size = face->root.size->metrics.y_ppem; vtb2 = FT_MulDiv( vtb2, pixel_size, em_size ); @@ -1247,7 +1245,7 @@ if ( !face->postscript.isFixedPitch && size && IS_HINTED( loader->load_flags ) ) { - TT_Byte* widths = Get_Advance_Widths( face, + FT_Byte* widths = Get_Advance_Widths( face, size->root.metrics.x_ppem ); if ( widths ) glyph->metrics.horiAdvance = widths[glyph_index] << 6; @@ -1257,7 +1255,7 @@ #if 0 #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER if ( loader->exec ) - glyph->outline.dropout_mode = (TT_Char)loader->exec->GS.scan_type; + glyph->outline.dropout_mode = (FT_Char)loader->exec->GS.scan_type; #else glyph->outline.dropout_mode = 2; #endif @@ -1298,18 +1296,18 @@ /* TrueType error code. 0 means success. */ /* */ LOCAL_FUNC - TT_Error TT_Load_Glyph( TT_Size size, + FT_Error TT_Load_Glyph( TT_Size size, TT_GlyphSlot glyph, - TT_UShort glyph_index, - TT_UInt load_flags ) + FT_UShort glyph_index, + FT_UInt load_flags ) { SFNT_Interface* sfnt; TT_Face face; FT_Stream stream; FT_Memory memory; - TT_Error error; + FT_Error error; TT_Loader loader; - FT_GlyphZone* zone; + TT_GlyphZone* zone; face = (TT_Face)glyph->face; @@ -1352,16 +1350,16 @@ glyph->outline.n_points = 0; glyph->outline.n_contours = 0; - glyph->metrics.width = (TT_Pos)metrics.width << 6; - glyph->metrics.height = (TT_Pos)metrics.height << 6; + glyph->metrics.width = (FT_Pos)metrics.width << 6; + glyph->metrics.height = (FT_Pos)metrics.height << 6; - glyph->metrics.horiBearingX = (TT_Pos)metrics.horiBearingX << 6; - glyph->metrics.horiBearingY = (TT_Pos)metrics.horiBearingY << 6; - glyph->metrics.horiAdvance = (TT_Pos)metrics.horiAdvance << 6; + glyph->metrics.horiBearingX = (FT_Pos)metrics.horiBearingX << 6; + glyph->metrics.horiBearingY = (FT_Pos)metrics.horiBearingY << 6; + glyph->metrics.horiAdvance = (FT_Pos)metrics.horiAdvance << 6; - glyph->metrics.vertBearingX = (TT_Pos)metrics.vertBearingX << 6; - glyph->metrics.vertBearingY = (TT_Pos)metrics.vertBearingY << 6; - glyph->metrics.vertAdvance = (TT_Pos)metrics.vertAdvance << 6; + glyph->metrics.vertBearingX = (FT_Pos)metrics.vertBearingX << 6; + glyph->metrics.vertBearingY = (FT_Pos)metrics.vertBearingY << 6; + glyph->metrics.vertAdvance = (FT_Pos)metrics.vertAdvance << 6; glyph->format = ft_glyph_format_bitmap; return error; @@ -1388,7 +1386,7 @@ /* update the glyph zone bounds */ zone = &((TT_Driver)face->root.driver)->zone; - error = FT_Update_GlyphZone( zone, + error = TT_Update_GlyphZone( zone, face->root.max_points, face->root.max_contours ); if ( error ) diff --git a/src/truetype/ttgload.h b/src/truetype/ttgload.h index 47cc2fbb4..9d5432c98 100644 --- a/src/truetype/ttgload.h +++ b/src/truetype/ttgload.h @@ -35,30 +35,30 @@ TT_Size size; TT_GlyphSlot glyph; - TT_ULong load_flags; - TT_UInt glyph_index; + FT_ULong load_flags; + FT_UInt glyph_index; FT_Stream stream; - TT_Int byte_len; - TT_Int left_points; - TT_Int left_contours; + FT_Int byte_len; + FT_Int left_points; + FT_Int left_contours; - TT_BBox bbox; - TT_Int left_bearing; - TT_Int advance; - TT_Bool preserve_pps; - TT_Vector pp1; - TT_Vector pp2; + FT_BBox bbox; + FT_Int left_bearing; + FT_Int advance; + FT_Bool preserve_pps; + FT_Vector pp1; + FT_Vector pp2; - TT_ULong glyf_offset; + FT_ULong glyf_offset; /* the zone where we load our glyphs */ - FT_GlyphZone base; - FT_GlyphZone zone; + TT_GlyphZone base; + TT_GlyphZone zone; #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER TT_ExecContext exec; - TT_Byte* instructions; + FT_Byte* instructions; #endif } TT_Loader; @@ -66,15 +66,15 @@ LOCAL_DEF void TT_Get_Metrics( TT_HoriHeader* header, - TT_UInt index, - TT_Short* bearing, - TT_UShort* advance ); + FT_UInt index, + FT_Short* bearing, + FT_UShort* advance ); LOCAL_DEF - TT_Error TT_Load_Glyph( TT_Size size, + FT_Error TT_Load_Glyph( TT_Size size, TT_GlyphSlot glyph, - TT_UShort glyph_index, - TT_UInt load_flags ); + FT_UShort glyph_index, + FT_UInt load_flags ); #ifdef __cplusplus } diff --git a/src/truetype/ttinterp.c b/src/truetype/ttinterp.c index 3701ce898..f98008e1e 100644 --- a/src/truetype/ttinterp.c +++ b/src/truetype/ttinterp.c @@ -114,7 +114,7 @@ /* */ /* The instruction argument stack. */ /* */ -#define INS_ARG EXEC_OP_ TT_Long* args /* see ttobjs.h for EXEC_OP_ */ +#define INS_ARG EXEC_OP_ FT_Long* args /* see ttobjs.h for EXEC_OP_ */ /*************************************************************************/ @@ -222,7 +222,7 @@ /* */ /* A simple bounds-checking macro. */ /* */ -#define BOUNDS( x, n ) ( (TT_UInt)(x) >= (TT_UInt)(n) ) +#define BOUNDS( x, n ) ( (FT_UInt)(x) >= (FT_UInt)(n) ) #undef SUCCESS @@ -260,9 +260,9 @@ /* TrueType error code. 0 means success. */ /* */ LOCAL_FUNC - TT_Error TT_Goto_CodeRange( TT_ExecContext exec, - TT_Int range, - TT_Long IP ) + FT_Error TT_Goto_CodeRange( TT_ExecContext exec, + FT_Int range, + FT_Long IP ) { TT_CodeRange* coderange; @@ -277,7 +277,7 @@ /* which will return to the first byte *after* the code */ /* range, we test for IP <= Size instead of IP < Size. */ /* */ - FT_Assert( (TT_ULong)IP <= coderange->size ); + FT_Assert( (FT_ULong)IP <= coderange->size ); exec->code = coderange->base; exec->codeSize = coderange->size; @@ -310,14 +310,14 @@ /* TrueType error code. 0 means success. */ /* */ LOCAL_FUNC - TT_Error TT_Set_CodeRange( TT_ExecContext exec, - TT_Int range, + FT_Error TT_Set_CodeRange( TT_ExecContext exec, + FT_Int range, void* base, - TT_Long length ) + FT_Long length ) { FT_Assert( range >= 1 && range <= 3 ); - exec->codeRangeTable[range - 1].base = (TT_Byte*)base; + exec->codeRangeTable[range - 1].base = (FT_Byte*)base; exec->codeRangeTable[range - 1].size = length; return TT_Err_Ok; @@ -345,8 +345,8 @@ /* Does not set the Error variable. */ /* */ LOCAL_FUNC - TT_Error TT_Clear_CodeRange( TT_ExecContext exec, - TT_Int range ) + FT_Error TT_Clear_CodeRange( TT_ExecContext exec, + FT_Int range ) { FT_Assert( range >= 1 && range <= 3 ); @@ -384,7 +384,7 @@ /* Only the glyph loader and debugger should call this function. */ /* */ LOCAL_FUNC - TT_Error TT_Destroy_Context( TT_ExecContext exec, + FT_Error TT_Destroy_Context( TT_ExecContext exec, FT_Memory memory ) { /* free composite load stack */ @@ -436,11 +436,11 @@ /* TrueType error code. 0 means success. */ /* */ static - TT_Error Init_Context( TT_ExecContext exec, + FT_Error Init_Context( TT_ExecContext exec, TT_Face face, FT_Memory memory ) { - TT_Error error; + FT_Error error; FT_TRACE1(( "TT.Create_Create: new object at 0x%08p, parent = 0x%08p\n", @@ -507,13 +507,13 @@ /* TrueType error code. 0 means success. */ /* */ static - TT_Error Update_Max( FT_Memory memory, - TT_ULong* size, - TT_Long multiplier, + FT_Error Update_Max( FT_Memory memory, + FT_ULong* size, + FT_Long multiplier, void** buff, - TT_ULong new_max ) + FT_ULong new_max ) { - TT_Error error; + FT_Error error; if ( *size < new_max ) @@ -552,14 +552,14 @@ /* Only the glyph loader and debugger should call this function. */ /* */ LOCAL_FUNC - TT_Error TT_Load_Context( TT_ExecContext exec, + FT_Error TT_Load_Context( TT_ExecContext exec, TT_Face face, TT_Size size ) { - TT_Int i; - TT_ULong tmp; + FT_Int i; + FT_ULong tmp; TT_MaxProfile* maxp; - TT_Error error; + FT_Error error; exec->face = face; @@ -608,20 +608,20 @@ tmp = exec->stackSize; error = Update_Max( exec->memory, &tmp, - sizeof ( TT_F26Dot6 ), + sizeof ( FT_F26Dot6 ), (void**)&exec->stack, maxp->maxStackElements + 32 ); - exec->stackSize = (TT_UInt)tmp; + exec->stackSize = (FT_UInt)tmp; if ( error ) return error; tmp = exec->glyphSize; error = Update_Max( exec->memory, &tmp, - sizeof ( TT_Byte ), + sizeof ( FT_Byte ), (void**)&exec->glyphIns, maxp->maxSizeOfInstructions ); - exec->glyphSize = (TT_UShort)tmp; + exec->glyphSize = (FT_UShort)tmp; if ( error ) return error; @@ -655,10 +655,10 @@ /* Only the glyph loader and debugger should call this function. */ /* */ LOCAL_FUNC - TT_Error TT_Save_Context( TT_ExecContext exec, + FT_Error TT_Save_Context( TT_ExecContext exec, TT_Size size ) { - TT_Int i; + FT_Int i; /* XXXX: Will probably disappear soon with all the code range */ @@ -702,10 +702,10 @@ /* Only the glyph loader and debugger should call this function. */ /* */ LOCAL_FUNC - TT_Error TT_Run_Context( TT_ExecContext exec, - TT_Bool debug ) + FT_Error TT_Run_Context( TT_ExecContext exec, + FT_Bool debug ) { - TT_Error error; + FT_Error error; if ( ( error = TT_Goto_CodeRange( exec, tt_coderange_glyph, 0 ) ) @@ -796,7 +796,7 @@ if ( !driver->context ) { - TT_Error error; + FT_Error error; /* allocate object */ @@ -840,7 +840,7 @@ /* Only the glyph loader and debugger should call this function. */ /* */ LOCAL_FUNC - TT_Error TT_Done_Context( TT_ExecContext exec ) + FT_Error TT_Done_Context( TT_ExecContext exec ) { /* Nothing at all for now */ UNUSED( exec ); @@ -851,8 +851,8 @@ #ifdef FT_CONFIG_OPTION_OLD_CALCS - static TT_F26Dot6 Norm( TT_F26Dot6 X, - TT_F26Dot6 Y ) + static FT_F26Dot6 Norm( FT_F26Dot6 X, + FT_F26Dot6 Y ) { TT_INT64 T1, T2; @@ -862,7 +862,7 @@ ADD_64( T1, T2, T1 ); - return (TT_F26Dot6)SQRT_64( T1 ); + return (FT_F26Dot6)SQRT_64( T1 ); } #endif /* FT_CONFIG_OPTION_OLD_CALCS */ @@ -896,7 +896,7 @@ static - const TT_Byte Pop_Push_Count[256] = + const FT_Byte Pop_Push_Count[256] = { /* opcodes are gathered in groups of 16 */ /* please keep the spaces as they are */ @@ -1176,7 +1176,7 @@ static - const TT_Char opcode_length[256] = + const FT_Char opcode_length[256] = { 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, @@ -1200,14 +1200,14 @@ }; static - const TT_Vector Null_Vector = {0,0}; + const FT_Vector Null_Vector = {0,0}; #undef PACK #undef NULL_Vector -#define NULL_Vector (TT_Vector*)&Null_Vector +#define NULL_Vector (FT_Vector*)&Null_Vector /*************************************************************************/ @@ -1223,7 +1223,7 @@ /* The aspect ratio in 16.16 format, always <= 1.0 . */ /* */ static - TT_Long Current_Ratio( EXEC_OP ) + FT_Long Current_Ratio( EXEC_OP ) { if ( CUR.tt_metrics.ratio ) return CUR.tt_metrics.ratio; @@ -1236,7 +1236,7 @@ else { - TT_Long x, y; + FT_Long x, y; #ifdef FT_CONFIG_OPTION_OLD_CALCS x = TT_MULDIV( CUR.GS.projVector.x, CUR.tt_metrics.x_ratio, 0x4000 ); y = TT_MULDIV( CUR.GS.projVector.y, CUR.tt_metrics.y_ratio, 0x4000 ); @@ -1253,7 +1253,7 @@ static - TT_Long Current_Ppem( EXEC_OP ) + FT_Long Current_Ppem( EXEC_OP ) { return TT_MULFIX( CUR.tt_metrics.ppem, CURRENT_Ratio() ); } @@ -1267,45 +1267,45 @@ static - TT_F26Dot6 Read_CVT( EXEC_OP_ TT_ULong index ) + FT_F26Dot6 Read_CVT( EXEC_OP_ FT_ULong index ) { return CUR.cvt[index]; } static - TT_F26Dot6 Read_CVT_Stretched( EXEC_OP_ TT_ULong index ) + FT_F26Dot6 Read_CVT_Stretched( EXEC_OP_ FT_ULong index ) { return TT_MULFIX( CUR.cvt[index], CURRENT_Ratio() ); } static - void Write_CVT( EXEC_OP_ TT_ULong index, - TT_F26Dot6 value ) + void Write_CVT( EXEC_OP_ FT_ULong index, + FT_F26Dot6 value ) { CUR.cvt[index] = value; } static - void Write_CVT_Stretched( EXEC_OP_ TT_ULong index, - TT_F26Dot6 value ) + void Write_CVT_Stretched( EXEC_OP_ FT_ULong index, + FT_F26Dot6 value ) { CUR.cvt[index] = FT_DivFix( value, CURRENT_Ratio() ); } static - void Move_CVT( EXEC_OP_ TT_ULong index, - TT_F26Dot6 value ) + void Move_CVT( EXEC_OP_ FT_ULong index, + FT_F26Dot6 value ) { CUR.cvt[index] += value; } static - void Move_CVT_Stretched( EXEC_OP_ TT_ULong index, - TT_F26Dot6 value ) + void Move_CVT_Stretched( EXEC_OP_ FT_ULong index, + FT_F26Dot6 value ) { CUR.cvt[index] += FT_DivFix( value, CURRENT_Ratio() ); } @@ -1326,11 +1326,11 @@ /* */ /* This one could become a macro. */ /* */ - static TT_Short GetShortIns( EXEC_OP ) + static FT_Short GetShortIns( EXEC_OP ) { /* Reading a byte stream so there is no endianess (DaveP) */ CUR.IP += 2; - return (TT_Short)( ( CUR.code[CUR.IP - 2] << 8 ) + + return (FT_Short)( ( CUR.code[CUR.IP - 2] << 8 ) + CUR.code[CUR.IP - 1] ); } @@ -1352,8 +1352,8 @@ /* SUCCESS or FAILURE. */ /* */ static - TT_Bool Ins_Goto_CodeRange( EXEC_OP_ TT_Int aRange, - TT_ULong aIP ) + FT_Bool Ins_Goto_CodeRange( EXEC_OP_ FT_Int aRange, + FT_ULong aIP ) { TT_CodeRange* range; @@ -1409,11 +1409,11 @@ /* zone :: The affected glyph zone. */ /* */ static - void Direct_Move( EXEC_OP_ FT_GlyphZone* zone, - TT_UShort point, - TT_F26Dot6 distance ) + void Direct_Move( EXEC_OP_ TT_GlyphZone* zone, + FT_UShort point, + FT_F26Dot6 distance ) { - TT_F26Dot6 v; + FT_F26Dot6 v; v = CUR.GS.freeVector.x; @@ -1458,9 +1458,9 @@ /*************************************************************************/ static - void Direct_Move_X( EXEC_OP_ FT_GlyphZone* zone, - TT_UShort point, - TT_F26Dot6 distance ) + void Direct_Move_X( EXEC_OP_ TT_GlyphZone* zone, + FT_UShort point, + FT_F26Dot6 distance ) { UNUSED_EXEC; @@ -1470,9 +1470,9 @@ static - void Direct_Move_Y( EXEC_OP_ FT_GlyphZone* zone, - TT_UShort point, - TT_F26Dot6 distance ) + void Direct_Move_Y( EXEC_OP_ TT_GlyphZone* zone, + FT_UShort point, + FT_F26Dot6 distance ) { UNUSED_EXEC; @@ -1504,10 +1504,10 @@ /* before rounding. */ /* */ static - TT_F26Dot6 Round_None( EXEC_OP_ TT_F26Dot6 distance, - TT_F26Dot6 compensation ) + FT_F26Dot6 Round_None( EXEC_OP_ FT_F26Dot6 distance, + FT_F26Dot6 compensation ) { - TT_F26Dot6 val; + FT_F26Dot6 val; UNUSED_EXEC; @@ -1544,10 +1544,10 @@ /* Rounded distance. */ /* */ static - TT_F26Dot6 Round_To_Grid( EXEC_OP_ TT_F26Dot6 distance, - TT_F26Dot6 compensation ) + FT_F26Dot6 Round_To_Grid( EXEC_OP_ FT_F26Dot6 distance, + FT_F26Dot6 compensation ) { - TT_F26Dot6 val; + FT_F26Dot6 val; UNUSED_EXEC; @@ -1588,10 +1588,10 @@ /* Rounded distance. */ /* */ static - TT_F26Dot6 Round_To_Half_Grid( EXEC_OP_ TT_F26Dot6 distance, - TT_F26Dot6 compensation ) + FT_F26Dot6 Round_To_Half_Grid( EXEC_OP_ FT_F26Dot6 distance, + FT_F26Dot6 compensation ) { - TT_F26Dot6 val; + FT_F26Dot6 val; UNUSED_EXEC; @@ -1630,10 +1630,10 @@ /* Rounded distance. */ /* */ static - TT_F26Dot6 Round_Down_To_Grid( EXEC_OP_ TT_F26Dot6 distance, - TT_F26Dot6 compensation ) + FT_F26Dot6 Round_Down_To_Grid( EXEC_OP_ FT_F26Dot6 distance, + FT_F26Dot6 compensation ) { - TT_F26Dot6 val; + FT_F26Dot6 val; UNUSED_EXEC; @@ -1674,10 +1674,10 @@ /* Rounded distance. */ /* */ static - TT_F26Dot6 Round_Up_To_Grid( EXEC_OP_ TT_F26Dot6 distance, - TT_F26Dot6 compensation ) + FT_F26Dot6 Round_Up_To_Grid( EXEC_OP_ FT_F26Dot6 distance, + FT_F26Dot6 compensation ) { - TT_F26Dot6 val; + FT_F26Dot6 val; UNUSED_EXEC; @@ -1718,10 +1718,10 @@ /* Rounded distance. */ /* */ static - TT_F26Dot6 Round_To_Double_Grid( EXEC_OP_ TT_F26Dot6 distance, - TT_F26Dot6 compensation ) + FT_F26Dot6 Round_To_Double_Grid( EXEC_OP_ FT_F26Dot6 distance, + FT_F26Dot6 compensation ) { - TT_F26Dot6 val; + FT_F26Dot6 val; UNUSED_EXEC; @@ -1768,10 +1768,10 @@ /* before rounding. */ /* */ static - TT_F26Dot6 Round_Super( EXEC_OP_ TT_F26Dot6 distance, - TT_F26Dot6 compensation ) + FT_F26Dot6 Round_Super( EXEC_OP_ FT_F26Dot6 distance, + FT_F26Dot6 compensation ) { - TT_F26Dot6 val; + FT_F26Dot6 val; if ( distance >= 0 ) @@ -1816,10 +1816,10 @@ /* greater precision. */ /* */ static - TT_F26Dot6 Round_Super_45( EXEC_OP_ TT_F26Dot6 distance, - TT_F26Dot6 compensation ) + FT_F26Dot6 Round_Super_45( EXEC_OP_ FT_F26Dot6 distance, + FT_F26Dot6 compensation ) { - TT_F26Dot6 val; + FT_F26Dot6 val; if ( distance >= 0 ) @@ -1855,7 +1855,7 @@ /* round_mode :: The rounding mode to be used. */ /* */ static - void Compute_Round( EXEC_OP_ TT_Byte round_mode ) + void Compute_Round( EXEC_OP_ FT_Byte round_mode ) { switch ( round_mode ) { @@ -1907,10 +1907,10 @@ /* selector :: SROUND opcode */ /* */ static - void SetSuperRound( EXEC_OP_ TT_F26Dot6 GridPeriod, - TT_Long selector ) + void SetSuperRound( EXEC_OP_ FT_F26Dot6 GridPeriod, + FT_Long selector ) { - switch ( (TT_Int)( selector & 0xC0 ) ) + switch ( (FT_Int)( selector & 0xC0 ) ) { case 0: CUR.period = GridPeriod / 2; @@ -1931,7 +1931,7 @@ break; } - switch ( (TT_Int)( selector & 0x30 ) ) + switch ( (FT_Int)( selector & 0x30 ) ) { case 0: CUR.phase = 0; @@ -1953,7 +1953,7 @@ if ( (selector & 0x0F) == 0 ) CUR.threshold = CUR.period - 1; else - CUR.threshold = ( (TT_Int)( selector & 0x0F ) - 4 ) * CUR.period / 8; + CUR.threshold = ( (FT_Int)( selector & 0x0F ) - 4 ) * CUR.period / 8; CUR.period /= 256; CUR.phase /= 256; @@ -1978,8 +1978,8 @@ /* The distance in F26dot6 format. */ /* */ static - TT_F26Dot6 Project( EXEC_OP_ TT_Vector* v1, - TT_Vector* v2 ) + FT_F26Dot6 Project( EXEC_OP_ FT_Vector* v1, + FT_Vector* v2 ) { return TT_MULDIV( v1->x - v2->x, CUR.GS.projVector.x, 0x4000 ) + TT_MULDIV( v1->y - v2->y, CUR.GS.projVector.y, 0x4000 ); @@ -2003,8 +2003,8 @@ /* The distance in F26dot6 format. */ /* */ static - TT_F26Dot6 Dual_Project( EXEC_OP_ TT_Vector* v1, - TT_Vector* v2 ) + FT_F26Dot6 Dual_Project( EXEC_OP_ FT_Vector* v1, + FT_Vector* v2 ) { return TT_MULDIV( v1->x - v2->x, CUR.GS.dualVector.x, 0x4000 ) + TT_MULDIV( v1->y - v2->y, CUR.GS.dualVector.y, 0x4000 ); @@ -2028,8 +2028,8 @@ /* The distance in F26dot6 format. */ /* */ static - TT_F26Dot6 Free_Project( EXEC_OP_ TT_Vector* v1, - TT_Vector* v2 ) + FT_F26Dot6 Free_Project( EXEC_OP_ FT_Vector* v1, + FT_Vector* v2 ) { return TT_MULDIV( v1->x - v2->x, CUR.GS.freeVector.x, 0x4000 ) + TT_MULDIV( v1->y - v2->y, CUR.GS.freeVector.y, 0x4000 ); @@ -2053,8 +2053,8 @@ /* The distance in F26dot6 format. */ /* */ static - TT_F26Dot6 Project_x( EXEC_OP_ TT_Vector* v1, - TT_Vector* v2 ) + FT_F26Dot6 Project_x( EXEC_OP_ FT_Vector* v1, + FT_Vector* v2 ) { UNUSED_EXEC; @@ -2079,8 +2079,8 @@ /* The distance in F26dot6 format. */ /* */ static - TT_F26Dot6 Project_y( EXEC_OP_ TT_Vector* v1, - TT_Vector* v2 ) + FT_F26Dot6 Project_y( EXEC_OP_ FT_Vector* v1, + FT_Vector* v2 ) { UNUSED_EXEC; @@ -2115,8 +2115,8 @@ else { CUR.func_freeProj = (TT_Project_Func)Free_Project; - CUR.F_dot_P = (TT_Long)CUR.GS.projVector.x * CUR.GS.freeVector.x * 4 + - (TT_Long)CUR.GS.projVector.y * CUR.GS.freeVector.y * 4; + CUR.F_dot_P = (FT_Long)CUR.GS.projVector.x * CUR.GS.freeVector.x * 4 + + (FT_Long)CUR.GS.projVector.y * CUR.GS.freeVector.y * 4; } } @@ -2190,12 +2190,12 @@ #ifdef FT_CONFIG_OPTION_OLD_CALCS static - TT_Bool Normalize( EXEC_OP_ TT_F26Dot6 Vx, - TT_F26Dot6 Vy, - TT_UnitVector* R ) + FT_Bool Normalize( EXEC_OP_ FT_F26Dot6 Vx, + FT_F26Dot6 Vy, + FT_UnitVector* R ) { - TT_F26Dot6 W; - TT_Bool S1, S2; + FT_F26Dot6 W; + FT_Bool S1, S2; UNUSED_EXEC; @@ -2214,8 +2214,8 @@ return SUCCESS; } - R->x = (TT_F2Dot14)FT_MulDiv( Vx, 0x4000L, W ); - R->y = (TT_F2Dot14)FT_MulDiv( Vy, 0x4000L, W ); + R->x = (FT_F2Dot14)FT_MulDiv( Vx, 0x4000L, W ); + R->y = (FT_F2Dot14)FT_MulDiv( Vy, 0x4000L, W ); return SUCCESS; } @@ -2277,8 +2277,8 @@ if ( S2 ) Vy = -Vy; - R->x = (TT_F2Dot14)Vx; /* Type conversion */ - R->y = (TT_F2Dot14)Vy; /* Type conversion */ + R->x = (FT_F2Dot14)Vx; /* Type conversion */ + R->y = (FT_F2Dot14)Vy; /* Type conversion */ return SUCCESS; } @@ -2286,13 +2286,13 @@ #else static - TT_Bool Normalize( EXEC_OP_ TT_F26Dot6 Vx, - TT_F26Dot6 Vy, - TT_UnitVector* R ) + FT_Bool Normalize( EXEC_OP_ FT_F26Dot6 Vx, + FT_F26Dot6 Vy, + FT_UnitVector* R ) { - TT_F26Dot6 u, v, d; - TT_Int shift; - TT_ULong H, L, L2, hi, lo, med; + FT_F26Dot6 u, v, d; + FT_Int shift; + FT_ULong H, L, L2, hi, lo, med; u = ABS( Vx ); @@ -2313,8 +2313,8 @@ return SUCCESS; /* compute (u*u + v*v) on 64 bits with two 32-bit registers [H:L] */ - hi = (TT_ULong)u >> 16; - lo = (TT_ULong)u & 0xFFFF; + hi = (FT_ULong)u >> 16; + lo = (FT_ULong)u & 0xFFFF; med = hi * lo; H = hi * hi + ( med >> 15 ); @@ -2323,8 +2323,8 @@ if ( L < med ) H++; - hi = (TT_ULong)v >> 16; - lo = (TT_ULong)v & 0xFFFF; + hi = (FT_ULong)v >> 16; + lo = (FT_ULong)v & 0xFFFF; med = hi * lo; H += hi * hi + ( med >> 15 ); @@ -2348,8 +2348,8 @@ } d = FT_Sqrt32( L ); - R->x = (TT_F2Dot14)TT_MULDIV( Vx << shift, 0x4000, d ); - R->y = (TT_F2Dot14)TT_MULDIV( Vy << shift, 0x4000, d ); + R->x = (FT_F2Dot14)TT_MULDIV( Vx << shift, 0x4000, d ); + R->y = (FT_F2Dot14)TT_MULDIV( Vy << shift, 0x4000, d ); } /* if the value is greater than 64-bits */ else @@ -2363,19 +2363,19 @@ } d = FT_Sqrt32( L ); - R->x = (TT_F2Dot14)TT_MULDIV( Vx >> shift, 0x4000, d ); - R->y = (TT_F2Dot14)TT_MULDIV( Vy >> shift, 0x4000, d ); + R->x = (FT_F2Dot14)TT_MULDIV( Vx >> shift, 0x4000, d ); + R->y = (FT_F2Dot14)TT_MULDIV( Vy >> shift, 0x4000, d ); } { - TT_ULong x, y, w; - TT_Int sx, sy; + FT_ULong x, y, w; + FT_Int sx, sy; sx = R->x >= 0 ? 1 : -1; sy = R->y >= 0 ? 1 : -1; - x = (TT_ULong)sx * R->x; - y = (TT_ULong)sy * R->y; + x = (FT_ULong)sx * R->x; + y = (FT_ULong)sy * R->y; w = x * x + y * y; @@ -2421,14 +2421,14 @@ static - TT_Bool Ins_SxVTL( EXEC_OP_ TT_UShort aIdx1, - TT_UShort aIdx2, - TT_Int aOpc, - TT_UnitVector* Vec ) + FT_Bool Ins_SxVTL( EXEC_OP_ FT_UShort aIdx1, + FT_UShort aIdx2, + FT_Int aOpc, + FT_UnitVector* Vec ) { - TT_Long A, B, C; - TT_Vector* p1; - TT_Vector* p2; + FT_Long A, B, C; + FT_Vector* p1; + FT_Vector* p2; if ( BOUNDS( aIdx1, CUR.zp2.n_points ) || @@ -2466,11 +2466,11 @@ #define DO_SVTCA \ { \ - TT_Short A, B; \ + FT_Short A, B; \ \ \ - A = (TT_Short)( CUR.opcode & 1 ) << 14; \ - B = A ^ (TT_Short)0x4000; \ + A = (FT_Short)( CUR.opcode & 1 ) << 14; \ + B = A ^ (FT_Short)0x4000; \ \ CUR.GS.freeVector.x = A; \ CUR.GS.projVector.x = A; \ @@ -2486,11 +2486,11 @@ #define DO_SPVTCA \ { \ - TT_Short A, B; \ + FT_Short A, B; \ \ \ - A = (TT_Short)( CUR.opcode & 1 ) << 14; \ - B = A ^ (TT_Short)0x4000; \ + A = (FT_Short)( CUR.opcode & 1 ) << 14; \ + B = A ^ (FT_Short)0x4000; \ \ CUR.GS.projVector.x = A; \ CUR.GS.dualVector.x = A; \ @@ -2504,11 +2504,11 @@ #define DO_SFVTCA \ { \ - TT_Short A, B; \ + FT_Short A, B; \ \ \ - A = (TT_Short)( CUR.opcode & 1 ) << 14; \ - B = A ^ (TT_Short)0x4000; \ + A = (FT_Short)( CUR.opcode & 1 ) << 14; \ + B = A ^ (FT_Short)0x4000; \ \ CUR.GS.freeVector.x = A; \ CUR.GS.freeVector.y = B; \ @@ -2518,8 +2518,8 @@ #define DO_SPVTL \ - if ( INS_SxVTL( (TT_UShort)args[1], \ - (TT_UShort)args[0], \ + if ( INS_SxVTL( (FT_UShort)args[1], \ + (FT_UShort)args[0], \ CUR.opcode, \ &CUR.GS.projVector ) == SUCCESS ) \ { \ @@ -2529,8 +2529,8 @@ #define DO_SFVTL \ - if ( INS_SxVTL( (TT_UShort)args[1], \ - (TT_UShort)args[0], \ + if ( INS_SxVTL( (FT_UShort)args[1], \ + (FT_UShort)args[0], \ CUR.opcode, \ &CUR.GS.freeVector ) == SUCCESS ) \ COMPUTE_Funcs(); @@ -2543,15 +2543,15 @@ #define DO_SPVFS \ { \ - TT_Short S; \ - TT_Long X, Y; \ + FT_Short S; \ + FT_Long X, Y; \ \ \ /* Only use low 16bits, then sign extend */ \ - S = (TT_Short)args[1]; \ - Y = (TT_Long)S; \ - S = (TT_Short)args[0]; \ - X = (TT_Long)S; \ + S = (FT_Short)args[1]; \ + Y = (FT_Long)S; \ + S = (FT_Short)args[0]; \ + X = (FT_Long)S; \ \ NORMalize( X, Y, &CUR.GS.projVector ); \ \ @@ -2562,14 +2562,14 @@ #define DO_SFVFS \ { \ - TT_Short S; \ - TT_Long X, Y; \ + FT_Short S; \ + FT_Long X, Y; \ \ \ /* Only use low 16bits, then sign extend */ \ - S = (TT_Short)args[1]; \ - Y = (TT_Long)S; \ - S = (TT_Short)args[0]; \ + S = (FT_Short)args[1]; \ + Y = (FT_Long)S; \ + S = (FT_Short)args[0]; \ X = S; \ \ NORMalize( X, Y, &CUR.GS.freeVector ); \ @@ -2588,15 +2588,15 @@ #define DO_SRP0 \ - CUR.GS.rp0 = (TT_UShort)args[0]; + CUR.GS.rp0 = (FT_UShort)args[0]; #define DO_SRP1 \ - CUR.GS.rp1 = (TT_UShort)args[0]; + CUR.GS.rp1 = (FT_UShort)args[0]; #define DO_SRP2 \ - CUR.GS.rp2 = (TT_UShort)args[0]; + CUR.GS.rp2 = (FT_UShort)args[0]; #define DO_RTHG \ @@ -2653,11 +2653,11 @@ #define DO_SCVTCI \ - CUR.GS.control_value_cutin = (TT_F26Dot6)args[0]; + CUR.GS.control_value_cutin = (FT_F26Dot6)args[0]; #define DO_SSWCI \ - CUR.GS.single_width_cutin = (TT_F26Dot6)args[0]; + CUR.GS.single_width_cutin = (FT_F26Dot6)args[0]; /* XXX: UNDOCUMENTED! or bug in the Windows engine? */ @@ -2667,7 +2667,7 @@ /* units.. */ /* */ #define DO_SSW \ - CUR.GS.single_width_value = (TT_F26Dot6)( args[0] >> 10 ); + CUR.GS.single_width_value = (FT_F26Dot6)( args[0] >> 10 ); #define DO_FLIPON \ @@ -2679,11 +2679,11 @@ #define DO_SDB \ - CUR.GS.delta_base = (TT_Short)args[0]; + CUR.GS.delta_base = (FT_Short)args[0]; #define DO_SDS \ - CUR.GS.delta_shift = (TT_Short)args[0]; + CUR.GS.delta_shift = (FT_Short)args[0]; #define DO_MD /* nothing */ @@ -2718,7 +2718,7 @@ #define DO_SWAP \ { \ - TT_Long L; \ + FT_Long L; \ \ \ L = args[0]; \ @@ -2733,7 +2733,7 @@ #define DO_CINDEX \ { \ - TT_Long L; \ + FT_Long L; \ \ \ L = args[0]; \ @@ -2847,7 +2847,7 @@ #define DO_RS \ { \ - TT_ULong I = (TT_ULong)args[0]; \ + FT_ULong I = (FT_ULong)args[0]; \ \ \ if ( BOUNDS( I, CUR.storeSize ) ) \ @@ -2866,7 +2866,7 @@ #define DO_WS \ { \ - TT_ULong I = (TT_ULong)args[0]; \ + FT_ULong I = (FT_ULong)args[0]; \ \ \ if ( BOUNDS( I, CUR.storeSize ) ) \ @@ -2883,7 +2883,7 @@ #define DO_RCVT \ { \ - TT_ULong I = (TT_ULong)args[0]; \ + FT_ULong I = (FT_ULong)args[0]; \ \ \ if ( BOUNDS( I, CUR.cvtSize ) ) \ @@ -2902,7 +2902,7 @@ #define DO_WCVTP \ { \ - TT_ULong I = (TT_ULong)args[0]; \ + FT_ULong I = (FT_ULong)args[0]; \ \ \ if ( BOUNDS( I, CUR.cvtSize ) ) \ @@ -2919,7 +2919,7 @@ #define DO_WCVTF \ { \ - TT_ULong I = (TT_ULong)args[0]; \ + FT_ULong I = (FT_ULong)args[0]; \ \ \ if ( BOUNDS( I, CUR.cvtSize ) ) \ @@ -3937,7 +3937,7 @@ static void Ins_MINDEX( INS_ARG ) { - TT_Long L, K; + FT_Long L, K; L = args[0]; @@ -3952,7 +3952,7 @@ MEM_Move( &CUR.stack[CUR.args - L ], &CUR.stack[CUR.args - L + 1], - ( L - 1 ) * sizeof ( TT_Long ) ); + ( L - 1 ) * sizeof ( FT_Long ) ); CUR.stack[CUR.args - 1] = K; } @@ -3967,7 +3967,7 @@ static void Ins_ROLL( INS_ARG ) { - TT_Long A, B, C; + FT_Long A, B, C; UNUSED_EXEC; @@ -3992,7 +3992,7 @@ static - TT_Bool SkipCode( EXEC_OP ) + FT_Bool SkipCode( EXEC_OP ) { CUR.IP += CUR.length; @@ -4027,8 +4027,8 @@ static void Ins_IF( INS_ARG ) { - TT_Int nIfs; - TT_Bool Out; + FT_Int nIfs; + FT_Bool Out; if ( args[0] != 0 ) @@ -4070,7 +4070,7 @@ static void Ins_ELSE( INS_ARG ) { - TT_Int nIfs; + FT_Int nIfs; UNUSED_ARG; @@ -4114,7 +4114,7 @@ static void Ins_FDEF( INS_ARG ) { - TT_ULong n; + FT_ULong n; TT_DefRecord* rec; TT_DefRecord* limit; @@ -4227,7 +4227,7 @@ static void Ins_CALL( INS_ARG ) { - TT_ULong F; + FT_ULong F; TT_CallRec* pCrec; TT_DefRecord* def; @@ -4304,7 +4304,7 @@ static void Ins_LOOPCALL( INS_ARG ) { - TT_ULong F; + FT_ULong F; TT_CallRec* pCrec; TT_DefRecord* def; @@ -4357,7 +4357,7 @@ pCrec->Caller_Range = CUR.curRange; pCrec->Caller_IP = CUR.IP + 1; - pCrec->Cur_Count = (TT_Int)args[0]; + pCrec->Cur_Count = (FT_Int)args[0]; pCrec->Cur_Restart = def->start; CUR.callTop++; @@ -4392,7 +4392,7 @@ limit = def + CUR.numIDefs; for ( ; def < limit; def++ ) - if ( def->opc == (TT_ULong)args[0] ) + if ( def->opc == (FT_ULong)args[0] ) break; if ( def == limit ) @@ -4411,7 +4411,7 @@ def->range = CUR.curRange; def->active = TRUE; - if ( (TT_ULong)args[0] > CUR.maxIns ) + if ( (FT_ULong)args[0] > CUR.maxIns ) CUR.maxIns = args[0]; /* Now skip the whole function definition. */ @@ -4450,10 +4450,10 @@ static void Ins_NPUSHB( INS_ARG ) { - TT_UShort L, K; + FT_UShort L, K; - L = (TT_UShort)CUR.code[CUR.IP + 1]; + L = (FT_UShort)CUR.code[CUR.IP + 1]; if ( BOUNDS( L, CUR.stackSize + 1 - CUR.top ) ) { @@ -4477,10 +4477,10 @@ static void Ins_NPUSHW( INS_ARG ) { - TT_UShort L, K; + FT_UShort L, K; - L = (TT_UShort)CUR.code[CUR.IP + 1]; + L = (FT_UShort)CUR.code[CUR.IP + 1]; if ( BOUNDS( L, CUR.stackSize + 1 - CUR.top ) ) { @@ -4507,10 +4507,10 @@ static void Ins_PUSHB( INS_ARG ) { - TT_UShort L, K; + FT_UShort L, K; - L = (TT_UShort)CUR.opcode - 0xB0 + 1; + L = (FT_UShort)CUR.opcode - 0xB0 + 1; if ( BOUNDS( L, CUR.stackSize + 1 - CUR.top ) ) { @@ -4532,10 +4532,10 @@ static void Ins_PUSHW( INS_ARG ) { - TT_UShort L, K; + FT_UShort L, K; - L = (TT_UShort)CUR.opcode - 0xB8 + 1; + L = (FT_UShort)CUR.opcode - 0xB8 + 1; if ( BOUNDS( L, CUR.stackSize + 1 - CUR.top ) ) { @@ -4572,11 +4572,11 @@ /* */ static void Ins_GC( INS_ARG ) { - TT_ULong L; - TT_F26Dot6 R; + FT_ULong L; + FT_F26Dot6 R; - L = (TT_ULong)args[0]; + L = (FT_ULong)args[0]; if ( BOUNDS( L, CUR.zp2.n_points ) ) { @@ -4613,11 +4613,11 @@ static void Ins_SCFS( INS_ARG ) { - TT_Long K; - TT_UShort L; + FT_Long K; + FT_UShort L; - L = (TT_UShort)args[0]; + L = (FT_UShort)args[0]; if ( BOUNDS( L, CUR.zp2.n_points ) ) { @@ -4655,12 +4655,12 @@ static void Ins_MD( INS_ARG ) { - TT_UShort K, L; - TT_F26Dot6 D; + FT_UShort K, L; + FT_F26Dot6 D; - K = (TT_UShort)args[1]; - L = (TT_UShort)args[0]; + K = (FT_UShort)args[1]; + L = (FT_UShort)args[0]; if( BOUNDS( L, CUR.zp0.n_points ) || BOUNDS( K, CUR.zp1.n_points ) ) @@ -4693,12 +4693,12 @@ static void Ins_SDPVTL( INS_ARG ) { - TT_Long A, B, C; - TT_UShort p1, p2; /* was TT_Int in pas type ERROR */ + FT_Long A, B, C; + FT_UShort p1, p2; /* was FT_Int in pas type ERROR */ - p1 = (TT_UShort)args[1]; - p2 = (TT_UShort)args[0]; + p1 = (FT_UShort)args[1]; + p2 = (FT_UShort)args[0]; if ( BOUNDS( p2, CUR.zp1.n_points ) || BOUNDS( p1, CUR.zp2.n_points ) ) @@ -4709,8 +4709,8 @@ } { - TT_Vector* v1 = CUR.zp1.org + p2; - TT_Vector* v2 = CUR.zp2.org + p1; + FT_Vector* v1 = CUR.zp1.org + p2; + FT_Vector* v2 = CUR.zp2.org + p1; A = v1->x - v2->x; @@ -4727,8 +4727,8 @@ NORMalize( A, B, &CUR.GS.dualVector ); { - TT_Vector* v1 = CUR.zp1.cur + p2; - TT_Vector* v2 = CUR.zp2.cur + p1; + FT_Vector* v1 = CUR.zp1.cur + p2; + FT_Vector* v2 = CUR.zp2.cur + p1; A = v1->x - v2->x; @@ -4757,7 +4757,7 @@ static void Ins_SZP0( INS_ARG ) { - switch ( (TT_Int)args[0] ) + switch ( (FT_Int)args[0] ) { case 0: CUR.zp0 = CUR.twilight; @@ -4773,7 +4773,7 @@ return; } - CUR.GS.gep0 = (TT_UShort)args[0]; + CUR.GS.gep0 = (FT_UShort)args[0]; } @@ -4786,7 +4786,7 @@ static void Ins_SZP1( INS_ARG ) { - switch ( (TT_Int)args[0] ) + switch ( (FT_Int)args[0] ) { case 0: CUR.zp1 = CUR.twilight; @@ -4802,7 +4802,7 @@ return; } - CUR.GS.gep1 = (TT_UShort)args[0]; + CUR.GS.gep1 = (FT_UShort)args[0]; } @@ -4815,7 +4815,7 @@ static void Ins_SZP2( INS_ARG ) { - switch ( (TT_Int)args[0] ) + switch ( (FT_Int)args[0] ) { case 0: CUR.zp2 = CUR.twilight; @@ -4831,7 +4831,7 @@ return; } - CUR.GS.gep2 = (TT_UShort)args[0]; + CUR.GS.gep2 = (FT_UShort)args[0]; } @@ -4844,7 +4844,7 @@ static void Ins_SZPS( INS_ARG ) { - switch ( (TT_Int)args[0] ) + switch ( (FT_Int)args[0] ) { case 0: CUR.zp0 = CUR.twilight; @@ -4863,9 +4863,9 @@ CUR.zp1 = CUR.zp0; CUR.zp2 = CUR.zp0; - CUR.GS.gep0 = (TT_UShort)args[0]; - CUR.GS.gep1 = (TT_UShort)args[0]; - CUR.GS.gep2 = (TT_UShort)args[0]; + CUR.GS.gep0 = (FT_UShort)args[0]; + CUR.GS.gep1 = (FT_UShort)args[0]; + CUR.GS.gep2 = (FT_UShort)args[0]; } @@ -4878,7 +4878,7 @@ static void Ins_INSTCTRL( INS_ARG ) { - TT_Long K, L; + FT_Long K, L; K = args[1]; @@ -4895,7 +4895,7 @@ L = K; CUR.GS.instruct_control = - (TT_Byte)( CUR.GS.instruct_control & ~(TT_Byte)K ) | (TT_Byte)L; + (FT_Byte)( CUR.GS.instruct_control & ~(FT_Byte)K ) | (FT_Byte)L; } @@ -4908,11 +4908,11 @@ static void Ins_SCANCTRL( INS_ARG ) { - TT_Int A; + FT_Int A; /* Get Threshold */ - A = (TT_Int)( args[0] & 0xFF ); + A = (FT_Int)( args[0] & 0xFF ); if ( A == 0xFF ) { @@ -4968,7 +4968,7 @@ if ( args[0] == 3 ) args[0] = 2; - CUR.GS.scan_type = (TT_Int)args[0]; + CUR.GS.scan_type = (FT_Int)args[0]; } } @@ -4991,7 +4991,7 @@ static void Ins_FLIPPT( INS_ARG ) { - TT_UShort point; + FT_UShort point; UNUSED_ARG; @@ -5006,7 +5006,7 @@ { CUR.args--; - point = (TT_UShort)CUR.stack[CUR.args]; + point = (FT_UShort)CUR.stack[CUR.args]; if ( BOUNDS( point, CUR.pts.n_points ) ) { @@ -5036,11 +5036,11 @@ static void Ins_FLIPRGON( INS_ARG ) { - TT_UShort I, K, L; + FT_UShort I, K, L; - K = (TT_UShort)args[1]; - L = (TT_UShort)args[0]; + K = (FT_UShort)args[1]; + L = (FT_UShort)args[0]; if ( BOUNDS( K, CUR.pts.n_points ) || BOUNDS( L, CUR.pts.n_points ) ) @@ -5064,11 +5064,11 @@ static void Ins_FLIPRGOFF( INS_ARG ) { - TT_UShort I, K, L; + FT_UShort I, K, L; - K = (TT_UShort)args[1]; - L = (TT_UShort)args[0]; + K = (FT_UShort)args[1]; + L = (FT_UShort)args[0]; if ( BOUNDS( K, CUR.pts.n_points ) || BOUNDS( L, CUR.pts.n_points ) ) @@ -5084,14 +5084,14 @@ static - TT_Bool Compute_Point_Displacement( EXEC_OP_ TT_F26Dot6* x, - TT_F26Dot6* y, - FT_GlyphZone* zone, - TT_UShort* refp ) + FT_Bool Compute_Point_Displacement( EXEC_OP_ FT_F26Dot6* x, + FT_F26Dot6* y, + TT_GlyphZone* zone, + FT_UShort* refp ) { - FT_GlyphZone zp; - TT_UShort p; - TT_F26Dot6 d; + TT_GlyphZone zp; + FT_UShort p; + FT_F26Dot6 d; if ( CUR.opcode & 1 ) @@ -5125,10 +5125,10 @@ #else *x = TT_MULDIV( d, - (TT_Long)CUR.GS.freeVector.x * 0x10000L, + (FT_Long)CUR.GS.freeVector.x * 0x10000L, CUR.F_dot_P ); *y = TT_MULDIV( d, - (TT_Long)CUR.GS.freeVector.y * 0x10000L, + (FT_Long)CUR.GS.freeVector.y * 0x10000L, CUR.F_dot_P ); #endif /* NO_APPLE_PATENT */ @@ -5138,10 +5138,10 @@ static - void Move_Zp2_Point( EXEC_OP_ TT_UShort point, - TT_F26Dot6 dx, - TT_F26Dot6 dy, - TT_Bool touch ) + void Move_Zp2_Point( EXEC_OP_ FT_UShort point, + FT_F26Dot6 dx, + FT_F26Dot6 dy, + FT_Bool touch ) { if ( CUR.GS.freeVector.x != 0 ) { @@ -5168,12 +5168,12 @@ static void Ins_SHP( INS_ARG ) { - FT_GlyphZone zp; - TT_UShort refp; + TT_GlyphZone zp; + FT_UShort refp; - TT_F26Dot6 dx, + FT_F26Dot6 dx, dy; - TT_UShort point; + FT_UShort point; UNUSED_ARG; @@ -5190,7 +5190,7 @@ while ( CUR.GS.loop > 0 ) { CUR.args--; - point = (TT_UShort)CUR.stack[CUR.args]; + point = (FT_UShort)CUR.stack[CUR.args]; if ( BOUNDS( point, CUR.zp2.n_points ) ) { @@ -5221,16 +5221,16 @@ static void Ins_SHC( INS_ARG ) { - FT_GlyphZone zp; - TT_UShort refp; - TT_F26Dot6 dx, + TT_GlyphZone zp; + FT_UShort refp; + FT_F26Dot6 dx, dy; - TT_Short contour; - TT_UShort first_point, last_point, i; + FT_Short contour; + FT_UShort first_point, last_point, i; - contour = (TT_UShort)args[0]; + contour = (FT_UShort)args[0]; if ( BOUNDS( contour, CUR.pts.n_contours ) ) { @@ -5277,12 +5277,12 @@ static void Ins_SHZ( INS_ARG ) { - FT_GlyphZone zp; - TT_UShort refp; - TT_F26Dot6 dx, + TT_GlyphZone zp; + FT_UShort refp; + FT_F26Dot6 dx, dy; - TT_UShort last_point, i; + FT_UShort last_point, i; if ( BOUNDS( args[0], 2 ) ) @@ -5318,8 +5318,8 @@ static void Ins_SHPIX( INS_ARG ) { - TT_F26Dot6 dx, dy; - TT_UShort point; + FT_F26Dot6 dx, dy; + FT_UShort point; if ( CUR.top < CUR.GS.loop + 1 ) @@ -5329,17 +5329,17 @@ } dx = TT_MULDIV( args[0], - (TT_Long)CUR.GS.freeVector.x, + (FT_Long)CUR.GS.freeVector.x, 0x4000 ); dy = TT_MULDIV( args[0], - (TT_Long)CUR.GS.freeVector.y, + (FT_Long)CUR.GS.freeVector.y, 0x4000 ); while ( CUR.GS.loop > 0 ) { CUR.args--; - point = (TT_UShort)CUR.stack[CUR.args]; + point = (FT_UShort)CUR.stack[CUR.args]; if ( BOUNDS( point, CUR.zp2.n_points ) ) { @@ -5369,11 +5369,11 @@ static void Ins_MSIRP( INS_ARG ) { - TT_UShort point; - TT_F26Dot6 distance; + FT_UShort point; + FT_F26Dot6 distance; - point = (TT_UShort)args[0]; + point = (FT_UShort)args[0]; if ( BOUNDS( point, CUR.zp1.n_points ) || BOUNDS( CUR.GS.rp0, CUR.zp0.n_points ) ) @@ -5412,12 +5412,12 @@ static void Ins_MDAP( INS_ARG ) { - TT_UShort point; - TT_F26Dot6 cur_dist, + FT_UShort point; + FT_F26Dot6 cur_dist, distance; - point = (TT_UShort)args[0]; + point = (FT_UShort)args[0]; if ( BOUNDS( point, CUR.zp0.n_points ) ) { @@ -5453,14 +5453,14 @@ static void Ins_MIAP( INS_ARG ) { - TT_ULong cvtEntry; - TT_UShort point; - TT_F26Dot6 distance, + FT_ULong cvtEntry; + FT_UShort point; + FT_F26Dot6 distance, org_dist; - cvtEntry = (TT_ULong)args[1]; - point = (TT_UShort)args[0]; + cvtEntry = (FT_ULong)args[1]; + point = (FT_UShort)args[0]; if ( BOUNDS( point, CUR.zp0.n_points ) || BOUNDS( cvtEntry, CUR.cvtSize ) ) @@ -5529,11 +5529,11 @@ static void Ins_MDRP( INS_ARG ) { - TT_UShort point; - TT_F26Dot6 org_dist, distance; + FT_UShort point; + FT_F26Dot6 org_dist, distance; - point = (TT_UShort)args[0]; + point = (FT_UShort)args[0]; if ( BOUNDS( point, CUR.zp1.n_points ) || BOUNDS( CUR.GS.rp0, CUR.zp0.n_points ) ) @@ -5610,17 +5610,17 @@ static void Ins_MIRP( INS_ARG ) { - TT_UShort point; - TT_ULong cvtEntry; + FT_UShort point; + FT_ULong cvtEntry; - TT_F26Dot6 cvt_dist, + FT_F26Dot6 cvt_dist, distance, cur_dist, org_dist; - point = (TT_UShort)args[0]; - cvtEntry = (TT_ULong)( args[1] + 1 ); + point = (FT_UShort)args[0]; + cvtEntry = (FT_ULong)( args[1] + 1 ); /* XXX: UNDOCUMENTED! cvt[-1] = 0 always */ @@ -5737,8 +5737,8 @@ static void Ins_ALIGNRP( INS_ARG ) { - TT_UShort point; - TT_F26Dot6 distance; + FT_UShort point; + FT_F26Dot6 distance; UNUSED_ARG; @@ -5755,7 +5755,7 @@ { CUR.args--; - point = (TT_UShort)CUR.stack[CUR.args]; + point = (FT_UShort)CUR.stack[CUR.args]; if ( BOUNDS( point, CUR.zp1.n_points ) ) { @@ -5790,27 +5790,27 @@ static void Ins_ISECT( INS_ARG ) { - TT_UShort point, + FT_UShort point, a0, a1, b0, b1; - TT_F26Dot6 discriminant; + FT_F26Dot6 discriminant; - TT_F26Dot6 dx, dy, + FT_F26Dot6 dx, dy, dax, day, dbx, dby; - TT_F26Dot6 val; + FT_F26Dot6 val; - TT_Vector R; + FT_Vector R; - point = (TT_UShort)args[0]; + point = (FT_UShort)args[0]; - a0 = (TT_UShort)args[1]; - a1 = (TT_UShort)args[2]; - b0 = (TT_UShort)args[3]; - b1 = (TT_UShort)args[4]; + a0 = (FT_UShort)args[1]; + a1 = (FT_UShort)args[2]; + b0 = (FT_UShort)args[3]; + b1 = (FT_UShort)args[4]; if ( BOUNDS( b0, CUR.zp0.n_points ) || BOUNDS( b1, CUR.zp0.n_points ) || @@ -5872,12 +5872,12 @@ static void Ins_ALIGNPTS( INS_ARG ) { - TT_UShort p1, p2; - TT_F26Dot6 distance; + FT_UShort p1, p2; + FT_F26Dot6 distance; - p1 = (TT_UShort)args[0]; - p2 = (TT_UShort)args[1]; + p1 = (FT_UShort)args[0]; + p2 = (FT_UShort)args[1]; if ( BOUNDS( args[0], CUR.zp1.n_points ) || BOUNDS( args[1], CUR.zp0.n_points ) ) @@ -5904,10 +5904,10 @@ static void Ins_IP( INS_ARG ) { - TT_F26Dot6 org_a, org_b, org_x, + FT_F26Dot6 org_a, org_b, org_x, cur_a, cur_b, cur_x, distance; - TT_UShort point; + FT_UShort point; UNUSED_ARG; @@ -5942,7 +5942,7 @@ { CUR.args--; - point = (TT_UShort)CUR.stack[CUR.args]; + point = (FT_UShort)CUR.stack[CUR.args]; if ( BOUNDS( point, CUR.zp2.n_points ) ) { if ( CUR.pedantic_hinting ) @@ -5994,11 +5994,11 @@ static void Ins_UTP( INS_ARG ) { - TT_UShort point; - TT_Byte mask; + FT_UShort point; + FT_Byte mask; - point = (TT_UShort)args[0]; + point = (FT_UShort)args[0]; if ( BOUNDS( point, CUR.zp0.n_points ) ) { @@ -6022,19 +6022,19 @@ /* Local variables for Ins_IUP: */ struct LOC_Ins_IUP { - TT_Vector* orgs; /* original and current coordinate */ - TT_Vector* curs; /* arrays */ + FT_Vector* orgs; /* original and current coordinate */ + FT_Vector* curs; /* arrays */ }; static - void Shift( TT_UInt p1, - TT_UInt p2, - TT_UInt p, + void Shift( FT_UInt p1, + FT_UInt p2, + FT_UInt p, struct LOC_Ins_IUP* LINK ) { - TT_UInt i; - TT_F26Dot6 x; + FT_UInt i; + FT_F26Dot6 x; x = LINK->curs[p].x - LINK->orgs[p].x; @@ -6048,14 +6048,14 @@ static - void Interp( TT_UInt p1, - TT_UInt p2, - TT_UInt ref1, - TT_UInt ref2, + void Interp( FT_UInt p1, + FT_UInt p2, + FT_UInt ref1, + FT_UInt ref2, struct LOC_Ins_IUP* LINK ) { - TT_UInt i; - TT_F26Dot6 x, x1, x2, d1, d2; + FT_UInt i; + FT_F26Dot6 x, x1, x2, d1, d2; if ( p1 > p2 ) @@ -6137,16 +6137,16 @@ void Ins_IUP( INS_ARG ) { struct LOC_Ins_IUP V; - TT_Byte mask; + FT_Byte mask; - TT_UInt first_point; /* first point of contour */ - TT_UInt end_point; /* end point (last+1) of contour */ + FT_UInt first_point; /* first point of contour */ + FT_UInt end_point; /* end point (last+1) of contour */ - TT_UInt first_touched; /* first touched point in contour */ - TT_UInt cur_touched; /* current touched point in contour */ + FT_UInt first_touched; /* first touched point in contour */ + FT_UInt cur_touched; /* current touched point in contour */ - TT_UInt point; /* current point */ - TT_Short contour; /* current contour */ + FT_UInt point; /* current point */ + FT_Short contour; /* current contour */ UNUSED_ARG; @@ -6160,8 +6160,8 @@ else { mask = FT_Curve_Tag_Touch_Y; - V.orgs = (TT_Vector*)( (TT_F26Dot6*)CUR.pts.org + 1 ); - V.curs = (TT_Vector*)( (TT_F26Dot6*)CUR.pts.cur + 1 ); + V.orgs = (FT_Vector*)( (FT_F26Dot6*)CUR.pts.org + 1 ); + V.curs = (FT_Vector*)( (FT_F26Dot6*)CUR.pts.cur + 1 ); } contour = 0; @@ -6202,7 +6202,7 @@ Shift( first_point, end_point, cur_touched, &V ); else { - Interp( (TT_UShort)( cur_touched + 1 ), + Interp( (FT_UShort)( cur_touched + 1 ), end_point, cur_touched, first_touched, @@ -6230,13 +6230,13 @@ static void Ins_DELTAP( INS_ARG ) { - TT_ULong k, nump; - TT_UShort A; - TT_ULong C; - TT_Long B; + FT_ULong k, nump; + FT_UShort A; + FT_ULong C; + FT_Long B; - nump = (TT_ULong)args[0]; /* some points theoretically may occur more + nump = (FT_ULong)args[0]; /* some points theoretically may occur more than once, thus UShort isn't enough */ for ( k = 1; k <= nump; k++ ) @@ -6249,7 +6249,7 @@ CUR.args -= 2; - A = (TT_UShort)CUR.stack[CUR.args + 1]; + A = (FT_UShort)CUR.stack[CUR.args + 1]; B = CUR.stack[CUR.args]; /* XXX: Because some popular fonts contain some invalid DeltaP */ @@ -6260,7 +6260,7 @@ if ( !BOUNDS( A, CUR.zp0.n_points ) ) { - C = ( (TT_ULong)B & 0xF0 ) >> 4; + C = ( (FT_ULong)B & 0xF0 ) >> 4; switch ( CUR.opcode ) { @@ -6278,9 +6278,9 @@ C += CUR.GS.delta_base; - if ( CURRENT_Ppem() == (TT_Long)C ) + if ( CURRENT_Ppem() == (FT_Long)C ) { - B = ( (TT_ULong)B & 0xF ) - 8; + B = ( (FT_ULong)B & 0xF ) - 8; if ( B >= 0 ) B++; B = B * 64 / ( 1L << CUR.GS.delta_shift ); @@ -6306,12 +6306,12 @@ static void Ins_DELTAC( INS_ARG ) { - TT_ULong nump, k; - TT_ULong A, C; - TT_Long B; + FT_ULong nump, k; + FT_ULong A, C; + FT_Long B; - nump = (TT_ULong)args[0]; + nump = (FT_ULong)args[0]; for ( k = 1; k <= nump; k++ ) { @@ -6323,7 +6323,7 @@ CUR.args -= 2; - A = (TT_ULong)CUR.stack[CUR.args + 1]; + A = (FT_ULong)CUR.stack[CUR.args + 1]; B = CUR.stack[CUR.args]; if ( BOUNDS( A, CUR.cvtSize ) ) @@ -6336,7 +6336,7 @@ } else { - C = ( (TT_ULong)B & 0xF0 ) >> 4; + C = ( (FT_ULong)B & 0xF0 ) >> 4; switch ( CUR.opcode ) { @@ -6354,9 +6354,9 @@ C += CUR.GS.delta_base; - if ( CURRENT_Ppem() == (TT_Long)C ) + if ( CURRENT_Ppem() == (FT_Long)C ) { - B = ( (TT_ULong)B & 0xF ) - 8; + B = ( (FT_ULong)B & 0xF ) - 8; if ( B >= 0 ) B++; B = B * 64 / ( 1L << CUR.GS.delta_shift ); @@ -6388,7 +6388,7 @@ static void Ins_GETINFO( INS_ARG ) { - TT_Long K; + FT_Long K; K = 0; @@ -6789,9 +6789,9 @@ /* This function is publicly exported because it is directly */ /* invoked by the TrueType debugger. */ /* */ - FT_EXPORT_FUNC( TT_Error ) TT_RunIns( TT_ExecContext exc ) + FT_EXPORT_FUNC( FT_Error ) TT_RunIns( TT_ExecContext exc ) { - TT_Long ins_counter = 0; /* executed instructions counter */ + FT_Long ins_counter = 0; /* executed instructions counter */ #ifdef TT_CONFIG_OPTION_STATIC_RASTER @@ -6816,7 +6816,7 @@ } COMPUTE_Funcs(); - COMPUTE_Round( (TT_Byte)exc->GS.round_state ); + COMPUTE_Round( (FT_Byte)exc->GS.round_state ); do { @@ -6861,8 +6861,8 @@ #ifdef TT_CONFIG_OPTION_INTERPRETER_SWITCH { - TT_Long* args = CUR.stack + CUR.args; - TT_Byte opcode = CUR.opcode; + FT_Long* args = CUR.stack + CUR.args; + FT_Byte opcode = CUR.opcode; #undef ARRAY_BOUND_ERROR @@ -6878,11 +6878,11 @@ case 0x04: /* SFvTCA y */ case 0x05: /* SFvTCA x */ { - TT_Short AA, BB; + FT_Short AA, BB; - AA = (TT_Short)( opcode & 1 ) << 14; - BB = AA ^ (TT_Short)0x4000; + AA = (FT_Short)( opcode & 1 ) << 14; + BB = AA ^ (FT_Short)0x4000; if ( opcode < 4 ) { diff --git a/src/truetype/ttinterp.h b/src/truetype/ttinterp.h index ae28c0fd0..2b0fd0160 100644 --- a/src/truetype/ttinterp.h +++ b/src/truetype/ttinterp.h @@ -67,25 +67,25 @@ /*************************************************************************/ /* Rounding function */ - typedef TT_F26Dot6 (*TT_Round_Func)( EXEC_OP_ TT_F26Dot6 distance, - TT_F26Dot6 compensation ); + typedef FT_F26Dot6 (*TT_Round_Func)( EXEC_OP_ FT_F26Dot6 distance, + FT_F26Dot6 compensation ); /* Point displacement along the freedom vector routine */ - typedef void (*TT_Move_Func)( EXEC_OP_ FT_GlyphZone* zone, - TT_UInt point, - TT_F26Dot6 distance ); + typedef void (*TT_Move_Func)( EXEC_OP_ TT_GlyphZone* zone, + FT_UInt point, + FT_F26Dot6 distance ); /* Distance projection along one of the projection vectors */ - typedef TT_F26Dot6 (*TT_Project_Func)( EXEC_OP_ TT_Vector* v1, - TT_Vector* v2 ); + typedef FT_F26Dot6 (*TT_Project_Func)( EXEC_OP_ FT_Vector* v1, + FT_Vector* v2 ); /* reading a cvt value. Take care of non-square pixels if necessary */ - typedef TT_F26Dot6 (*TT_Get_CVT_Func)( EXEC_OP_ TT_ULong index ); + typedef FT_F26Dot6 (*TT_Get_CVT_Func)( EXEC_OP_ FT_ULong index ); /* setting or moving a cvt value. Take care of non-square pixels */ /* if necessary */ - typedef void (*TT_Set_CVT_Func)( EXEC_OP_ TT_ULong index, - TT_F26Dot6 value ); + typedef void (*TT_Set_CVT_Func)( EXEC_OP_ FT_ULong index, + FT_F26Dot6 value ); /*************************************************************************/ @@ -94,10 +94,10 @@ /* */ typedef struct TT_CallRec_ { - TT_Int Caller_Range; - TT_Long Caller_IP; - TT_Long Cur_Count; - TT_Long Cur_Restart; + FT_Int Caller_Range; + FT_Long Caller_IP; + FT_Long Cur_Count; + FT_Long Cur_Restart; } TT_CallRec, *TT_CallStack; @@ -115,17 +115,17 @@ /* instructions state */ - TT_Error error; /* last execution error */ + FT_Error error; /* last execution error */ - TT_Long top; /* top of exec. stack */ + FT_Long top; /* top of exec. stack */ - TT_UInt stackSize; /* size of exec. stack */ - TT_Long* stack; /* current exec. stack */ + FT_UInt stackSize; /* size of exec. stack */ + FT_Long* stack; /* current exec. stack */ - TT_Long args; - TT_UInt new_top; /* new top after exec. */ + FT_Long args; + FT_UInt new_top; /* new top after exec. */ - FT_GlyphZone zp0, /* zone records */ + TT_GlyphZone zp0, /* zone records */ zp1, zp2, pts, @@ -136,66 +136,66 @@ TT_GraphicsState GS; /* current graphics state */ - TT_Int curRange; /* current code range number */ - TT_Byte* code; /* current code range */ - TT_Long IP; /* current instruction pointer */ - TT_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 */ - TT_Byte opcode; /* current opcode */ - TT_Int length; /* length of current opcode */ + FT_Byte opcode; /* current opcode */ + FT_Int length; /* length of current opcode */ - TT_Bool step_ins; /* true if the interpreter must */ + FT_Bool step_ins; /* true if the interpreter must */ /* increment IP after ins. exec */ - TT_Long cvtSize; - TT_Long* cvt; + FT_Long cvtSize; + FT_Long* cvt; - TT_UInt glyphSize; /* glyph instructions buffer size */ - TT_Byte* glyphIns; /* glyph instructions buffer */ + FT_UInt glyphSize; /* glyph instructions buffer size */ + FT_Byte* glyphIns; /* glyph instructions buffer */ - TT_UInt numFDefs; /* number of function defs */ - TT_UInt maxFDefs; /* maximum number of function defs */ + FT_UInt numFDefs; /* number of function defs */ + FT_UInt maxFDefs; /* maximum number of function defs */ TT_DefArray FDefs; /* table of FDefs entries */ - TT_UInt numIDefs; /* number of instruction defs */ - TT_UInt maxIDefs; /* maximum number of ins defs */ + FT_UInt numIDefs; /* number of instruction defs */ + FT_UInt maxIDefs; /* maximum number of ins defs */ TT_DefArray IDefs; /* table of IDefs entries */ - TT_UInt maxFunc; /* maximum function index */ - TT_UInt maxIns; /* maximum instruction index */ + FT_UInt maxFunc; /* maximum function index */ + FT_UInt maxIns; /* maximum instruction index */ - TT_Int callTop, /* top of call stack during execution */ + FT_Int callTop, /* top of call stack during execution */ callSize; /* size of call stack */ TT_CallStack callStack; /* call stack */ - TT_UShort maxPoints; /* capacity of this context's `pts' */ - TT_Short maxContours; /* record, expressed in points and */ + 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 */ - TT_UShort storeSize; /* size of current storage */ - TT_Long* storage; /* storage area */ + FT_UShort storeSize; /* size of current storage */ + FT_Long* storage; /* storage area */ - TT_F26Dot6 period; /* values used for the */ - TT_F26Dot6 phase; /* `SuperRounding' */ - TT_F26Dot6 threshold; + FT_F26Dot6 period; /* values used for the */ + FT_F26Dot6 phase; /* `SuperRounding' */ + FT_F26Dot6 threshold; /* this seems to be unused */ #if 0 - TT_Int cur_ppem; /* ppem along the current proj vector */ + FT_Int cur_ppem; /* ppem along the current proj vector */ #endif - TT_Bool instruction_trap; /* If `True', the interpreter will */ + FT_Bool instruction_trap; /* If `True', the interpreter will */ /* exit after each instruction */ TT_GraphicsState default_GS; /* graphics state resulting from */ /* the prep program */ - TT_Bool is_composite; /* true if the glyph is composite */ - TT_Bool pedantic_hinting; /* true for pedantic interpretation */ + FT_Bool is_composite; /* true if the glyph is composite */ + FT_Bool pedantic_hinting; /* true for pedantic interpretation */ /* latest interpreter additions */ - TT_Long F_dot_P; /* dot product of freedom and projection */ + FT_Long F_dot_P; /* dot product of freedom and projection */ /* vectors */ TT_Round_Func func_round; /* current rounding function */ @@ -209,7 +209,7 @@ TT_Set_CVT_Func func_write_cvt; /* write a cvt entry (in pixels) */ TT_Set_CVT_Func func_move_cvt; /* incr a cvt entry (in pixels) */ - TT_ULong loadSize; + FT_ULong loadSize; TT_SubGlyph_Stack loadStack; /* loading subglyph stack */ } TT_ExecContextRec; @@ -220,43 +220,43 @@ LOCAL_DEF - TT_Error TT_Goto_CodeRange( TT_ExecContext exec, - TT_Int range, - TT_Long IP ); + FT_Error TT_Goto_CodeRange( TT_ExecContext exec, + FT_Int range, + FT_Long IP ); LOCAL_DEF - TT_Error TT_Set_CodeRange( TT_ExecContext exec, - TT_Int range, + FT_Error TT_Set_CodeRange( TT_ExecContext exec, + FT_Int range, void* base, - TT_Long length ); + FT_Long length ); LOCAL_DEF - TT_Error TT_Clear_CodeRange( TT_ExecContext exec, - TT_Int range ); + FT_Error TT_Clear_CodeRange( TT_ExecContext exec, + FT_Int range ); FT_EXPORT_DEF( TT_ExecContext ) TT_New_Context( TT_Face face ); LOCAL_DEF - TT_Error TT_Done_Context( TT_ExecContext exec ); + FT_Error TT_Done_Context( TT_ExecContext exec ); LOCAL_DEF - TT_Error TT_Destroy_Context( TT_ExecContext exec, + FT_Error TT_Destroy_Context( TT_ExecContext exec, FT_Memory memory ); LOCAL_DEF - TT_Error TT_Load_Context( TT_ExecContext exec, + FT_Error TT_Load_Context( TT_ExecContext exec, TT_Face face, TT_Size size ); LOCAL_DEF - TT_Error TT_Save_Context( TT_ExecContext exec, + FT_Error TT_Save_Context( TT_ExecContext exec, TT_Size ins ); LOCAL_DEF - TT_Error TT_Run_Context( TT_ExecContext exec, - TT_Bool debug ); + FT_Error TT_Run_Context( TT_ExecContext exec, + FT_Bool debug ); - FT_EXPORT_DEF( TT_Error ) TT_RunIns( TT_ExecContext exec ); + FT_EXPORT_DEF( FT_Error ) TT_RunIns( TT_ExecContext exec ); #ifdef __cplusplus diff --git a/src/truetype/ttobjs.c b/src/truetype/ttobjs.c index a023233bf..eefdb6f92 100644 --- a/src/truetype/ttobjs.c +++ b/src/truetype/ttobjs.c @@ -50,6 +50,135 @@ /* */ /*************************************************************************/ + /*************************************************************************/ + /* */ + /* */ + /* TT_Done_GlyphZone */ + /* */ + /* */ + /* Deallocates a glyph zone. */ + /* */ + /* */ + /* zone :: A pointer to the target glyph zone. */ + /* */ + LOCAL_FUNC void TT_Done_GlyphZone( TT_GlyphZone* zone ) + { + FT_Memory memory = zone->memory; + + FREE( zone->contours ); + FREE( zone->tags ); + FREE( zone->cur ); + FREE( zone->org ); + + zone->max_points = zone->n_points = 0; + zone->max_contours = zone->n_contours = 0; + } + + + /*************************************************************************/ + /* */ + /* */ + /* TT_New_GlyphZone */ + /* */ + /* */ + /* Allocates a new glyph zone. */ + /* */ + /* */ + /* memory :: A handle to the current memory object. */ + /* */ + /* maxPoints :: The capacity of glyph zone in points. */ + /* */ + /* maxContours :: The capacity of glyph zone in contours. */ + /* */ + /* */ + /* zone :: A pointer to the target glyph zone record. */ + /* */ + /* */ + /* FreeType error code. 0 means success. */ + /* */ + LOCAL_FUNC FT_Error TT_New_GlyphZone( FT_Memory memory, + FT_UShort maxPoints, + FT_Short maxContours, + TT_GlyphZone* zone ) + { + FT_Error error; + + if ( maxPoints > 0 ) + maxPoints += 2; + + MEM_Set( zone, 0, sizeof ( *zone ) ); + zone->memory = memory; + + if ( ALLOC_ARRAY( zone->org, maxPoints * 2, FT_F26Dot6 ) || + ALLOC_ARRAY( zone->cur, maxPoints * 2, FT_F26Dot6 ) || + ALLOC_ARRAY( zone->tags, maxPoints, FT_Byte ) || + ALLOC_ARRAY( zone->contours, maxContours, FT_UShort ) ) + { + TT_Done_GlyphZone( zone ); + } + + return error; + } + + + /*************************************************************************/ + /* */ + /* */ + /* TT_Update_GlyphZone */ + /* */ + /* */ + /* Checks the size of a zone and reallocates it if necessary. */ + /* */ + /* */ + /* newPoints :: The new capacity for points. We add two slots for */ + /* phantom points. */ + /* */ + /* newContours :: The new capacity for contours. */ + /* */ + /* */ + /* zone :: The address of the target zone. */ + /* */ + LOCAL_FUNC FT_Error TT_Update_GlyphZone( TT_GlyphZone* zone, + FT_UShort newPoints, + FT_Short newContours ) + { + FT_Error error = FT_Err_Ok; + FT_Memory memory = zone->memory; + + + newPoints += 2; + + if ( zone->max_points < newPoints ) + { + /* reallocate the points arrays */ + if ( REALLOC_ARRAY( zone->org, zone->max_points * 2, + newPoints * 2, FT_F26Dot6 ) || + REALLOC_ARRAY( zone->cur, zone->max_points * 2, + newPoints * 2, FT_F26Dot6 ) || + REALLOC_ARRAY( zone->tags, zone->max_points * 2, + newPoints, FT_Byte ) ) + goto Exit; + + zone->max_points = newPoints; + } + + if ( zone->max_contours < newContours ) + { + /* reallocate the contours array */ + if ( REALLOC_ARRAY( zone->contours, zone->max_contours, + newContours, FT_UShort ) ) + goto Exit; + + zone->max_contours = newContours; + } + + Exit: + return error; + } + + + + /*************************************************************************/ /* */ @@ -75,13 +204,13 @@ /* TrueType error code. 0 means success. */ /* */ LOCAL_DEF - TT_Error TT_Init_Face( FT_Stream stream, + FT_Error TT_Init_Face( FT_Stream stream, TT_Face face, - TT_Int face_index, - TT_Int num_params, + FT_Int face_index, + FT_Int num_params, FT_Parameter* params ) { - TT_Error error; + FT_Error error; FT_Driver sfnt_driver; SFNT_Interface* sfnt; @@ -194,18 +323,18 @@ /* TrueType error code. 0 means success. */ /* */ LOCAL_DEF - TT_Error TT_Init_Size( TT_Size size ) + FT_Error TT_Init_Size( TT_Size size ) { - TT_Error error = 0; + FT_Error error = 0; #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER TT_Face face = (TT_Face)size->root.face; FT_Memory memory = face->root.memory; - TT_Int i; + FT_Int i; TT_ExecContext exec; - TT_UShort n_twilight; + FT_UShort n_twilight; TT_MaxProfile* maxp = &face->max_profile; @@ -250,16 +379,16 @@ TT_DefRecord ) || ALLOC_ARRAY( size->cvt, - size->cvt_size, TT_Long ) || + size->cvt_size, FT_Long ) || ALLOC_ARRAY( size->storage, - size->storage_size, TT_Long ) ) + size->storage_size, FT_Long ) ) goto Fail_Memory; /* reserve twilight zone */ n_twilight = maxp->maxTwilightPoints; - error = FT_New_GlyphZone( memory, n_twilight, 0, &size->twilight ); + error = TT_New_GlyphZone( memory, n_twilight, 0, &size->twilight ); if ( error ) goto Fail_Memory; @@ -402,7 +531,7 @@ size->storage_size = 0; /* twilight zone */ - FT_Done_GlyphZone( &size->twilight ); + TT_Done_GlyphZone( &size->twilight ); FREE( size->function_defs ); FREE( size->instruction_defs ); @@ -434,10 +563,10 @@ /* size :: A handle to the target size object. */ /* */ LOCAL_DEF - TT_Error TT_Reset_Size( TT_Size size ) + FT_Error TT_Reset_Size( TT_Size size ) { TT_Face face; - TT_Error error = TT_Err_Ok; + FT_Error error = TT_Err_Ok; FT_Size_Metrics* metrics; @@ -489,7 +618,7 @@ { TT_ExecContext exec; - TT_UInt i, j; + FT_UInt i, j; /* Scale the cvt values to the new ppem. */ @@ -583,7 +712,7 @@ /* TrueType error code. 0 means success. */ /* */ LOCAL_FUNC - TT_Error TT_Init_GlyphSlot( TT_GlyphSlot slot ) + FT_Error TT_Init_GlyphSlot( TT_GlyphSlot slot ) { /* allocate the outline space */ FT_Face face = slot->face; @@ -641,13 +770,12 @@ /* TrueType error code. 0 means success. */ /* */ LOCAL_FUNC - TT_Error TT_Init_Driver( TT_Driver driver ) + FT_Error TT_Init_Driver( TT_Driver driver ) { FT_Memory memory = driver->root.memory; - TT_Error error; + FT_Error error; - - error = FT_New_GlyphZone( memory, 0, 0, &driver->zone ); + error = TT_New_GlyphZone( memory, 0, 0, &driver->zone ); if ( error ) return error; @@ -682,7 +810,7 @@ #endif /* remove the loading glyph zone */ - FT_Done_GlyphZone( &driver->zone ); + TT_Done_GlyphZone( &driver->zone ); #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER diff --git a/src/truetype/ttobjs.h b/src/truetype/ttobjs.h index 56459e261..698e9d794 100644 --- a/src/truetype/ttobjs.h +++ b/src/truetype/ttobjs.h @@ -77,35 +77,83 @@ /* */ typedef struct TT_GraphicsState_ { - TT_UShort rp0; - TT_UShort rp1; - TT_UShort rp2; + FT_UShort rp0; + FT_UShort rp1; + FT_UShort rp2; - TT_UnitVector dualVector; - TT_UnitVector projVector; - TT_UnitVector freeVector; + FT_UnitVector dualVector; + FT_UnitVector projVector; + FT_UnitVector freeVector; - TT_Long loop; - TT_F26Dot6 minimum_distance; - TT_Int round_state; + FT_Long loop; + FT_F26Dot6 minimum_distance; + FT_Int round_state; - TT_Bool auto_flip; - TT_F26Dot6 control_value_cutin; - TT_F26Dot6 single_width_cutin; - TT_F26Dot6 single_width_value; - TT_Short delta_base; - TT_Short delta_shift; + FT_Bool auto_flip; + FT_F26Dot6 control_value_cutin; + FT_F26Dot6 single_width_cutin; + FT_F26Dot6 single_width_value; + FT_Short delta_base; + FT_Short delta_shift; - TT_Byte instruct_control; - TT_Bool scan_control; - TT_Int scan_type; + FT_Byte instruct_control; + FT_Bool scan_control; + FT_Int scan_type; - TT_UShort gep0; - TT_UShort gep1; - TT_UShort gep2; + FT_UShort gep0; + FT_UShort gep1; + FT_UShort gep2; } TT_GraphicsState; + /************************************************************************ + * + * + * TT_GlyphZone + * + * + * A glyph zone is used to load, scale and hint glyph outline + * coordinates. + * + * + * memory :: handle to memory manager + * max_points :: max size in points of zone + * max_contours :: max size in contours of zone + * n_points :: current number of points in zone + * n_contours :: current number of contours in zone + * org :: original glyph coordinates (font units/scaled) + * cur :: current glyph coordinates (scaled/hinted) + * tags :: point control tags + * contours :: contour end points + * + ***********************************************************************/ + + typedef struct TT_GlyphZone_ + { + FT_Memory memory; + FT_UShort max_points; + FT_UShort max_contours; + FT_UShort n_points; /* number of points in zone */ + FT_Short n_contours; /* number of contours */ + + FT_Vector* org; /* original point coordinates */ + FT_Vector* cur; /* current point coordinates */ + + FT_Byte* tags; /* current touch flags */ + FT_UShort* contours; /* contour end points */ + + } TT_GlyphZone; + + LOCAL_DEF void TT_Done_GlyphZone( TT_GlyphZone* zone ); + + LOCAL_DEF FT_Error TT_New_GlyphZone( FT_Memory memory, + FT_UShort maxPoints, + FT_Short maxContours, + TT_GlyphZone* zone ); + + LOCAL_DEF FT_Error TT_Update_GlyphZone( TT_GlyphZone* zone, + FT_UShort newPoints, + FT_Short newContours ); /*************************************************************************/ /* */ @@ -138,8 +186,8 @@ typedef struct TT_CodeRange_ { - TT_Byte* base; - TT_ULong size; + FT_Byte* base; + FT_ULong size; } TT_CodeRange; @@ -152,10 +200,10 @@ /* */ typedef struct TT_DefRecord_ { - TT_Int range; /* in which code range is it located? */ - TT_Long start; /* where does it start? */ - TT_UInt opc; /* function #, or instruction code */ - TT_Bool active; /* is it active? */ + FT_Int range; /* in which code range is it located? */ + FT_Long start; /* where does it start? */ + FT_UInt opc; /* function #, or instruction code */ + FT_Bool active; /* is it active? */ } TT_DefRecord, *TT_DefArray; @@ -167,9 +215,9 @@ /* */ typedef struct TT_Transform_ { - TT_Fixed xx, xy; /* transformation matrix coefficients */ - TT_Fixed yx, yy; - TT_F26Dot6 ox, oy; /* offsets */ + FT_Fixed xx, xy; /* transformation matrix coefficients */ + FT_Fixed yx, yy; + FT_F26Dot6 ox, oy; /* offsets */ } TT_Transform; @@ -180,27 +228,27 @@ /* */ typedef struct TT_SubglyphRec_ { - TT_Long index; /* subglyph index; initialized with -1 */ - TT_Bool is_scaled; /* is the subglyph scaled? */ - TT_Bool is_hinted; /* should it be hinted? */ - TT_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? */ - TT_Long file_offset; + FT_Long file_offset; - TT_BBox bbox; - TT_Pos left_bearing; - TT_Pos advance; + FT_BBox bbox; + FT_Pos left_bearing; + FT_Pos advance; - FT_GlyphZone zone; + TT_GlyphZone zone; - TT_Long arg1; /* first argument */ - TT_Long arg2; /* second argument */ + FT_Long arg1; /* first argument */ + FT_Long arg2; /* second argument */ - TT_UShort element_flag; /* current load element flag */ + FT_UShort element_flag; /* current load element flag */ TT_Transform transform; /* transformation matrix */ - TT_Vector pp1, pp2; /* phantom points */ + FT_Vector pp1, pp2; /* phantom points */ } TT_SubGlyphRec, *TT_SubGlyph_Stack; @@ -274,19 +322,19 @@ typedef struct TT_Size_Metrics_ { /* for non-square pixels */ - TT_Long x_ratio; - TT_Long y_ratio; + FT_Long x_ratio; + FT_Long y_ratio; - TT_UShort ppem; /* maximum ppem size */ - TT_Long ratio; /* current ratio */ - TT_Fixed scale; + FT_UShort ppem; /* maximum ppem size */ + FT_Long ratio; /* current ratio */ + FT_Fixed scale; - TT_F26Dot6 compensations[4]; /* device-specific compensations */ + FT_F26Dot6 compensations[4]; /* device-specific compensations */ - TT_Bool valid; + FT_Bool valid; - TT_Bool rotated; /* `is the glyph rotated?'-flag */ - TT_Bool stretched; /* `is the glyph stretched?'-flag */ + FT_Bool rotated; /* `is the glyph rotated?'-flag */ + FT_Bool stretched; /* `is the glyph stretched?'-flag */ } TT_Size_Metrics; @@ -313,28 +361,28 @@ #ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER - TT_UInt num_function_defs; /* number of function definitions */ - TT_UInt max_function_defs; + FT_UInt num_function_defs; /* number of function definitions */ + FT_UInt max_function_defs; TT_DefArray function_defs; /* table of function definitions */ - TT_UInt num_instruction_defs; /* number of ins. definitions */ - TT_UInt max_instruction_defs; + FT_UInt num_instruction_defs; /* number of ins. definitions */ + FT_UInt max_instruction_defs; TT_DefArray instruction_defs; /* table of ins. definitions */ - TT_UInt max_func; - TT_UInt max_ins; + FT_UInt max_func; + FT_UInt max_ins; TT_CodeRangeTable codeRangeTable; TT_GraphicsState GS; - TT_ULong cvt_size; /* the scaled control value table */ - TT_Long* cvt; + FT_ULong cvt_size; /* the scaled control value table */ + FT_Long* cvt; - TT_UShort storage_size; /* The storage area is now part of */ - TT_Long* storage; /* the instance */ + FT_UShort storage_size; /* The storage area is now part of */ + FT_Long* storage; /* the instance */ - FT_GlyphZone twilight; /* The instance's twilight zone */ + TT_GlyphZone twilight; /* The instance's twilight zone */ /* debugging variables */ @@ -342,7 +390,7 @@ /* execution context tied to the instance */ /* object rather than asking it on demand. */ - TT_Bool debug; + FT_Bool debug; TT_ExecContext context; #endif /* TT_CONFIG_OPTION_BYTECODE_INTERPRETER */ @@ -358,7 +406,7 @@ { FT_DriverRec root; TT_ExecContext context; /* execution context */ - FT_GlyphZone zone; /* glyph loader points zone */ + TT_GlyphZone zone; /* glyph loader points zone */ void* extension_component; @@ -370,10 +418,10 @@ /* Face functions */ /* */ LOCAL_DEF - TT_Error TT_Init_Face( FT_Stream stream, + FT_Error TT_Init_Face( FT_Stream stream, TT_Face face, - TT_Int face_index, - TT_Int num_params, + FT_Int face_index, + FT_Int num_params, FT_Parameter* params ); LOCAL_DEF @@ -385,13 +433,13 @@ /* Size functions */ /* */ LOCAL_DEF - TT_Error TT_Init_Size( TT_Size size ); + FT_Error TT_Init_Size( TT_Size size ); LOCAL_DEF void TT_Done_Size( TT_Size size ); LOCAL_DEF - TT_Error TT_Reset_Size( TT_Size size ); + FT_Error TT_Reset_Size( TT_Size size ); /*************************************************************************/ @@ -399,7 +447,7 @@ /* GlyphSlot functions */ /* */ LOCAL_DEF - TT_Error TT_Init_GlyphSlot( TT_GlyphSlot slot ); + FT_Error TT_Init_GlyphSlot( TT_GlyphSlot slot ); LOCAL_DEF void TT_Done_GlyphSlot( TT_GlyphSlot slot ); @@ -410,7 +458,7 @@ /* Driver functions */ /* */ LOCAL_DEF - TT_Error TT_Init_Driver( TT_Driver driver ); + FT_Error TT_Init_Driver( TT_Driver driver ); LOCAL_DEF void TT_Done_Driver( TT_Driver driver ); diff --git a/src/truetype/ttpload.c b/src/truetype/ttpload.c index 5789e86e4..2f143882f 100644 --- a/src/truetype/ttpload.c +++ b/src/truetype/ttpload.c @@ -53,13 +53,13 @@ /* TrueType error code. 0 means success. */ /* */ LOCAL_FUNC - TT_Error TT_Load_Locations( TT_Face face, + FT_Error TT_Load_Locations( TT_Face face, FT_Stream stream ) { - TT_Error error; + FT_Error error; FT_Memory memory = stream->memory; - TT_Short LongOffsets; - TT_ULong table_len; + FT_Short LongOffsets; + FT_ULong table_len; FT_TRACE2(( "Locations " )); @@ -74,21 +74,21 @@ if ( LongOffsets != 0 ) { - face->num_locations = (TT_UShort)( table_len >> 2 ); + face->num_locations = (FT_UShort)( table_len >> 2 ); FT_TRACE2(( "(32bit offsets): %12d ", face->num_locations )); if ( ALLOC_ARRAY( face->glyph_locations, face->num_locations, - TT_Long ) ) + FT_Long ) ) goto Exit; if ( ACCESS_Frame( face->num_locations * 4L ) ) goto Exit; { - TT_Long* loc = face->glyph_locations; - TT_Long* limit = loc + face->num_locations; + FT_Long* loc = face->glyph_locations; + FT_Long* limit = loc + face->num_locations; for ( ; loc < limit; loc++ ) @@ -99,24 +99,24 @@ } else { - face->num_locations = (TT_UShort)( table_len >> 1 ); + face->num_locations = (FT_UShort)( table_len >> 1 ); FT_TRACE2(( "(16bit offsets): %12d ", face->num_locations )); if ( ALLOC_ARRAY( face->glyph_locations, face->num_locations, - TT_Long ) ) + FT_Long ) ) goto Exit; if ( ACCESS_Frame( face->num_locations * 2L ) ) goto Exit; { - TT_Long* loc = face->glyph_locations; - TT_Long* limit = loc + face->num_locations; + FT_Long* loc = face->glyph_locations; + FT_Long* limit = loc + face->num_locations; for ( ; loc < limit; loc++ ) - *loc = (TT_Long)( (TT_ULong)GET_UShort() * 2 ); + *loc = (FT_Long)( (FT_ULong)GET_UShort() * 2 ); } FORGET_Frame(); } @@ -146,12 +146,12 @@ /* TrueType error code. 0 means success. */ /* */ LOCAL_FUNC - TT_Error TT_Load_CVT( TT_Face face, + FT_Error TT_Load_CVT( TT_Face face, FT_Stream stream ) { - TT_Error error; + FT_Error error; FT_Memory memory = stream->memory; - TT_ULong table_len; + FT_ULong table_len; FT_TRACE2(( "CVT " )); @@ -172,15 +172,15 @@ if ( ALLOC_ARRAY( face->cvt, face->cvt_size, - TT_Short ) ) + FT_Short ) ) goto Exit; if ( ACCESS_Frame( face->cvt_size * 2L ) ) goto Exit; { - TT_Short* cur = face->cvt; - TT_Short* limit = cur + face->cvt_size; + FT_Short* cur = face->cvt; + FT_Short* limit = cur + face->cvt_size; for ( ; cur < limit; cur++ ) @@ -213,11 +213,11 @@ /* TrueType error code. 0 means success. */ /* */ LOCAL_FUNC - TT_Error TT_Load_Programs( TT_Face face, + FT_Error TT_Load_Programs( TT_Face face, FT_Stream stream ) { - TT_Error error; - TT_ULong table_len; + FT_Error error; + FT_ULong table_len; FT_TRACE2(( "Font program " )); diff --git a/src/truetype/ttpload.h b/src/truetype/ttpload.h index 4e44b3885..f731551bf 100644 --- a/src/truetype/ttpload.h +++ b/src/truetype/ttpload.h @@ -28,15 +28,15 @@ LOCAL_DEF - TT_Error TT_Load_Locations( TT_Face face, + FT_Error TT_Load_Locations( TT_Face face, FT_Stream stream ); LOCAL_DEF - TT_Error TT_Load_CVT( TT_Face face, + FT_Error TT_Load_CVT( TT_Face face, FT_Stream stream ); LOCAL_DEF - TT_Error TT_Load_Programs( TT_Face face, + FT_Error TT_Load_Programs( TT_Face face, FT_Stream stream ); #endif /* TTPLOAD_H */ diff --git a/src/type1/t1afm.c b/src/type1/t1afm.c index ec216f555..806b84ccb 100644 --- a/src/type1/t1afm.c +++ b/src/type1/t1afm.c @@ -96,7 +96,7 @@ #undef KERN_INDEX -#define KERN_INDEX(g1,g2) (((T1_ULong)g1 << 16) | g2) +#define KERN_INDEX(g1,g2) (((FT_ULong)g1 << 16) | g2) /* compare two kerning pairs */ static @@ -105,8 +105,8 @@ T1_Kern_Pair* pair1 = (T1_Kern_Pair*)a; T1_Kern_Pair* pair2 = (T1_Kern_Pair*)b; - T1_ULong index1 = KERN_INDEX(pair1->glyph1,pair1->glyph2); - T1_ULong index2 = KERN_INDEX(pair2->glyph1,pair2->glyph2); + FT_ULong index1 = KERN_INDEX(pair1->glyph1,pair1->glyph2); + FT_ULong index2 = KERN_INDEX(pair2->glyph1,pair2->glyph2); return ( index1 < index2 ? -1 : ( index1 > index2 ? 1 : 0 )); @@ -202,7 +202,7 @@ FT_Vector* kerning ) { T1_Kern_Pair *min, *mid, *max; - T1_ULong index = KERN_INDEX(glyph1,glyph2); + FT_ULong index = KERN_INDEX(glyph1,glyph2); /* simple binary search */ min = afm->kern_pairs; @@ -210,7 +210,7 @@ while (min <= max) { - T1_ULong midi; + FT_ULong midi; mid = min + (max-min)/2; midi = KERN_INDEX(mid->glyph1,mid->glyph2); diff --git a/src/type1/t1driver.c b/src/type1/t1driver.c index d96eddf59..04f7f31dd 100644 --- a/src/type1/t1driver.c +++ b/src/type1/t1driver.c @@ -101,10 +101,10 @@ /* They can be implemented by format-specific interfaces. */ /* */ static - T1_Error Get_Kerning( T1_Face face, - T1_UInt left_glyph, - T1_UInt right_glyph, - T1_Vector* kerning ) + FT_Error Get_Kerning( T1_Face face, + FT_UInt left_glyph, + FT_UInt right_glyph, + FT_Vector* kerning ) { T1_AFM* afm; @@ -136,11 +136,11 @@ /* FreeType error code. 0 means success */ /* */ static - T1_Error Set_Char_Sizes( T1_Size size, - T1_F26Dot6 char_width, - T1_F26Dot6 char_height, - T1_UInt horz_resolution, - T1_UInt vert_resolution ) + FT_Error Set_Char_Sizes( T1_Size size, + FT_F26Dot6 char_width, + FT_F26Dot6 char_height, + FT_UInt horz_resolution, + FT_UInt vert_resolution ) { UNUSED(char_width); UNUSED(char_height); @@ -178,9 +178,9 @@ /* FreeType error code. 0 means success */ /* */ static - T1_Error Set_Pixel_Sizes( T1_Size size, - T1_Int pixel_width, - T1_Int pixel_height ) + FT_Error Set_Pixel_Sizes( T1_Size size, + FT_Int pixel_width, + FT_Int pixel_height ) { UNUSED(pixel_width); UNUSED(pixel_height); @@ -205,11 +205,11 @@ /* Glyph index. 0 means `undefined character code'. */ /* */ static - T1_UInt Get_Char_Index( FT_CharMap charmap, - T1_Long charcode ) + FT_UInt Get_Char_Index( FT_CharMap charmap, + FT_Long charcode ) { T1_Face face; - T1_UInt result = 0; + FT_UInt result = 0; PSNames_Interface* psnames; face = (T1_Face)charmap->face; @@ -225,7 +225,7 @@ { /* use the "psnames" module to synthetize the Unicode charmap */ result = psnames->lookup_unicode( &face->unicode_map, - (T1_ULong)charcode ); + (FT_ULong)charcode ); /* the function returns 0xFFFF when the Unicode charcode has */ /* no corresponding glyph.. */ diff --git a/src/type1/t1gload.c b/src/type1/t1gload.c index aac176ba6..2f5280db9 100644 --- a/src/type1/t1gload.c +++ b/src/type1/t1gload.c @@ -199,11 +199,11 @@ *********************************************************************/ static - T1_Int lookup_glyph_by_stdcharcode( T1_Face face, - T1_Int charcode ) + FT_Int lookup_glyph_by_stdcharcode( T1_Face face, + FT_Int charcode ) { - T1_Int n; - const T1_String* glyph_name; + FT_Int n; + const FT_String* glyph_name; PSNames_Interface* psnames = (PSNames_Interface*)face->psnames; /* check range of standard char code */ @@ -215,7 +215,7 @@ for ( n = 0; n < face->type1.num_glyphs; n++ ) { - T1_String* name = (T1_String*)face->type1.glyph_names[n]; + FT_String* name = (FT_String*)face->type1.glyph_names[n]; if ( name && strcmp(name,glyph_name) == 0 ) return n; @@ -247,19 +247,19 @@ *********************************************************************/ static - T1_Error t1operator_seac( T1_Decoder* decoder, - T1_Pos asb, - T1_Pos adx, - T1_Pos ady, - T1_Int bchar, - T1_Int achar ) + FT_Error t1operator_seac( T1_Decoder* decoder, + FT_Pos asb, + FT_Pos adx, + FT_Pos ady, + FT_Int bchar, + FT_Int achar ) { - T1_Error error; + FT_Error error; T1_Face face = decoder->builder.face; - T1_Int bchar_index, achar_index, n_base_points; + FT_Int bchar_index, achar_index, n_base_points; FT_Outline* cur = &decoder->builder.current; FT_Outline* base = &decoder->builder.base; - T1_Vector left_bearing, advance; + FT_Vector left_bearing, advance; T1_Font* type1 = &face->type1; bchar_index = lookup_glyph_by_stdcharcode( face, bchar ); @@ -357,7 +357,7 @@ /* adjust contours in accented character outline */ { - T1_Int n; + FT_Int n; for ( n = 0; n < cur->n_contours; n++ ) cur->contours[n] += n_base_points; @@ -394,14 +394,14 @@ *********************************************************************/ static - T1_Error t1operator_flex( T1_Decoder* decoder, - T1_Pos threshold, - T1_Pos end_x, - T1_Pos end_y ) + FT_Error t1operator_flex( T1_Decoder* decoder, + FT_Pos threshold, + FT_Pos end_x, + FT_Pos end_y ) { - T1_Vector vec; - T1_Vector* flex = decoder->flex_vectors; - T1_Int n; + FT_Vector vec; + FT_Vector* flex = decoder->flex_vectors; + FT_Int n; /* we don't even try to test the threshold in the non-hinting */ /* builder, even if the flex operator is said to be a path */ @@ -460,22 +460,22 @@ *********************************************************************/ LOCAL_FUNC - T1_Error T1_Parse_CharStrings( T1_Decoder* decoder, - T1_Byte* charstring_base, - T1_Int charstring_len, - T1_Int num_subrs, - T1_Byte** subrs_base, - T1_Int* subrs_len ) + FT_Error T1_Parse_CharStrings( T1_Decoder* decoder, + FT_Byte* charstring_base, + FT_Int charstring_len, + FT_Int num_subrs, + FT_Byte** subrs_base, + FT_Int* subrs_len ) { - T1_Error error; + FT_Error error; T1_Decoder_Zone* zone; - T1_Byte* ip; - T1_Byte* limit; + FT_Byte* ip; + FT_Byte* limit; T1_Builder* builder = &decoder->builder; T1_Builder_Funcs* builds = &builder->funcs; T1_Hinter_Funcs* hints = &decoder->hinter; - static const T1_Int args_count[ op_max ] = + static const FT_Int args_count[ op_max ] = { 0, /* none */ 0, /* endchar */ @@ -521,9 +521,9 @@ /* now, execute loop */ while ( ip < limit ) { - T1_Int* top = decoder->top; + FT_Int* top = decoder->top; T1_Operator op = op_none; - T1_Long value = 0; + FT_Long value = 0; /* First of all, decompress operator or value */ switch (*ip++) @@ -656,8 +656,8 @@ case 2: /* add flex vector ------------------------------- */ { - T1_Int index; - T1_Vector* flex; + FT_Int index; + FT_Vector* flex; if (top[0] != 0) goto Unexpected_OtherSubr; @@ -747,7 +747,7 @@ } else { - T1_Int num_args = args_count[op]; + FT_Int num_args = args_count[op]; if ( top - decoder->stack < num_args ) goto Stack_Underflow; @@ -861,7 +861,7 @@ case op_callsubr: { - T1_Int index = top[0]; + FT_Int index = top[0]; if ( index < 0 || index >= num_subrs ) { @@ -959,10 +959,10 @@ /* invoked.. */ /* */ LOCAL_FUNC - T1_Error T1_Add_Points( T1_Builder* builder, - T1_Int num_points ) + FT_Error T1_Add_Points( T1_Builder* builder, + FT_Int num_points ) { - T1_Int new_points; + FT_Int new_points; new_points = builder->base.n_points + builder->current.n_points + @@ -971,18 +971,18 @@ if ( new_points > builder->max_points ) { FT_Memory memory = builder->memory; - T1_Error error; - T1_Int increment = builder->current.points - builder->base.points; - T1_Int current = builder->max_points; + FT_Error error; + FT_Int increment = builder->current.points - builder->base.points; + FT_Int current = builder->max_points; while ( builder->max_points < new_points ) builder->max_points += 16; if ( REALLOC_ARRAY( builder->base.points, - current, builder->max_points, T1_Vector ) || + current, builder->max_points, FT_Vector ) || REALLOC_ARRAY( builder->base.tags, - current, builder->max_points, T1_Byte ) ) + current, builder->max_points, FT_Byte ) ) return error; builder->current.points = builder->base.points + increment; @@ -1014,10 +1014,10 @@ /* invoked.. */ /* */ LOCAL_FUNC - T1_Error T1_Add_Contours( T1_Builder* builder, - T1_Int num_contours ) + FT_Error T1_Add_Contours( T1_Builder* builder, + FT_Int num_contours ) { - T1_Int new_contours; + FT_Int new_contours; new_contours = builder->base.n_contours + builder->current.n_contours + @@ -1025,16 +1025,16 @@ if ( new_contours > builder->max_contours && builder->load_points ) { - T1_Error error; + FT_Error error; FT_Memory memory = builder->memory; - T1_Int increment = builder->current.contours - builder->base.contours; - T1_Int current = builder->max_contours; + FT_Int increment = builder->current.contours - builder->base.contours; + FT_Int current = builder->max_contours; while ( builder->max_contours < new_contours ) builder->max_contours += 4; if ( REALLOC_ARRAY( builder->base.contours, - current, builder->max_contours, T1_Short ) ) + current, builder->max_contours, FT_Short ) ) return error; builder->current.contours = builder->base.contours + increment; @@ -1064,11 +1064,11 @@ static - T1_Error maxadv_sbw( T1_Decoder* decoder, - T1_Pos sbx, - T1_Pos sby, - T1_Pos wx, - T1_Pos wy ) + FT_Error maxadv_sbw( T1_Decoder* decoder, + FT_Pos sbx, + FT_Pos sby, + FT_Pos wx, + FT_Pos wy ) { if (wx > decoder->builder.advance.x) decoder->builder.advance.x = wx; @@ -1082,7 +1082,7 @@ static - T1_Int maxadv_error( void ) + FT_Int maxadv_error( void ) { /* we should never reach this code, unless with a buggy font */ return -2; @@ -1120,12 +1120,12 @@ LOCAL_FUNC - T1_Error T1_Compute_Max_Advance( T1_Face face, - T1_Int *max_advance ) + FT_Error T1_Compute_Max_Advance( T1_Face face, + FT_Int *max_advance ) { - T1_Error error; + FT_Error error; T1_Decoder decoder; - T1_Int glyph_index; + FT_Int glyph_index; T1_Font* type1 = &face->type1; *max_advance = 0; @@ -1175,12 +1175,12 @@ static - T1_Error close_open_path( T1_Builder* builder ) + FT_Error close_open_path( T1_Builder* builder ) { - T1_Error error; + FT_Error error; FT_Outline* cur = &builder->current; - T1_Int num_points; - T1_Int first_point; + FT_Int num_points; + FT_Int first_point; /* Some fonts, like Hershey, are made of "open paths" which are */ /* now managed directly by FreeType. In this case, it is necessary */ @@ -1196,9 +1196,9 @@ num_points = cur->n_points - first_point - 2; if ( num_points > 0 ) { - T1_Vector* source_point; + FT_Vector* source_point; char* source_tags; - T1_Vector* point; + FT_Vector* point; char* tags; error = T1_Add_Points( builder, num_points ); @@ -1228,7 +1228,7 @@ static - T1_Error gload_closepath( T1_Builder* builder ) + FT_Error gload_closepath( T1_Builder* builder ) { FT_Outline* cur = &builder->current; @@ -1250,10 +1250,10 @@ static - T1_Error gload_endchar( T1_Builder* builder ) + FT_Error gload_endchar( T1_Builder* builder ) { FT_Outline* cur = &builder->current; - T1_Error error; + FT_Error error; /* close path if needed */ if (builder->path_begun) @@ -1273,11 +1273,11 @@ static - T1_Error gload_sbw( T1_Builder* builder, - T1_Pos sbx, - T1_Pos sby, - T1_Pos wx, - T1_Pos wy ) + FT_Error gload_sbw( T1_Builder* builder, + FT_Pos sbx, + FT_Pos sby, + FT_Pos wx, + FT_Pos wy ) { builder->left_bearing.x += sbx; builder->left_bearing.y += sby; @@ -1293,13 +1293,13 @@ static - T1_Error gload_rlineto( T1_Builder* builder, - T1_Pos dx, - T1_Pos dy ) + FT_Error gload_rlineto( T1_Builder* builder, + FT_Pos dx, + FT_Pos dy ) { - T1_Error error; + FT_Error error; FT_Outline* cur = &builder->current; - T1_Vector vec; + FT_Vector vec; /* grow buffer if necessary */ error = T1_Add_Points ( builder, 1 ); @@ -1324,13 +1324,13 @@ static - T1_Error gload_rmoveto( T1_Builder* builder, - T1_Pos dx, - T1_Pos dy ) + FT_Error gload_rmoveto( T1_Builder* builder, + FT_Pos dx, + FT_Pos dy ) { - T1_Error error; + FT_Error error; FT_Outline* cur = &builder->current; - T1_Vector vec; + FT_Vector vec; /* in the case where "path_begun" is set, we have a rmoveto */ /* after some normal path definition. When the face's paint */ @@ -1374,18 +1374,18 @@ static - T1_Error gload_rrcurveto( T1_Builder* builder, - T1_Pos dx1, - T1_Pos dy1, - T1_Pos dx2, - T1_Pos dy2, - T1_Pos dx3, - T1_Pos dy3 ) + FT_Error gload_rrcurveto( T1_Builder* builder, + FT_Pos dx1, + FT_Pos dy1, + FT_Pos dx2, + FT_Pos dy2, + FT_Pos dx3, + FT_Pos dy3 ) { - T1_Error error; + FT_Error error; FT_Outline* cur = &builder->current; - T1_Vector vec; - T1_Vector* points; + FT_Vector vec; + FT_Vector* points; char* tags; /* grow buffer if necessary */ @@ -1422,7 +1422,7 @@ static - T1_Error gload_ignore( void ) + FT_Error gload_ignore( void ) { return 0; } @@ -1542,7 +1542,7 @@ /* adjust contours in accented character outline */ { - T1_Int n; + FT_Int n; for ( n = 0; n < cur->n_contours; n++ ) cur->contours[n] += n_base_points; @@ -1595,15 +1595,15 @@ LOCAL_FUNC - T1_Error T1_Load_Glyph( T1_GlyphSlot glyph, + FT_Error T1_Load_Glyph( T1_GlyphSlot glyph, T1_Size size, - T1_Int glyph_index, - T1_Int load_flags ) + FT_Int glyph_index, + FT_Int load_flags ) { - T1_Error error; + FT_Error error; T1_Decoder decoder; T1_Face face = (T1_Face)glyph->root.face; - T1_Bool hinting; + FT_Bool hinting; T1_Font* type1 = &face->type1; if (load_flags & FT_LOAD_NO_RECURSE) @@ -1725,11 +1725,11 @@ else if ( (load_flags & FT_LOAD_NO_SCALE) == 0 ) { /* scale the outline and the metrics */ - T1_Int n; + FT_Int n; FT_Outline* cur = &decoder.builder.base; - T1_Vector* vec = cur->points; - T1_Fixed x_scale = glyph->x_scale; - T1_Fixed y_scale = glyph->y_scale; + FT_Vector* vec = cur->points; + FT_Fixed x_scale = glyph->x_scale; + FT_Fixed y_scale = glyph->y_scale; /* First of all, scale the points */ for ( n = cur->n_points; n > 0; n--, vec++ ) diff --git a/src/type1/t1gload.h b/src/type1/t1gload.h index 37a9aadfe..d0f678fb2 100644 --- a/src/type1/t1gload.h +++ b/src/type1/t1gload.h @@ -54,31 +54,31 @@ /* */ typedef struct T1_Builder_ T1_Builder; - typedef T1_Error (*T1_Builder_EndChar)( T1_Builder* loader ); + typedef FT_Error (*T1_Builder_EndChar)( T1_Builder* loader ); - typedef T1_Error (*T1_Builder_Sbw) ( T1_Builder* loader, - T1_Pos sbx, - T1_Pos sby, - T1_Pos wx, - T1_Pos wy ); + typedef FT_Error (*T1_Builder_Sbw) ( T1_Builder* loader, + FT_Pos sbx, + FT_Pos sby, + FT_Pos wx, + FT_Pos wy ); - typedef T1_Error (*T1_Builder_ClosePath)( T1_Builder* loader ); + typedef FT_Error (*T1_Builder_ClosePath)( T1_Builder* loader ); - typedef T1_Error (*T1_Builder_RLineTo)( T1_Builder* loader, - T1_Pos dx, - T1_Pos dy ); + typedef FT_Error (*T1_Builder_RLineTo)( T1_Builder* loader, + FT_Pos dx, + FT_Pos dy ); - typedef T1_Error (*T1_Builder_RMoveTo)( T1_Builder* loader, - T1_Pos dx, - T1_Pos dy ); + typedef FT_Error (*T1_Builder_RMoveTo)( T1_Builder* loader, + FT_Pos dx, + FT_Pos dy ); - typedef T1_Error (*T1_Builder_RCurveTo)( T1_Builder* loader, - T1_Pos dx1, - T1_Pos dy1, - T1_Pos dx2, - T1_Pos dy2, - T1_Pos dx3, - T1_Pos dy3 ); + typedef FT_Error (*T1_Builder_RCurveTo)( T1_Builder* loader, + FT_Pos dx1, + FT_Pos dy1, + FT_Pos dx2, + FT_Pos dy2, + FT_Pos dx3, + FT_Pos dy3 ); typedef struct T1_Builder_Funcs_ { @@ -146,27 +146,27 @@ FT_Outline current; /* the current glyph outline */ FT_Outline base; /* the composite glyph outline */ - T1_Int max_points; /* capacity of base outline in points */ - T1_Int max_contours; /* capacity of base outline in contours */ + FT_Int max_points; /* capacity of base outline in points */ + FT_Int max_contours; /* capacity of base outline in contours */ - T1_Vector last; + FT_Vector last; - T1_Fixed scale_x; - T1_Fixed scale_y; + FT_Fixed scale_x; + FT_Fixed scale_y; - T1_Pos pos_x; - T1_Pos pos_y; + FT_Pos pos_x; + FT_Pos pos_y; - T1_Vector left_bearing; - T1_Vector advance; - T1_Bool no_recurse; + FT_Vector left_bearing; + FT_Vector advance; + FT_Bool no_recurse; - T1_BBox bbox; /* bounding box */ - T1_Bool path_begun; - T1_Bool load_points; + FT_BBox bbox; /* bounding box */ + FT_Bool path_begun; + FT_Bool load_points; - T1_Int pass; - T1_Int hint_point; + FT_Int pass; + FT_Int hint_point; /* path construction function interface */ T1_Builder_Funcs funcs; @@ -182,24 +182,24 @@ /* used by a Type 1 hinter to perform outline hinting. */ /* */ - typedef T1_Error (*T1_Hinter_ChangeHints)( T1_Builder* builder ); + typedef FT_Error (*T1_Hinter_ChangeHints)( T1_Builder* builder ); - typedef T1_Error (*T1_Hinter_DotSection)( T1_Builder* builder ); + typedef FT_Error (*T1_Hinter_DotSection)( T1_Builder* builder ); - typedef T1_Error (*T1_Hinter_Stem)( T1_Builder* builder, - T1_Pos pos, - T1_Pos width, - T1_Bool vertical ); + typedef FT_Error (*T1_Hinter_Stem)( T1_Builder* builder, + FT_Pos pos, + FT_Pos width, + FT_Bool vertical ); - typedef T1_Error (*T1_Hinter_Stem3)( T1_Builder* builder, - T1_Pos pos0, - T1_Pos width0, - T1_Pos pos1, - T1_Pos width1, - T1_Pos pos2, - T1_Pos width2, - T1_Bool vertical ); + typedef FT_Error (*T1_Hinter_Stem3)( T1_Builder* builder, + FT_Pos pos0, + FT_Pos width0, + FT_Pos pos1, + FT_Pos width1, + FT_Pos pos2, + FT_Pos width2, + FT_Bool vertical ); typedef struct T1_Hinter_Func_ { @@ -251,9 +251,9 @@ /* execution context charstring zone */ typedef struct T1_Decoder_Zone_ { - T1_Byte* base; - T1_Byte* limit; - T1_Byte* cursor; + FT_Byte* base; + FT_Byte* limit; + FT_Byte* cursor; } T1_Decoder_Zone; @@ -263,15 +263,15 @@ T1_Builder builder; T1_Hinter_Funcs hinter; - T1_Int stack[ T1_MAX_CHARSTRINGS_OPERANDS ]; - T1_Int* top; + FT_Int stack[ T1_MAX_CHARSTRINGS_OPERANDS ]; + FT_Int* top; T1_Decoder_Zone zones[ T1_MAX_SUBRS_CALLS+1 ]; T1_Decoder_Zone* zone; - T1_Int flex_state; - T1_Int num_flex_vectors; - T1_Vector flex_vectors[7]; + FT_Int flex_state; + FT_Int num_flex_vectors; + FT_Vector flex_vectors[7]; } T1_Decoder; @@ -357,18 +357,18 @@ /* Compute the maximum advance width of a font through quick parsing */ LOCAL_DEF - T1_Error T1_Compute_Max_Advance( T1_Face face, - T1_Int *max_advance ); + FT_Error T1_Compute_Max_Advance( T1_Face face, + FT_Int *max_advance ); /* This function is exported, because it is used by the T1Dump utility */ LOCAL_DEF - T1_Error T1_Parse_CharStrings( T1_Decoder* decoder, - T1_Byte* charstring_base, - T1_Int charstring_len, - T1_Int num_subrs, - T1_Byte** subrs_base, - T1_Int* subrs_len ); + FT_Error T1_Parse_CharStrings( T1_Decoder* decoder, + FT_Byte* charstring_base, + FT_Int charstring_len, + FT_Int num_subrs, + FT_Byte** subrs_base, + FT_Int* subrs_len ); @@ -394,8 +394,8 @@ /* invoked.. */ /* */ LOCAL_DEF - T1_Error T1_Add_Points( T1_Builder* builder, - T1_Int num_points ); + FT_Error T1_Add_Points( T1_Builder* builder, + FT_Int num_points ); /*************************************************************************/ /* */ @@ -419,15 +419,15 @@ /* invoked.. */ /* */ LOCAL_DEF - T1_Error T1_Add_Contours( T1_Builder* builder, - T1_Int num_contours ); + FT_Error T1_Add_Contours( T1_Builder* builder, + FT_Int num_contours ); LOCAL_DEF - T1_Error T1_Load_Glyph( T1_GlyphSlot glyph, + FT_Error T1_Load_Glyph( T1_GlyphSlot glyph, T1_Size size, - T1_Int glyph_index, - T1_Int load_flags ); + FT_Int glyph_index, + FT_Int load_flags ); #ifdef __cplusplus diff --git a/src/type1/t1hinter.c b/src/type1/t1hinter.c index 861b0c6fc..ac13c2f57 100644 --- a/src/type1/t1hinter.c +++ b/src/type1/t1hinter.c @@ -78,11 +78,11 @@ /* ultra simple bubble sort (not a lot of elements, mostly */ /* pre-sorted, no need for quicksort) */ static - void t1_sort_blues( T1_Int* blues, - T1_Int count ) + void t1_sort_blues( FT_Int* blues, + FT_Int count ) { - T1_Int i, swap; - T1_Int* cur; + FT_Int i, swap; + FT_Int* cur; for ( i = 2; i < count; i += 2 ) { @@ -102,21 +102,21 @@ static - T1_Error t1_set_blue_zones( T1_Size size ) + FT_Error t1_set_blue_zones( T1_Size size ) { T1_Face face = (T1_Face)size->root.face; T1_Private* priv = &face->type1.private_dict; - T1_Int n; - T1_Int blues[24]; - T1_Int num_bottom; - T1_Int num_top; - T1_Int num_blues; + FT_Int n; + FT_Int blues[24]; + FT_Int num_bottom; + FT_Int num_top; + FT_Int num_blues; T1_Size_Hints* hints = size->hints; T1_Snap_Zone* zone; - T1_Pos pix, orus; - T1_Pos min, max, threshold; - T1_Fixed scale; - T1_Bool is_bottom; + FT_Pos pix, orus; + FT_Pos min, max, threshold; + FT_Fixed scale; + FT_Bool is_bottom; /**********************************************************************/ /* */ @@ -276,14 +276,14 @@ ************************************************************************/ static - T1_Error t1_set_snap_zones( T1_Size size ) + FT_Error t1_set_snap_zones( T1_Size size ) { - T1_Int n, direction, n_zones, num_zones; + FT_Int n, direction, n_zones, num_zones; T1_Snap_Zone* zone; T1_Snap_Zone* base_zone; - T1_Short* orgs; - T1_Pos standard_width; - T1_Fixed scale; + FT_Short* orgs; + FT_Pos standard_width; + FT_Fixed scale; T1_Face face = (T1_Face)size->root.face; T1_Private* priv = &face->type1.private_dict; @@ -304,7 +304,7 @@ /* Read and scale stem snap widths table from the physical */ /* font record. */ /* */ - T1_Pos prev, orus, pix, min, max, threshold; + FT_Pos prev, orus, pix, min, max, threshold; threshold = ONE_PIXEL/4; zone = base_zone; @@ -376,7 +376,7 @@ if ( standard_width > 0 ) { T1_Snap_Zone* parent; - T1_Pos std_pix, std_min, std_max; + FT_Pos std_pix, std_min, std_max; std_pix = SCALE( standard_width ); @@ -486,7 +486,7 @@ ************************************************************************/ LOCAL_FUNC - T1_Error T1_New_Size_Hinter( T1_Size size ) + FT_Error T1_New_Size_Hinter( T1_Size size ) { FT_Memory memory = size->root.face->memory; @@ -535,7 +535,7 @@ ************************************************************************/ LOCAL_FUNC - T1_Error T1_Reset_Size_Hinter( T1_Size size ) + FT_Error T1_Reset_Size_Hinter( T1_Size size ) { return t1_set_blue_zones(size) || t1_set_snap_zones(size); } @@ -559,7 +559,7 @@ ************************************************************************/ LOCAL_FUNC - T1_Error T1_New_Glyph_Hinter( T1_GlyphSlot glyph ) + FT_Error T1_New_Glyph_Hinter( T1_GlyphSlot glyph ) { FT_Memory memory = glyph->root.face->memory; @@ -605,23 +605,23 @@ /**********************************************************************/ static - T1_Error t1_hinter_ignore( void ) + FT_Error t1_hinter_ignore( void ) { /* do nothing, used for "dotsection" which is unsupported for now */ return 0; } static - T1_Error t1_hinter_stem( T1_Builder* builder, - T1_Pos pos, - T1_Int width, - T1_Bool vertical ) + FT_Error t1_hinter_stem( T1_Builder* builder, + FT_Pos pos, + FT_Int width, + FT_Bool vertical ) { T1_Stem_Table* stem_table; T1_Stem_Hint* stems; T1_Stem_Hint* cur_stem; - T1_Int min, max, n, num_stems; - T1_Bool new_stem; + FT_Int min, max, n, num_stems; + FT_Bool new_stem; T1_Glyph_Hints* hinter = builder->glyph->hints; /* select the appropriate stem array */ @@ -698,14 +698,14 @@ static - T1_Error t1_hinter_stem3( T1_Builder* builder, - T1_Pos pos0, - T1_Int width0, - T1_Pos pos1, - T1_Int width1, - T1_Pos pos2, - T1_Int width2, - T1_Bool vertical ) + FT_Error t1_hinter_stem3( T1_Builder* builder, + FT_Pos pos0, + FT_Int width0, + FT_Pos pos1, + FT_Int width1, + FT_Pos pos2, + FT_Int width2, + FT_Bool vertical ) { /* For now, don't be elitist and simply call "stem" 3 times */ return t1_hinter_stem( builder, pos0, width0, vertical ) || @@ -715,9 +715,9 @@ static - T1_Error t1_hinter_changehints( T1_Builder* builder ) + FT_Error t1_hinter_changehints( T1_Builder* builder ) { - T1_Int dimension; + FT_Int dimension; T1_Stem_Table* stem_table; T1_Glyph_Hints* hinter = builder->glyph->hints; @@ -787,11 +787,11 @@ static void t1_sort_hints( T1_Stem_Table* table ) { - T1_Int num_stems = table->num_stems; - T1_Int num_active = 0; - T1_Int* sort = table->sort; + FT_Int num_stems = table->num_stems; + FT_Int num_active = 0; + FT_Int* sort = table->sort; T1_Stem_Hint* stems = table->stems; - T1_Int n; + FT_Int n; /* record active stems in sort table */ for ( n = 0; n < num_stems; n++ ) @@ -805,12 +805,12 @@ /* simple bubble sort (quicksort would be slower).. */ for ( n = 1; n < num_active; n++ ) { - T1_Int p = n-1; + FT_Int p = n-1; T1_Stem_Hint* cur = stems + sort[n]; do { - T1_Int swap; + FT_Int swap; T1_Stem_Hint* prev = stems + sort[p]; /* note that by definition, the active stems cannot overlap */ @@ -861,8 +861,8 @@ static void t1_hint_horizontal_stems( T1_Stem_Table* table, T1_Size_Hints* hints, - T1_Pos blueShift, - T1_Fixed scale ) + FT_Pos blueShift, + FT_Fixed scale ) { T1_Stem_Hint* stem = table->stems; T1_Stem_Hint* limit = stem + table->num_stems; @@ -873,28 +873,28 @@ /* then scan the horizontal stem table */ for ( ; stem < limit; stem++ ) { - T1_Pos bottom_orus = stem->min_edge.orus; - T1_Pos top_orus = stem->max_edge.orus; + FT_Pos bottom_orus = stem->min_edge.orus; + FT_Pos top_orus = stem->max_edge.orus; - T1_Pos top_pix = SCALE( top_orus ); - T1_Pos bottom_pix = SCALE( bottom_orus ); - T1_Pos width_pix = top_pix - bottom_pix; + FT_Pos top_pix = SCALE( top_orus ); + FT_Pos bottom_pix = SCALE( bottom_orus ); + FT_Pos width_pix = top_pix - bottom_pix; - T1_Pos bottom = bottom_pix; - T1_Pos top = top_pix; - T1_Int align = T1_ALIGN_NONE; + FT_Pos bottom = bottom_pix; + FT_Pos top = top_pix; + FT_Int align = T1_ALIGN_NONE; /******************************************************************/ /* Snap pixel width if in stem snap range */ { T1_Snap_Zone* zone = hints->snap_heights; T1_Snap_Zone* zone_limit = zone + hints->num_snap_heights; - T1_Pos best_dist = 32000; + FT_Pos best_dist = 32000; T1_Snap_Zone* best_zone = 0; for ( ; zone < zone_limit; zone++ ) { - T1_Pos dist; + FT_Pos dist; dist = width_pix - zone->min; if (dist < 0) dist = -dist; if (dist < best_dist) @@ -930,7 +930,7 @@ /******************************************************************/ /* Now check for bottom blue zones alignement */ { - T1_Int num_blues = hints->num_bottom_zones; + FT_Int num_blues = hints->num_bottom_zones; T1_Snap_Zone* blue = hints->blue_zones; T1_Snap_Zone* blue_limit = blue + num_blues; @@ -947,7 +947,7 @@ /* implements blue shift */ if (!hints->supress_overshoots) { - T1_Pos delta = blue->pix - bottom_pix; + FT_Pos delta = blue->pix - bottom_pix; delta = ( delta < blueShift ? 0 : ROUND( delta ) ); bottom -= delta; @@ -960,7 +960,7 @@ /******************************************************************/ /* Check for top blue zones alignement */ { - T1_Int num_blues = hints->num_blue_zones - + FT_Int num_blues = hints->num_blue_zones - hints->num_bottom_zones; T1_Snap_Zone* blue = hints->blue_zones + @@ -981,7 +981,7 @@ /* implements blue shift */ if (!hints->supress_overshoots) { - T1_Pos delta = top - blue->pix; + FT_Pos delta = top - blue->pix; delta = ( delta < blueShift ? 0 : ROUND( delta ) ); top += delta; @@ -1056,16 +1056,16 @@ static void t1_hint_vertical_stems( T1_Stem_Table* table, T1_Size_Hints* hints, - T1_Fixed scale ) + FT_Fixed scale ) { T1_Stem_Hint* stem = table->stems; T1_Stem_Hint* limit = stem + table->num_stems; for ( ; stem < limit; stem++ ) { - T1_Pos stem_left = stem->min_edge.orus; - T1_Pos stem_right = stem->max_edge.orus; - T1_Pos width_pix, left; + FT_Pos stem_left = stem->min_edge.orus; + FT_Pos stem_right = stem->max_edge.orus; + FT_Pos width_pix, left; width_pix = SCALE( stem_right - stem_left ); @@ -1073,12 +1073,12 @@ { T1_Snap_Zone* zone = hints->snap_heights; T1_Snap_Zone* zone_limit = zone + hints->num_snap_heights; - T1_Pos best_dist = 32000; + FT_Pos best_dist = 32000; T1_Snap_Zone* best_zone = 0; for ( ; zone < zone_limit; zone++ ) { - T1_Pos dist; + FT_Pos dist; dist = width_pix - zone->min; if (dist < 0) dist = -dist; if (dist < best_dist) @@ -1151,17 +1151,17 @@ ************************************************************************/ static - T1_Pos t1_hint_point( T1_Stem_Table* table, - T1_Pos coord, - T1_Fixed scale ) + FT_Pos t1_hint_point( T1_Stem_Table* table, + FT_Pos coord, + FT_Fixed scale ) { - T1_Int num_active = table->num_active; - T1_Int n; + FT_Int num_active = table->num_active; + FT_Int n; T1_Stem_Hint* prev = 0; T1_Stem_Hint* cur = 0; T1_Edge* min; T1_Edge* max; - T1_Pos delta; + FT_Pos delta; /* only hint when there is at least one stem defined */ if (num_active <= 0) @@ -1239,19 +1239,19 @@ LOCAL_FUNC void T1_Hint_Points( T1_Builder* builder ) { - T1_Int first = builder->hint_point; - T1_Int last = builder->current.n_points-1; + FT_Int first = builder->hint_point; + FT_Int last = builder->current.n_points-1; T1_Size size = builder->size; - T1_Fixed scale_x = size->root.metrics.x_scale; - T1_Fixed scale_y = size->root.metrics.y_scale; + FT_Fixed scale_x = size->root.metrics.x_scale; + FT_Fixed scale_y = size->root.metrics.y_scale; T1_Glyph_Hints* hints = builder->glyph->hints; T1_Stem_Table* hori_stems = &hints->hori_stems; T1_Stem_Table* vert_stems = &hints->vert_stems; - T1_Vector* cur = builder->current.points + first; - T1_Vector* limit = cur + last - first + 1; + FT_Vector* cur = builder->current.points + first; + FT_Vector* limit = cur + last - first + 1; /* first of all, sort the active stem hints */ t1_sort_hints( hori_stems ); @@ -1289,8 +1289,8 @@ T1_Private* priv = &builder->face->type1.private_dict; T1_Size size = builder->size; - T1_Fixed scale_x = size->root.metrics.x_scale; - T1_Fixed scale_y = size->root.metrics.y_scale; + FT_Fixed scale_x = size->root.metrics.x_scale; + FT_Fixed scale_y = size->root.metrics.y_scale; t1_hint_horizontal_stems( &hints->hori_stems, builder->size->hints, diff --git a/src/type1/t1hinter.h b/src/type1/t1hinter.h index b5c9327a9..dcc9bce93 100644 --- a/src/type1/t1hinter.h +++ b/src/type1/t1hinter.h @@ -55,10 +55,10 @@ typedef struct T1_Snap_Zone_ { - T1_Pos orus; - T1_Pos pix; - T1_Pos min; - T1_Pos max; + FT_Pos orus; + FT_Pos pix; + FT_Pos min; + FT_Pos max; } T1_Snap_Zone; @@ -79,8 +79,8 @@ typedef struct T1_Edge_ { - T1_Pos orus; - T1_Pos pix; + FT_Pos orus; + FT_Pos pix; } T1_Edge; @@ -108,7 +108,7 @@ { T1_Edge min_edge; T1_Edge max_edge; - T1_Int hint_flags; + FT_Int hint_flags; } T1_Stem_Hint; @@ -154,16 +154,16 @@ struct T1_Size_Hints_ { - T1_Bool supress_overshoots; + FT_Bool supress_overshoots; - T1_Int num_blue_zones; - T1_Int num_bottom_zones; + FT_Int num_blue_zones; + FT_Int num_bottom_zones; T1_Snap_Zone blue_zones[ T1_HINTER_MAX_BLUES ]; - T1_Int num_snap_widths; + FT_Int num_snap_widths; T1_Snap_Zone snap_widths[ T1_HINTER_MAX_SNAPS ]; - T1_Int num_snap_heights; + FT_Int num_snap_heights; T1_Snap_Zone snap_heights[ T1_HINTER_MAX_SNAPS ]; }; @@ -192,11 +192,11 @@ typedef struct T1_Stem_Table_ { - T1_Int num_stems; - T1_Int num_active; + FT_Int num_stems; + FT_Int num_active; T1_Stem_Hint stems[ T1_HINTER_MAX_EDGES ]; - T1_Int sort [ T1_HINTER_MAX_EDGES ]; + FT_Int sort [ T1_HINTER_MAX_EDGES ]; } T1_Stem_Table; @@ -257,7 +257,7 @@ ************************************************************************/ LOCAL_DEF - T1_Error T1_New_Size_Hinter( T1_Size size ); + FT_Error T1_New_Size_Hinter( T1_Size size ); /************************************************************************ @@ -295,7 +295,7 @@ ************************************************************************/ LOCAL_DEF - T1_Error T1_Reset_Size_Hinter( T1_Size size ); + FT_Error T1_Reset_Size_Hinter( T1_Size size ); /************************************************************************ @@ -315,7 +315,7 @@ ************************************************************************/ LOCAL_DEF - T1_Error T1_New_Glyph_Hinter( T1_GlyphSlot glyph ); + FT_Error T1_New_Glyph_Hinter( T1_GlyphSlot glyph ); /************************************************************************ diff --git a/src/type1/t1load.c b/src/type1/t1load.c index bbacf1543..7f3751a9f 100644 --- a/src/type1/t1load.c +++ b/src/type1/t1load.c @@ -10,7 +10,7 @@ #undef FT_COMPONENT #define FT_COMPONENT trace_t1load - typedef T1_Error (*T1_Parse_Func)( T1_Parser* parser ); + typedef FT_Error (*T1_Parse_Func)( T1_Parser* parser ); /*************************************************************************/ @@ -68,10 +68,10 @@ /* Error code. 0 means success */ /* */ LOCAL_FUNC - T1_Error Next_T1_Token( T1_Parser* parser, + FT_Error Next_T1_Token( T1_Parser* parser, T1_Token* token ) { - T1_Error error; + FT_Error error; T1_Tokenizer tokzer = parser->tokenizer; L1: @@ -116,13 +116,13 @@ #if defined( FT_DEBUG_LEVEL_ERROR ) || defined( FT_DEBUG_LEVEL_TRACE ) if ( parser->dump_tokens ) { - T1_String temp_string[128]; - T1_Int len; + FT_String temp_string[128]; + FT_Int len; len = token->len; if ( len > 127 ) len = 127; strncpy( temp_string, - (T1_String*)tokzer->base + token->start, + (FT_String*)tokzer->base + token->start, len ); temp_string[len] = '\0'; FT_ERROR(( "%s\n", temp_string )); @@ -135,11 +135,11 @@ static - T1_Error Expect_Keyword( T1_Parser* parser, + FT_Error Expect_Keyword( T1_Parser* parser, T1_TokenType keyword ) { T1_Token token; - T1_Error error; + FT_Error error; error = Next_T1_Token( parser, &token ); if (error) goto Exit; @@ -159,12 +159,12 @@ static - T1_Error Expect_Keyword2( T1_Parser* parser, + FT_Error Expect_Keyword2( T1_Parser* parser, T1_TokenType keyword1, T1_TokenType keyword2 ) { T1_Token token; - T1_Error error; + FT_Error error; error = Next_T1_Token( parser, &token ); if (error) goto Exit; @@ -191,7 +191,7 @@ T1_Token* token = parser->top+1; FT_Memory memory = parser->face->root.memory; T1_Encoding* encode = &parser->face->type1.encoding; - T1_Error error = 0; + FT_Error error = 0; if (token->kind == tok_keyword && (token->kind2 == key_StandardEncoding || @@ -201,7 +201,7 @@ encode->code_first = 32; encode->code_last = 255; - if ( ALLOC_ARRAY( encode->char_index, 256, T1_Short ) ) + if ( ALLOC_ARRAY( encode->char_index, 256, FT_Short ) ) goto Exit; encode->char_name = 0; /* no need to store glyph names */ @@ -255,7 +255,7 @@ /* Error code. 0 means success */ /* */ static - T1_Error Do_Def_Font( T1_Parser* parser ) + FT_Error Do_Def_Font( T1_Parser* parser ) { T1_Token* top = parser->top; T1_Face face = parser->face; @@ -270,8 +270,8 @@ if (top[1].kind == tok_immediate) { FT_Memory memory = parser->tokenizer->memory; - T1_Error error; - T1_Int len = top[1].len; + FT_Error error; + FT_Int len = top[1].len; if ( ALLOC( type1->font_name, len+1 ) ) { @@ -293,11 +293,11 @@ break; case imm_PaintType: - type1->paint_type = (T1_Byte)CopyInteger( parser ); + type1->paint_type = (FT_Byte)CopyInteger( parser ); break; case imm_FontType: - type1->font_type = (T1_Byte)CopyInteger( parser ); + type1->font_type = (FT_Byte)CopyInteger( parser ); break; case imm_FontMatrix: @@ -345,7 +345,7 @@ /* Error code. 0 means success */ /* */ static - T1_Error Do_Def_FontInfo( T1_Parser* parser ) + FT_Error Do_Def_FontInfo( T1_Parser* parser ) { T1_Token* top = parser->top; T1_FontInfo* info = &parser->face->type1.font_info; @@ -381,11 +381,11 @@ break; case imm_UnderlinePosition: - info->underline_position = (T1_Short)CopyInteger( parser ); + info->underline_position = (FT_Short)CopyInteger( parser ); break; case imm_UnderlineThickness: - info->underline_thickness = (T1_Short)CopyInteger( parser ); + info->underline_thickness = (FT_Short)CopyInteger( parser ); break; default: @@ -413,7 +413,7 @@ /* Error code. 0 means success */ /* */ static - T1_Error Do_Def_Private( T1_Parser* parser ) + FT_Error Do_Def_Private( T1_Parser* parser ) { T1_Token* top = parser->top; T1_Private* priv = &parser->face->type1.private_dict; @@ -467,12 +467,12 @@ case imm_StdHW: - CopyArray( parser, 0, (T1_Short*)&priv->standard_width, 1 ); + CopyArray( parser, 0, (FT_Short*)&priv->standard_width, 1 ); break; case imm_StdVW: - CopyArray( parser, 0, (T1_Short*)&priv->standard_height, 1 ); + CopyArray( parser, 0, (FT_Short*)&priv->standard_height, 1 ); break; @@ -543,7 +543,7 @@ /* Error code. 0 means success */ /* */ static - T1_Error Do_Def_Error( T1_Parser* parser ) + FT_Error Do_Def_Error( T1_Parser* parser ) { FT_ERROR(( "T1.Load : 'def' keyword encountered in bad dictionary/array\n" )); parser->error = T1_Err_Syntax_Error; @@ -552,7 +552,7 @@ static - T1_Error Do_Def_Ignore( T1_Parser* parser ) + FT_Error Do_Def_Ignore( T1_Parser* parser ) { UNUSED(parser); return T1_Err_Ok; @@ -600,13 +600,13 @@ /* Error code. 0 means success */ /* */ static - T1_Error Do_Put_Encoding( T1_Parser* parser ) + FT_Error Do_Put_Encoding( T1_Parser* parser ) { - T1_Error error = T1_Err_Ok; + FT_Error error = T1_Err_Ok; T1_Face face = parser->face; T1_Token* top = parser->top; T1_Encoding* encode = &face->type1.encoding; - T1_Int index; + FT_Int index; /* record and check the character code */ if ( top[0].kind != tok_number ) @@ -614,7 +614,7 @@ FT_TRACE4(( "T1.Parse.put: number expected\n" )); goto Syntax_Error; } - index = (T1_Int)CopyInteger( parser ); + index = (FT_Int)CopyInteger( parser ); if (parser->error) return parser->error; if ( index < 0 || index >= encode->num_chars ) @@ -639,16 +639,16 @@ } else { - T1_String temp_name[128]; + FT_String temp_name[128]; T1_Token* token = top+1; - T1_Int len = token->len-1; + FT_Int len = token->len-1; /* copy immediate name */ if (len > 127) len = 127; MEM_Copy( temp_name, parser->tokenizer->base + token->start+1, len ); temp_name[len] = '\0'; - error = T1_Add_Table( &parser->table, index, (T1_Byte*)temp_name, len+1 ); + error = T1_Add_Table( &parser->table, index, (FT_Byte*)temp_name, len+1 ); /* adjust code_first and code_last */ if ( index < encode->code_first ) encode->code_first = index; @@ -688,13 +688,13 @@ /* Error code. 0 means success */ /* */ static - T1_Error Do_RD_Subrs( T1_Parser* parser ) + FT_Error Do_RD_Subrs( T1_Parser* parser ) { - T1_Error error = T1_Err_Ok; + FT_Error error = T1_Err_Ok; T1_Face face = parser->face; T1_Token* top = parser->top; T1_Tokenizer tokzer = parser->tokenizer; - T1_Int index, count; + FT_Int index, count; /* record and check the character code */ if ( top[0].kind != tok_number || @@ -703,10 +703,10 @@ FT_ERROR(( "T1.Parse.put: number expected\n" )); goto Syntax_Error; } - index = (T1_Int)CopyInteger( parser ); + index = (FT_Int)CopyInteger( parser ); error = parser->error; if (error) goto Exit; - count = (T1_Int)CopyInteger( parser ); + count = (FT_Int)CopyInteger( parser ); error = parser->error; if (error) goto Exit; if ( index < 0 || index >= face->type1.num_subrs ) @@ -717,7 +717,7 @@ /* decrypt charstring and skip them */ { - T1_Byte* base = tokzer->base + tokzer->cursor; + FT_Byte* base = tokzer->base + tokzer->cursor; t1_decrypt( base, count, 4330 ); tokzer->cursor += count; @@ -755,13 +755,13 @@ /* Error code. 0 means success */ /* */ static - T1_Error Do_RD_Charstrings( T1_Parser* parser ) + FT_Error Do_RD_Charstrings( T1_Parser* parser ) { - T1_Error error = T1_Err_Ok; + FT_Error error = T1_Err_Ok; T1_Face face = parser->face; T1_Token* top = parser->top; T1_Tokenizer tokzer = parser->tokenizer; - T1_Int index, count; + FT_Int index, count; /* check the character name argument */ if ( top[0].kind != tok_immediate ) @@ -777,7 +777,7 @@ goto Syntax_Error; } parser->args++; - count = (T1_Int)CopyInteger( parser ); + count = (FT_Int)CopyInteger( parser ); error = parser->error; if (error) goto Exit; /* record the glyph name and get the corresponding glyph index */ @@ -785,9 +785,9 @@ index = 0; else { - T1_String temp_name[128]; + FT_String temp_name[128]; T1_Token* token = top; - T1_Int len = token->len-1; + FT_Int len = token->len-1; /* copy immediate name */ if (len > 127) len = 127; @@ -795,13 +795,13 @@ temp_name[len] = '\0'; index = parser->cur_name++; - error = T1_Add_Table( &parser->table, index*2, (T1_Byte*)temp_name, len+1 ); + error = T1_Add_Table( &parser->table, index*2, (FT_Byte*)temp_name, len+1 ); if (error) goto Exit; } /* decrypt and record charstring, then skip them */ { - T1_Byte* base = tokzer->base + tokzer->cursor; + FT_Byte* base = tokzer->base + tokzer->cursor; t1_decrypt( base, count, 4330 ); tokzer->cursor += count; /* skip */ @@ -829,11 +829,11 @@ static - T1_Error Expect_Dict_Arguments( T1_Parser* parser, - T1_Int num_args, + FT_Error Expect_Dict_Arguments( T1_Parser* parser, + FT_Int num_args, T1_TokenType immediate, T1_DictState new_state, - T1_Int *count ) + FT_Int *count ) { /* check that we have enough arguments in the stack, including */ /* the 'dict' keyword.. */ @@ -886,12 +886,12 @@ static - T1_Error Expect_Array_Arguments( T1_Parser* parser ) + FT_Error Expect_Array_Arguments( T1_Parser* parser ) { T1_Token* top = parser->top; - T1_Error error = T1_Err_Ok; + FT_Error error = T1_Err_Ok; T1_DictState new_state; - T1_Int count; + FT_Int count; T1_Face face = parser->face; FT_Memory memory = face->root.memory; @@ -918,7 +918,7 @@ FT_ERROR(( "T1.Parse.array: second argument must be a number\n" )); goto Syntax_Error; } - count = (T1_Int)CopyInteger( parser ); + count = (FT_Int)CopyInteger( parser ); /* Is this an array we know about ?? */ switch ( top[0].kind2 ) @@ -935,7 +935,7 @@ /* allocate the table of character indexes. The table of */ /* character names is allocated through init_t1_recorder */ - if ( ALLOC_ARRAY( encode->char_index, count, T1_Short ) ) + if ( ALLOC_ARRAY( encode->char_index, count, FT_Short ) ) return error; error = T1_New_Table( &parser->table, count, memory ); @@ -978,30 +978,30 @@ static - T1_Error Finalise_Parsing( T1_Parser* parser ) + FT_Error Finalise_Parsing( T1_Parser* parser ) { T1_Face face = parser->face; T1_Font* type1 = &face->type1; FT_Memory memory = face->root.memory; T1_Table* strings = &parser->table; PSNames_Interface* psnames = (PSNames_Interface*)face->psnames; - T1_Int num_glyphs; - T1_Int n; - T1_Error error; + FT_Int num_glyphs; + FT_Int n; + FT_Error error; num_glyphs = type1->num_glyphs = parser->cur_name; /* allocate glyph names and charstrings arrays */ - if ( ALLOC_ARRAY( type1->glyph_names , num_glyphs, T1_String* ) || - ALLOC_ARRAY( type1->charstrings , num_glyphs, T1_Byte* ) || - ALLOC_ARRAY( type1->charstrings_len, num_glyphs, T1_Int* ) ) + if ( ALLOC_ARRAY( type1->glyph_names , num_glyphs, FT_String* ) || + ALLOC_ARRAY( type1->charstrings , num_glyphs, FT_Byte* ) || + ALLOC_ARRAY( type1->charstrings_len, num_glyphs, FT_Int* ) ) return error; /* copy glyph names and charstrings offsets and lengths */ type1->charstrings_block = strings->block; for ( n = 0; n < num_glyphs; n++ ) { - type1->glyph_names[n] = (T1_String*)strings->elements[2*n]; + type1->glyph_names[n] = (FT_String*)strings->elements[2*n]; type1->charstrings[n] = strings->elements[2*n+1]; type1->charstrings_len[n] = strings->lengths [2*n+1]; } @@ -1024,7 +1024,7 @@ } { - T1_Int n; + FT_Int n; T1_Encoding* encode = &type1->encoding; encode->code_first = encode->num_chars-1; @@ -1032,9 +1032,9 @@ for ( n = 0; n < encode->num_chars; n++ ) { - T1_String** names; - T1_Int index; - T1_Int m; + FT_String** names; + FT_Int index; + FT_Int m; switch (parser->encoding_type) { @@ -1050,21 +1050,21 @@ default: index = n; - names = (T1_String**)parser->encoding_offsets; + names = (FT_String**)parser->encoding_offsets; } encode->char_index[n] = 0; if (index) { - T1_String* name; + FT_String* name; if (names) name = names[index]; else - name = (T1_String*)psnames->adobe_std_strings(index); + name = (FT_String*)psnames->adobe_std_strings(index); if ( name ) { - T1_Int len = strlen(name); + FT_Int len = strlen(name); /* lookup glyph index from name */ for ( m = 0; m < num_glyphs; m++ ) @@ -1096,9 +1096,9 @@ LOCAL_FUNC - T1_Error Parse_T1_FontProgram( T1_Parser* parser ) + FT_Error Parse_T1_FontProgram( T1_Parser* parser ) { - T1_Error error; + FT_Error error; T1_Font* type1 = &parser->face->type1; for (;;) @@ -1106,7 +1106,7 @@ T1_Token token; T1_Token* top; T1_DictState dict_state; - T1_Int dict_index; + FT_Int dict_index; error = Next_T1_Token( parser, &token ); top = parser->top; @@ -1159,7 +1159,7 @@ case dict_private: { T1_Face face = parser->face; - T1_Int count; + FT_Int count; error = Expect_Dict_Arguments( parser, 2, imm_CharStrings, dict_charstrings, &count ); @@ -1170,7 +1170,7 @@ if (error) goto Exit; /* record '.notdef' as the first glyph in the font */ - error = T1_Add_Table( &parser->table, 0, (T1_Byte*)".notdef", 8 ); + error = T1_Add_Table( &parser->table, 0, (FT_Byte*)".notdef", 8 ); parser->cur_name = 1; /* XXXXX : DO SOMETHING HERE */ } diff --git a/src/type1/t1load.h b/src/type1/t1load.h index 8cd5c80a2..f624e29f5 100644 --- a/src/type1/t1load.h +++ b/src/type1/t1load.h @@ -59,7 +59,7 @@ /* The parser contains a handle to the target face object. */ /* */ LOCAL_DEF - T1_Error Parse_T1_FontProgram( T1_Parser* parser ); + FT_Error Parse_T1_FontProgram( T1_Parser* parser ); #ifdef __cplusplus diff --git a/src/type1/t1objs.c b/src/type1/t1objs.c index d52fb095f..fe7c155dc 100644 --- a/src/type1/t1objs.c +++ b/src/type1/t1objs.c @@ -85,9 +85,9 @@ ******************************************************************/ LOCAL_DEF - T1_Error T1_Init_Size( T1_Size size ) + FT_Error T1_Init_Size( T1_Size size ) { - T1_Error error; + FT_Error error; size->valid = 0; @@ -119,7 +119,7 @@ ******************************************************************/ LOCAL_FUNC - T1_Error T1_Reset_Size( T1_Size size ) + FT_Error T1_Reset_Size( T1_Size size ) { /* recompute ascender, descender, etc.. */ T1_Face face = (T1_Face)size->root.face; @@ -239,14 +239,14 @@ ******************************************************************/ LOCAL_FUNC - T1_Error T1_Init_Face( FT_Stream stream, + FT_Error T1_Init_Face( FT_Stream stream, T1_Face face, FT_Int face_index, FT_Int num_params, FT_Parameter* params ) { T1_Tokenizer tokenizer; - T1_Error error; + FT_Error error; PSNames_Interface* psnames; UNUSED(num_params); @@ -343,8 +343,8 @@ root->bbox = type1->font_bbox; root->units_per_EM = 1000; - root->ascender = (T1_Short)type1->font_bbox.yMax; - root->descender = -(T1_Short)type1->font_bbox.yMin; + root->ascender = (FT_Short)type1->font_bbox.yMax; + root->descender = -(FT_Short)type1->font_bbox.yMin; root->height = ((root->ascender + root->descender)*12)/10; /* now compute the maximum advance width */ @@ -354,7 +354,7 @@ /* compute max advance width for proportional fonts */ if (!type1->font_info.is_fixed_pitch) { - T1_Int max_advance; + FT_Int max_advance; error = T1_Compute_Max_Advance( face, &max_advance ); @@ -485,10 +485,10 @@ ******************************************************************/ LOCAL_FUNC - T1_Error T1_Init_GlyphSlot( T1_GlyphSlot glyph ) + FT_Error T1_Init_GlyphSlot( T1_GlyphSlot glyph ) { FT_Library library = glyph->root.face->driver->library; - T1_Error error; + FT_Error error; glyph->max_points = 0; glyph->max_contours = 0; @@ -523,7 +523,7 @@ ******************************************************************/ LOCAL_FUNC - T1_Error T1_Init_Driver( T1_Driver driver ) + FT_Error T1_Init_Driver( T1_Driver driver ) { UNUSED(driver); return T1_Err_Ok; diff --git a/src/type1/t1objs.h b/src/type1/t1objs.h index 48c7ce1ce..eeebb0199 100644 --- a/src/type1/t1objs.h +++ b/src/type1/t1objs.h @@ -95,7 +95,7 @@ typedef struct T1_SizeRec_ { FT_SizeRec root; - T1_Bool valid; + FT_Bool valid; T1_Size_Hints* hints; /* defined in the hinter. This allows */ /* us to experiment with different */ /* hinting schemes without having to */ @@ -115,11 +115,11 @@ { FT_GlyphSlotRec root; - T1_Bool hint; - T1_Bool scaled; + FT_Bool hint; + FT_Bool scaled; - T1_Int max_points; - T1_Int max_contours; + FT_Int max_points; + FT_Int max_contours; FT_Fixed x_scale; FT_Fixed y_scale; @@ -147,7 +147,7 @@ ******************************************************************/ LOCAL_DEF - T1_Error T1_Init_Face( FT_Stream stream, + FT_Error T1_Init_Face( FT_Stream stream, T1_Face face, FT_Int face_index, FT_Int num_params, @@ -188,7 +188,7 @@ ******************************************************************/ LOCAL_DEF - T1_Error T1_Init_Size( T1_Size size ); + FT_Error T1_Init_Size( T1_Size size ); @@ -222,7 +222,7 @@ ******************************************************************/ LOCAL_DEF - T1_Error T1_Reset_Size( T1_Size size ); + FT_Error T1_Reset_Size( T1_Size size ); @@ -239,7 +239,7 @@ ******************************************************************/ LOCAL_DEF - T1_Error T1_Init_GlyphSlot( T1_GlyphSlot slot ); + FT_Error T1_Init_GlyphSlot( T1_GlyphSlot slot ); @@ -276,7 +276,7 @@ ******************************************************************/ LOCAL_DEF - T1_Error T1_Init_Driver( T1_Driver driver ); + FT_Error T1_Init_Driver( T1_Driver driver ); diff --git a/src/type1/t1parse.c b/src/type1/t1parse.c index 627751065..26e800c1b 100644 --- a/src/type1/t1parse.c +++ b/src/type1/t1parse.c @@ -21,17 +21,17 @@ /* */ LOCAL_FUNC - T1_Error T1_New_Table( T1_Table* table, - T1_Int count, + FT_Error T1_New_Table( T1_Table* table, + FT_Int count, FT_Memory memory ) { - T1_Error error; + FT_Error error; table->memory = memory; - if ( ALLOC_ARRAY( table->elements, count, T1_Byte* ) ) + if ( ALLOC_ARRAY( table->elements, count, FT_Byte* ) ) return error; - if ( ALLOC_ARRAY( table->lengths, count, T1_Byte* ) ) + if ( ALLOC_ARRAY( table->lengths, count, FT_Byte* ) ) { FREE( table->elements ); return error; @@ -68,12 +68,12 @@ /* */ static - T1_Error reallocate_t1_table( T1_Table* table, - T1_Int new_size ) + FT_Error reallocate_t1_table( T1_Table* table, + FT_Int new_size ) { FT_Memory memory = table->memory; - T1_Byte* old_base = table->block; - T1_Error error; + FT_Byte* old_base = table->block; + FT_Error error; /* realloc the base block */ if ( REALLOC( table->block, table->capacity, new_size ) ) @@ -83,9 +83,9 @@ /* shift all offsets when needed */ if (old_base) { - T1_Long delta = table->block - old_base; - T1_Byte** offset = table->elements; - T1_Byte** limit = offset + table->max_elems; + FT_Long delta = table->block - old_base; + FT_Byte** offset = table->elements; + FT_Byte** limit = offset + table->max_elems; if (delta) for ( ; offset < limit; offset ++ ) @@ -98,10 +98,10 @@ LOCAL_FUNC - T1_Error T1_Add_Table( T1_Table* table, - T1_Int index, + FT_Error T1_Add_Table( T1_Table* table, + FT_Int index, void* object, - T1_Int length ) + FT_Int length ) { if (index < 0 || index > table->max_elems) { @@ -112,8 +112,8 @@ /* grow the base block if needed */ if ( table->cursor + length > table->capacity ) { - T1_Error error; - T1_Int new_size = table->capacity; + FT_Error error; + FT_Int new_size = table->capacity; while ( new_size < table->cursor+length ) new_size += 1024; @@ -150,8 +150,8 @@ void T1_Done_Table( T1_Table* table ) { FT_Memory memory = table->memory; - T1_Error error; - T1_Byte* old_base; + FT_Error error; + FT_Byte* old_base; /* should never fail, as rec.cursor <= rec.size */ old_base = table->block; @@ -163,9 +163,9 @@ if (old_base != table->block) { - T1_Long delta = table->block - old_base; - T1_Byte** element = table->elements; - T1_Byte** limit = element + table->max_elems; + FT_Long delta = table->block - old_base; + FT_Byte** element = table->elements; + FT_Byte** limit = element + table->max_elems; for ( ; element < limit; element++ ) if (element[0]) @@ -175,12 +175,12 @@ LOCAL_FUNC - T1_String* CopyString( T1_Parser* parser ) + FT_String* CopyString( T1_Parser* parser ) { - T1_String* string = NULL; + FT_String* string = NULL; T1_Token* token = parser->args++; FT_Memory memory = parser->tokenizer->memory; - T1_Error error; + FT_Error error; if ( token->kind == tok_string ) { @@ -208,12 +208,12 @@ static - T1_Error parse_int( T1_Byte* base, - T1_Byte* limit, - T1_Long* result ) + FT_Error parse_int( FT_Byte* base, + FT_Byte* limit, + FT_Long* result ) { - T1_Bool sign = 0; - T1_Long sum = 0; + FT_Bool sign = 0; + FT_Long sum = 0; if (base >= limit) goto Fail; @@ -254,10 +254,10 @@ static - T1_Error parse_float( T1_Byte* base, - T1_Byte* limit, - T1_Int scale, - T1_Long* result ) + FT_Error parse_float( FT_Byte* base, + FT_Byte* limit, + FT_Int scale, + FT_Long* result ) { #if 1 /* XXX : We're simply much too lazy to code this function */ @@ -274,16 +274,16 @@ if ( sscanf( temp, "%lf", &value ) != 1 ) goto Fail; - *result = (T1_Long)(scale*value); + *result = (FT_Long)(scale*value); return 0; #else - T1_Byte* cur; - T1_Bool sign = 0; /* sign */ - T1_Long number_int = 0; /* integer part */ - T1_Long number_frac = 0; /* fractional part */ - T1_Long exponent = 0; /* exponent value */ - T1_Int num_frac = 0; /* number of fractional digits */ + FT_Byte* cur; + FT_Bool sign = 0; /* sign */ + FT_Long number_int = 0; /* integer part */ + FT_Long number_frac = 0; /* fractional part */ + FT_Long exponent = 0; /* exponent value */ + FT_Int num_frac = 0; /* number of fractional digits */ /* check sign */ if (*base == '+') @@ -299,7 +299,7 @@ cur = base; while ( cur < limit ) { - T1_Byte c = *cur; + FT_Byte c = *cur; if ( c == '.' || c == 'e' || c == 'E' ) break; @@ -319,7 +319,7 @@ base = cur; while ( cur < limit ) { - T1_Byte c = *cur; + FT_Byte c = *cur; if ( c == 'e' || c == 'E' ) break; cur++; @@ -377,18 +377,18 @@ static - T1_Error parse_integer( T1_Byte* base, - T1_Byte* limit, - T1_Long* result ) + FT_Error parse_integer( FT_Byte* base, + FT_Byte* limit, + FT_Long* result ) { - T1_Byte* cur; + FT_Byte* cur; /* the lexical analyser accepts floats as well as integers */ /* now, check that we really have an int in this token */ cur = base; while ( cur < limit ) { - T1_Byte c = *cur++; + FT_Byte c = *cur++; if ( c == '.' || c == 'e' || c == 'E' ) goto Float_Number; @@ -401,7 +401,7 @@ /* We really have a float there, simply call parse_float in this */ /* case with a scale of '10' to perform round.. */ { - T1_Error error; + FT_Error error; error = parse_float( base, limit, 10, result ); if (!error) @@ -415,15 +415,15 @@ LOCAL_FUNC - T1_Long CopyInteger( T1_Parser* parser ) + FT_Long CopyInteger( T1_Parser* parser ) { - T1_Long sum = 0; + FT_Long sum = 0; T1_Token* token = parser->args++; if ( token->kind == tok_number ) { - T1_Byte* base = parser->tokenizer->base + token->start; - T1_Byte* limit = base + token->len; + FT_Byte* base = parser->tokenizer->base + token->start; + FT_Byte* limit = base + token->len; /* now read the number's value */ parser->error = parse_integer( base, limit, &sum ); @@ -439,10 +439,10 @@ LOCAL_FUNC - T1_Bool CopyBoolean( T1_Parser* parser ) + FT_Bool CopyBoolean( T1_Parser* parser ) { - T1_Error error = T1_Err_Ok; - T1_Bool result = 0; + FT_Error error = T1_Err_Ok; + FT_Bool result = 0; T1_Token* token = parser->args++; if ( token->kind == tok_keyword ) @@ -470,17 +470,17 @@ LOCAL_FUNC - T1_Long CopyFloat( T1_Parser* parser, - T1_Int scale ) + FT_Long CopyFloat( T1_Parser* parser, + FT_Int scale ) { - T1_Error error; - T1_Long sum = 0; + FT_Error error; + FT_Long sum = 0; T1_Token* token = parser->args++; if ( token->kind == tok_number ) { - T1_Byte* base = parser->tokenizer->base + token->start; - T1_Byte* limit = base + token->len; + FT_Byte* base = parser->tokenizer->base + token->start; + FT_Byte* limit = base + token->len; error = parser->error = parse_float( base, limit, scale, &sum ); if (error) goto Fail; @@ -501,26 +501,26 @@ LOCAL_FUNC void CopyBBox( T1_Parser* parser, - T1_BBox* bbox ) + FT_BBox* bbox ) { T1_Token* token = parser->args++; - T1_Int n; - T1_Error error; + FT_Int n; + FT_Error error; if ( token->kind == tok_program || token->kind == tok_array ) { /* get rid of '['/']', or '{'/'}' */ - T1_Byte* base = parser->tokenizer->base + token->start + 1; - T1_Byte* limit = base + token->len - 2; - T1_Byte* cur; - T1_Byte* start; + FT_Byte* base = parser->tokenizer->base + token->start + 1; + FT_Byte* limit = base + token->len - 2; + FT_Byte* cur; + FT_Byte* start; /* read each parameter independently */ cur = base; for ( n = 0; n < 4; n++ ) { - T1_Long* result; + FT_Long* result; /* skip whitespace */ while (cur < limit && *cur == ' ') cur++; @@ -555,25 +555,25 @@ LOCAL_FUNC void CopyMatrix( T1_Parser* parser, - T1_Matrix* matrix ) + FT_Matrix* matrix ) { T1_Token* token = parser->args++; - T1_Error error; + FT_Error error; if ( token->kind == tok_array ) { /* get rid of '[' and ']' */ - T1_Byte* base = parser->tokenizer->base + token->start + 1; - T1_Byte* limit = base + token->len - 2; - T1_Byte* cur; - T1_Byte* start; - T1_Int n; + FT_Byte* base = parser->tokenizer->base + token->start + 1; + FT_Byte* limit = base + token->len - 2; + FT_Byte* cur; + FT_Byte* start; + FT_Int n; /* read each parameter independently */ cur = base; for ( n = 0; n < 4; n++ ) { - T1_Long* result; + FT_Long* result; /* skip whitespace */ while (cur < limit && *cur == ' ') cur++; @@ -607,28 +607,28 @@ LOCAL_FUNC void CopyArray( T1_Parser* parser, - T1_Byte* num_elements, - T1_Short* elements, - T1_Int max_elements ) + FT_Byte* num_elements, + FT_Short* elements, + FT_Int max_elements ) { T1_Token* token = parser->args++; - T1_Error error; + FT_Error error; if ( token->kind == tok_array || token->kind == tok_program ) /* in the case of MinFeature */ { /* get rid of '['/']', or '{'/'}' */ - T1_Byte* base = parser->tokenizer->base + token->start + 1; - T1_Byte* limit = base + token->len - 2; - T1_Byte* cur; - T1_Byte* start; - T1_Int n; + FT_Byte* base = parser->tokenizer->base + token->start + 1; + FT_Byte* limit = base + token->len - 2; + FT_Byte* cur; + FT_Byte* start; + FT_Int n; /* read each parameter independently */ cur = base; for ( n = 0; n < max_elements; n++ ) { - T1_Long result; + FT_Long result; /* test end of string */ if (cur >= limit) @@ -648,11 +648,11 @@ error = parse_integer( start, cur, &result ); if (error) goto Fail; - *elements ++ = (T1_Short)result; + *elements ++ = (FT_Short)result; } if (num_elements) - *num_elements = (T1_Byte)n; + *num_elements = (FT_Byte)n; parser->error = 0; return; diff --git a/src/type1/t1parse.h b/src/type1/t1parse.h index 99666807a..fbb9443b9 100644 --- a/src/type1/t1parse.h +++ b/src/type1/t1parse.h @@ -89,14 +89,14 @@ typedef struct T1_Table_ { - T1_Byte* block; /* current memory block */ - T1_Int cursor; /* current cursor in memory block */ - T1_Int capacity; /* current size of memory block */ + FT_Byte* block; /* current memory block */ + FT_Int cursor; /* current cursor in memory block */ + FT_Int capacity; /* current size of memory block */ - T1_Int max_elems; - T1_Int num_elems; - T1_Byte** elements; /* addresses of table elements */ - T1_Int* lengths; /* lengths of table elements */ + FT_Int max_elems; + FT_Int num_elems; + FT_Byte** elements; /* addresses of table elements */ + FT_Int* lengths; /* lengths of table elements */ FT_Memory memory; @@ -152,31 +152,31 @@ /* */ typedef struct T1_Parser_ { - T1_Error error; + FT_Error error; T1_Face face; T1_Tokenizer tokenizer; - T1_Bool dump_tokens; + FT_Bool dump_tokens; T1_Token stack[ T1_MAX_STACK_DEPTH ]; T1_Token* top; T1_Token* limit; T1_Token* args; - T1_Int state_index; + FT_Int state_index; T1_DictState state_stack[ T1_MAX_DICT_DEPTH ]; T1_Table table; - T1_Int cur_name; + FT_Int cur_name; T1_EncodingType encoding_type; - T1_Byte* encoding_names; - T1_Int* encoding_lengths; - T1_Byte** encoding_offsets; + FT_Byte* encoding_names; + FT_Int* encoding_lengths; + FT_Byte** encoding_offsets; - T1_Byte* subrs; - T1_Byte* charstrings; + FT_Byte* subrs; + FT_Byte* charstrings; } T1_Parser; @@ -198,8 +198,8 @@ /* Error code. 0 means success */ /* */ LOCAL_DEF - T1_Error T1_New_Table( T1_Table* table, - T1_Int count, + FT_Error T1_New_Table( T1_Table* table, + FT_Int count, FT_Memory memory ); @@ -221,10 +221,10 @@ /* realloc failed.. */ /* */ LOCAL_DEF - T1_Error T1_Add_Table( T1_Table* table, - T1_Int index, + FT_Error T1_Add_Table( T1_Table* table, + FT_Int index, void* object, - T1_Int length ); + FT_Int length ); /*************************************************************************/ @@ -248,34 +248,34 @@ LOCAL_DEF - T1_String* CopyString( T1_Parser* parser ); + FT_String* CopyString( T1_Parser* parser ); LOCAL_DEF - T1_Long CopyInteger( T1_Parser* parser ); + FT_Long CopyInteger( T1_Parser* parser ); LOCAL_DEF - T1_Bool CopyBoolean( T1_Parser* parser ); + FT_Bool CopyBoolean( T1_Parser* parser ); LOCAL_DEF - T1_Long CopyFloat( T1_Parser* parser, - T1_Int scale ); + FT_Long CopyFloat( T1_Parser* parser, + FT_Int scale ); LOCAL_DEF void CopyBBox( T1_Parser* parser, - T1_BBox* bbox ); + FT_BBox* bbox ); LOCAL_DEF void CopyMatrix( T1_Parser* parser, - T1_Matrix* matrix ); + FT_Matrix* matrix ); LOCAL_DEF void CopyArray( T1_Parser* parser, - T1_Byte* num_elements, - T1_Short* elements, - T1_Int max_elements ); + FT_Byte* num_elements, + FT_Short* elements, + FT_Int max_elements ); #ifdef __cplusplus } diff --git a/src/type1/t1tokens.c b/src/type1/t1tokens.c index d4fda8c33..faa5ee6fc 100644 --- a/src/type1/t1tokens.c +++ b/src/type1/t1tokens.c @@ -92,15 +92,15 @@ { /* performs a binary search */ - T1_Int left, right; + FT_Int left, right; left = 0; right = table_len-1; while ( right-left > 1 ) { - T1_Int middle = left + (( right-left ) >> 1); - T1_Int cmp; + FT_Int middle = left + (( right-left ) >> 1); + FT_Int cmp; cmp = lexico_strcmp( base, length, table[middle] ); if (!cmp) return middle; @@ -120,13 +120,13 @@ /* read the small PFB section header */ static - T1_Error Read_PFB_Tag( FT_Stream stream, - T1_UShort* atag, - T1_ULong* asize ) + FT_Error Read_PFB_Tag( FT_Stream stream, + FT_UShort* atag, + FT_ULong* asize ) { - T1_UShort tag; - T1_ULong size; - T1_Error error; + FT_UShort tag; + FT_ULong size; + FT_Error error; FT_TRACE2(( "Read_PFB_Tag : reading\n" )); @@ -153,10 +153,10 @@ static - T1_Error grow( T1_Tokenizer tokzer ) + FT_Error grow( T1_Tokenizer tokzer ) { - T1_Error error; - T1_Long left_bytes; + FT_Error error; + FT_Long left_bytes; FT_Memory memory = tokzer->memory; left_bytes = tokzer->max - tokzer->limit; @@ -189,13 +189,13 @@ LOCAL_FUNC - void t1_decrypt( T1_Byte* buffer, - T1_Int length, - T1_UShort seed ) + void t1_decrypt( FT_Byte* buffer, + FT_Int length, + FT_UShort seed ) { while ( length > 0 ) { - T1_Byte plain; + FT_Byte plain; plain = (*buffer ^ (seed >> 8)); seed = (*buffer+seed)*52845+22719; @@ -231,18 +231,18 @@ /* */ LOCAL_FUNC - T1_Error New_Tokenizer( FT_Stream stream, + FT_Error New_Tokenizer( FT_Stream stream, T1_Tokenizer* tokenizer ) { FT_Memory memory = stream->memory; T1_Tokenizer tokzer; - T1_Error error; - T1_UShort tag; - T1_ULong size; + FT_Error error; + FT_UShort tag; + FT_ULong size; - T1_Byte* tok_base; - T1_ULong tok_limit; - T1_ULong tok_max; + FT_Byte* tok_base; + FT_ULong tok_limit; + FT_ULong tok_max; *tokenizer = 0; @@ -280,7 +280,7 @@ /* if it's a memory-based resource, set up pointer */ if ( !stream->read ) { - tok_base = (T1_Byte*)stream->base + stream->pos; + tok_base = (FT_Byte*)stream->base + stream->pos; tok_limit = size; tok_max = size; @@ -369,7 +369,7 @@ /* */ LOCAL_FUNC - T1_Error Done_Tokenizer( T1_Tokenizer tokenizer ) + FT_Error Done_Tokenizer( T1_Tokenizer tokenizer ) { FT_Memory memory = tokenizer->memory; @@ -401,17 +401,17 @@ /* */ LOCAL_FUNC - T1_Error Open_PrivateDict( T1_Tokenizer tokenizer ) + FT_Error Open_PrivateDict( T1_Tokenizer tokenizer ) { T1_Tokenizer tokzer = tokenizer; FT_Stream stream = tokzer->stream; FT_Memory memory = tokzer->memory; - T1_Error error = 0; + FT_Error error = 0; - T1_UShort tag; - T1_ULong size; + FT_UShort tag; + FT_ULong size; - T1_Byte* private; + FT_Byte* private; /* are we already in the private dictionary ? */ if ( tokzer->in_private ) @@ -423,8 +423,8 @@ /* made of several segments. We thus first read the number of */ /* segments to compute the total size of the private dictionary */ /* then re-read them into memory.. */ - T1_Long start_pos = FILE_Pos(); - T1_ULong private_size = 0; + FT_Long start_pos = FILE_Pos(); + FT_ULong private_size = 0; do { @@ -541,10 +541,10 @@ else { /* ASCII hexadecimal encoding.. This sucks.. */ - T1_Byte* write; - T1_Byte* cur; - T1_Byte* limit; - T1_Int count; + FT_Byte* write; + FT_Byte* cur; + FT_Byte* limit; + FT_Int count; /* Allocate a buffer, read each one byte at a time .. */ count = ( stream->size - tokzer->cursor ); @@ -638,13 +638,13 @@ /* charstrings from the private dict.. */ /* */ LOCAL_FUNC - T1_Error Read_Token( T1_Tokenizer tokenizer ) + FT_Error Read_Token( T1_Tokenizer tokenizer ) { T1_Tokenizer tok = tokenizer; - T1_Long cur, limit; - T1_Byte* base; + FT_Long cur, limit; + FT_Byte* base; char c, starter, ender; - T1_Bool token_started; + FT_Bool token_started; T1_TokenType kind; @@ -669,7 +669,7 @@ c = (char)base[cur++]; /* check that we have an ASCII character */ - if ( (T1_Byte)c > 127 ) + if ( (FT_Byte)c > 127 ) { FT_ERROR(( "Unexpected binary data in Type1 fragment !!\n" )); tok->error = T1_Err_Invalid_File_Format; @@ -696,7 +696,7 @@ case '%' : /* this is a comment - skip everything */ for (;;) { - T1_Int left = limit - cur; + FT_Int left = limit - cur; while (left > 0) { @@ -723,12 +723,12 @@ } { - T1_Int nest_level = 1; + FT_Int nest_level = 1; starter = c; for (;;) { - T1_Int left = limit-cur; + FT_Int left = limit-cur; while (left > 0) { c = (char)base[cur++]; @@ -805,7 +805,7 @@ L2: for (;;) { - T1_Int left = limit-cur; + FT_Int left = limit-cur; while (left > 0) { c = (char)base[cur++]; @@ -847,7 +847,7 @@ tok->token.start = cur-1; for (;;) { - T1_Int left = limit-cur; + FT_Int left = limit-cur; if ( left > 0 ) { /* test for any following digit, interpreted as number */ @@ -868,7 +868,7 @@ for (;;) { - T1_Int left = limit-cur; + FT_Int left = limit-cur; if ( left > 0 ) { /* test for single '/', interpreted as garbage */ @@ -909,7 +909,7 @@ if (!tok->error) { /* now, tries to match keywords and immediate names */ - T1_Int index; + FT_Int index; switch ( tok->token.kind ) { @@ -971,13 +971,13 @@ /* charstrings from the private dict.. */ /* */ LOCAL_FUNC - T1_Error Read_CharStrings( T1_Tokenizer tokenizer, - T1_Int num_chars, - T1_Byte* buffer ) + FT_Error Read_CharStrings( T1_Tokenizer tokenizer, + FT_Int num_chars, + FT_Byte* buffer ) { for (;;) { - T1_Int left = tokenizer->limit - tokenizer->cursor; + FT_Int left = tokenizer->limit - tokenizer->cursor; if ( left >= num_chars ) { diff --git a/src/type1/t1tokens.h b/src/type1/t1tokens.h index b65cf0882..0a5df32e5 100644 --- a/src/type1/t1tokens.h +++ b/src/type1/t1tokens.h @@ -169,8 +169,8 @@ { T1_TokenType kind; /* simple type */ T1_TokenType kind2; /* detailed type */ - T1_Int start; /* index of first token character */ - T1_Int len; /* length of token in chars */ + FT_Int start; /* index of first token character */ + FT_Int len; /* length of token in chars */ } T1_Token; @@ -182,15 +182,15 @@ FT_Memory memory; FT_Stream stream; - T1_Bool in_pfb; /* true if PFB file, PFA otherwise */ - T1_Bool in_private; /* true if in private dictionary */ + FT_Bool in_pfb; /* true if PFB file, PFA otherwise */ + FT_Bool in_private; /* true if in private dictionary */ - T1_Byte* base; /* base address of current read buffer */ - T1_Long cursor; /* current position in read buffer */ - T1_Long limit; /* limit of current read buffer */ - T1_Long max; /* maximum size of read buffer */ + FT_Byte* base; /* base address of current read buffer */ + FT_Long cursor; /* current position in read buffer */ + FT_Long limit; /* limit of current read buffer */ + FT_Long max; /* maximum size of read buffer */ - T1_Error error; /* last error */ + FT_Error error; /* last error */ T1_Token token; /* last token read */ } T1_TokenParser; @@ -235,7 +235,7 @@ /* function.. */ /* */ LOCAL_DEF - T1_Error New_Tokenizer( FT_Stream stream, + FT_Error New_Tokenizer( FT_Stream stream, T1_Tokenizer* tokenizer ); @@ -255,7 +255,7 @@ /* Type1 error code. 0 means success.. */ /* */ LOCAL_DEF - T1_Error Done_Tokenizer( T1_Tokenizer tokenizer ); + FT_Error Done_Tokenizer( T1_Tokenizer tokenizer ); @@ -276,7 +276,7 @@ /* Type1 error code. 0 means success.. */ /* */ LOCAL_DEF - T1_Error Open_PrivateDict( T1_Tokenizer tokenizer ); + FT_Error Open_PrivateDict( T1_Tokenizer tokenizer ); @@ -301,7 +301,7 @@ /* charstrings from the private dict.. */ /* */ LOCAL_DEF - T1_Error Read_Token( T1_Tokenizer tokenizer ); + FT_Error Read_Token( T1_Tokenizer tokenizer ); #if 0 @@ -328,9 +328,9 @@ /* charstrings from the private dict.. */ /* */ LOCAL_DEF - T1_Error Read_CharStrings( T1_Tokenizer tokenizer, - T1_Int num_chars, - T1_Byte* buffer ); + FT_Error Read_CharStrings( T1_Tokenizer tokenizer, + FT_Int num_chars, + FT_Byte* buffer ); #endif /*************************************************************************/ @@ -346,8 +346,8 @@ /* seed :: ecnryption seed (4330 for charstrings). */ /* */ LOCAL_DEF - void t1_decrypt( T1_Byte* buffer, - T1_Int length, - T1_UShort seed ); + void t1_decrypt( FT_Byte* buffer, + FT_Int length, + FT_UShort seed ); #endif /* T1TOKENS_H */ diff --git a/src/type1z/t1afm.c b/src/type1z/t1afm.c index 68bb6daf5..b630f88f0 100644 --- a/src/type1z/t1afm.c +++ b/src/type1z/t1afm.c @@ -96,7 +96,7 @@ #undef KERN_INDEX -#define KERN_INDEX(g1,g2) (((T1_ULong)g1 << 16) | g2) +#define KERN_INDEX(g1,g2) (((FT_ULong)g1 << 16) | g2) /* compare two kerning pairs */ static @@ -105,8 +105,8 @@ T1_Kern_Pair* pair1 = (T1_Kern_Pair*)a; T1_Kern_Pair* pair2 = (T1_Kern_Pair*)b; - T1_ULong index1 = KERN_INDEX(pair1->glyph1,pair1->glyph2); - T1_ULong index2 = KERN_INDEX(pair2->glyph1,pair2->glyph2); + FT_ULong index1 = KERN_INDEX(pair1->glyph1,pair1->glyph2); + FT_ULong index2 = KERN_INDEX(pair2->glyph1,pair2->glyph2); return ( index1 < index2 ? -1 : ( index1 > index2 ? 1 : 0 )); @@ -115,10 +115,10 @@ /* parse an AFM file - for now, only read the kerning pairs */ LOCAL_FUNC - T1_Error T1_Read_AFM( FT_Face t1_face, + FT_Error T1_Read_AFM( FT_Face t1_face, FT_Stream stream ) { - T1_Error error; + FT_Error error; FT_Memory memory = stream->memory; FT_Byte* start; FT_Byte* limit; @@ -202,7 +202,7 @@ FT_Vector* kerning ) { T1_Kern_Pair *min, *mid, *max; - T1_ULong index = KERN_INDEX(glyph1,glyph2); + FT_ULong index = KERN_INDEX(glyph1,glyph2); /* simple binary search */ min = afm->kern_pairs; @@ -210,7 +210,7 @@ while (min <= max) { - T1_ULong midi; + FT_ULong midi; mid = min + (max-min)/2; midi = KERN_INDEX(mid->glyph1,mid->glyph2); diff --git a/src/type1z/t1afm.h b/src/type1z/t1afm.h index 4adf4fb7f..3cfbfff32 100644 --- a/src/type1z/t1afm.h +++ b/src/type1z/t1afm.h @@ -18,23 +18,23 @@ typedef struct T1_Kern_Pair_ { - T1_UInt glyph1; - T1_UInt glyph2; - T1_Vector kerning; + FT_UInt glyph1; + FT_UInt glyph2; + FT_Vector kerning; } T1_Kern_Pair; typedef struct T1_AFM_ { - T1_Int num_pairs; + FT_Int num_pairs; T1_Kern_Pair* kern_pairs; } T1_AFM; LOCAL_DEF -T1_Error T1_Read_AFM( FT_Face face, +FT_Error T1_Read_AFM( FT_Face face, FT_Stream stream ); LOCAL_DEF @@ -43,8 +43,8 @@ void T1_Done_AFM( FT_Memory memory, LOCAL_DEF void T1_Get_Kerning( T1_AFM* afm, - T1_UInt glyph1, - T1_UInt glyph2, - T1_Vector* kerning ); + FT_UInt glyph1, + FT_UInt glyph2, + FT_Vector* kerning ); #endif /* T1AFM_H */ diff --git a/src/type1z/t1driver.c b/src/type1z/t1driver.c index e90523224..b8a841ca1 100644 --- a/src/type1z/t1driver.c +++ b/src/type1z/t1driver.c @@ -114,10 +114,10 @@ /* They can be implemented by format-specific interfaces. */ /* */ static - T1_Error Get_Kerning( T1_Face face, - T1_UInt left_glyph, - T1_UInt right_glyph, - T1_Vector* kerning ) + FT_Error Get_Kerning( T1_Face face, + FT_UInt left_glyph, + FT_UInt right_glyph, + FT_Vector* kerning ) { T1_AFM* afm; @@ -149,11 +149,11 @@ /* FreeType error code. 0 means success */ /* */ static - T1_Error Set_Char_Sizes( T1_Size size, - T1_F26Dot6 char_width, - T1_F26Dot6 char_height, - T1_UInt horz_resolution, - T1_UInt vert_resolution ) + FT_Error Set_Char_Sizes( T1_Size size, + FT_F26Dot6 char_width, + FT_F26Dot6 char_height, + FT_UInt horz_resolution, + FT_UInt vert_resolution ) { UNUSED(char_width); UNUSED(char_height); @@ -191,9 +191,9 @@ /* FreeType error code. 0 means success */ /* */ static - T1_Error Set_Pixel_Sizes( T1_Size size, - T1_Int pixel_width, - T1_Int pixel_height ) + FT_Error Set_Pixel_Sizes( T1_Size size, + FT_Int pixel_width, + FT_Int pixel_height ) { UNUSED(pixel_width); UNUSED(pixel_height); @@ -218,11 +218,11 @@ /* Glyph index. 0 means `undefined character code'. */ /* */ static - T1_UInt Get_Char_Index( FT_CharMap charmap, - T1_Long charcode ) + FT_UInt Get_Char_Index( FT_CharMap charmap, + FT_Long charcode ) { T1_Face face; - T1_UInt result = 0; + FT_UInt result = 0; PSNames_Interface* psnames; face = (T1_Face)charmap->face; @@ -238,7 +238,7 @@ { /* use the "psnames" module to synthetize the Unicode charmap */ result = psnames->lookup_unicode( &face->unicode_map, - (T1_ULong)charcode ); + (FT_ULong)charcode ); /* the function returns 0xFFFF when the Unicode charcode has */ /* no corresponding glyph.. */ diff --git a/src/type1z/t1gload.c b/src/type1z/t1gload.c index c34c51c3e..f2a1437be 100644 --- a/src/type1z/t1gload.c +++ b/src/type1z/t1gload.c @@ -55,7 +55,7 @@ } T1_Operator; - static const T1_Int t1_args_count[ op_max ] = + static const FT_Int t1_args_count[ op_max ] = { 0, /* none */ 0, /* endchar */ @@ -214,8 +214,8 @@ /* check that there is enough room for "count" more points */ static - T1_Error check_points( T1_Builder* builder, - T1_Int count ) + FT_Error check_points( T1_Builder* builder, + FT_Int count ) { FT_Outline* base = &builder->base; FT_Outline* outline = &builder->current; @@ -228,19 +228,19 @@ /* realloc points table if necessary */ if ( count >= builder->max_points ) { - T1_Error error; + FT_Error error; FT_Memory memory = builder->memory; - T1_Int increment = outline->points - base->points; - T1_Int current = builder->max_points; + FT_Int increment = outline->points - base->points; + FT_Int current = builder->max_points; while ( builder->max_points < count ) builder->max_points += 8; if ( REALLOC_ARRAY( base->points, current, - builder->max_points, T1_Vector ) || + builder->max_points, FT_Vector ) || REALLOC_ARRAY( base->tags, current, - builder->max_points, T1_Byte ) ) + builder->max_points, FT_Byte ) ) { builder->error = error; return error; @@ -280,11 +280,11 @@ /* check room for a new on-curve point, then add it */ static - T1_Error add_point1( T1_Builder* builder, + FT_Error add_point1( T1_Builder* builder, FT_Pos x, FT_Pos y ) { - T1_Error error; + FT_Error error; error = check_points(builder,1); if (!error) @@ -296,7 +296,7 @@ /* check room for a new contour, then add it */ static - T1_Error add_contour( T1_Builder* builder ) + FT_Error add_contour( T1_Builder* builder ) { FT_Outline* base = &builder->base; FT_Outline* outline = &builder->current; @@ -311,15 +311,15 @@ if ( base->n_contours + outline->n_contours >= builder->max_contours && builder->load_points ) { - T1_Error error; + FT_Error error; FT_Memory memory = builder->memory; - T1_Int increment = outline->contours - base->contours; - T1_Int current = builder->max_contours; + FT_Int increment = outline->contours - base->contours; + FT_Int current = builder->max_contours; builder->max_contours += 4; if ( REALLOC_ARRAY( base->contours, - current, builder->max_contours, T1_Short ) ) + current, builder->max_contours, FT_Short ) ) { builder->error = error; return error; @@ -337,14 +337,14 @@ /* if a path was begun, add its first on-curve point */ static - T1_Error start_point( T1_Builder* builder, - T1_Pos x, - T1_Pos y ) + FT_Error start_point( T1_Builder* builder, + FT_Pos x, + FT_Pos y ) { /* test wether we're building a new contour */ if (!builder->path_begun) { - T1_Error error; + FT_Error error; builder->path_begun = 1; error = add_contour( builder ); @@ -385,11 +385,11 @@ *********************************************************************/ static - T1_Int lookup_glyph_by_stdcharcode( T1_Face face, - T1_Int charcode ) + FT_Int lookup_glyph_by_stdcharcode( T1_Face face, + FT_Int charcode ) { - T1_Int n; - const T1_String* glyph_name; + FT_Int n; + const FT_String* glyph_name; PSNames_Interface* psnames = (PSNames_Interface*)face->psnames; /* check range of standard char code */ @@ -401,7 +401,7 @@ for ( n = 0; n < face->type1.num_glyphs; n++ ) { - T1_String* name = (T1_String*)face->type1.glyph_names[n]; + FT_String* name = (FT_String*)face->type1.glyph_names[n]; if ( name && strcmp(name,glyph_name) == 0 ) return n; @@ -434,19 +434,19 @@ *********************************************************************/ static - T1_Error t1operator_seac( T1_Decoder* decoder, - T1_Pos asb, - T1_Pos adx, - T1_Pos ady, - T1_Int bchar, - T1_Int achar ) + FT_Error t1operator_seac( T1_Decoder* decoder, + FT_Pos asb, + FT_Pos adx, + FT_Pos ady, + FT_Int bchar, + FT_Int achar ) { - T1_Error error; + FT_Error error; T1_Face face = decoder->builder.face; - T1_Int bchar_index, achar_index, n_base_points; + FT_Int bchar_index, achar_index, n_base_points; FT_Outline* cur = &decoder->builder.current; FT_Outline* base = &decoder->builder.base; - T1_Vector left_bearing, advance; + FT_Vector left_bearing, advance; T1_Font* type1 = &face->type1; bchar_index = lookup_glyph_by_stdcharcode( face, bchar ); @@ -545,7 +545,7 @@ /* adjust contours in accented character outline */ if (decoder->builder.load_points) { - T1_Int n; + FT_Int n; for ( n = 0; n < cur->n_contours; n++ ) cur->contours[n] += n_base_points; @@ -588,20 +588,20 @@ #define USE_ARGS(n) top -= n; if (top < decoder->stack) goto Stack_Underflow LOCAL_FUNC - T1_Error T1_Parse_CharStrings( T1_Decoder* decoder, - T1_Byte* charstring_base, - T1_Int charstring_len, - T1_Int num_subrs, - T1_Byte** subrs_base, - T1_Int* subrs_len ) + FT_Error T1_Parse_CharStrings( T1_Decoder* decoder, + FT_Byte* charstring_base, + FT_Int charstring_len, + FT_Int num_subrs, + FT_Byte** subrs_base, + FT_Int* subrs_len ) { - T1_Error error; + FT_Error error; T1_Decoder_Zone* zone; - T1_Byte* ip; - T1_Byte* limit; + FT_Byte* ip; + FT_Byte* limit; T1_Builder* builder = &decoder->builder; FT_Outline* outline; - T1_Pos x, y; + FT_Pos x, y; /* First of all, initialise the decoder */ decoder->top = decoder->stack; @@ -623,9 +623,9 @@ /* now, execute loop */ while ( ip < limit ) { - T1_Int* top = decoder->top; + FT_Int* top = decoder->top; T1_Operator op = op_none; - T1_Long value = 0; + FT_Long value = 0; /********************************************************************/ /* */ @@ -767,7 +767,7 @@ case 2: /* add flex vectors ------------------------ */ { - T1_Int index; + FT_Int index; if ( top[0] != 0 ) goto Unexpected_OtherSubr; @@ -779,7 +779,7 @@ add_point( builder, x, y, - (T1_Byte)( index==3 || index==6 ) ); + (FT_Byte)( index==3 || index==6 ) ); } break; @@ -846,9 +846,9 @@ case 18: /* multiple masters */ { T1_Blend* blend = decoder->blend; - T1_UInt num_points, nn, mm; - T1_Int* delta; - T1_Int* values; + FT_UInt num_points, nn, mm; + FT_Int* delta; + FT_Int* values; if (!blend) { @@ -887,7 +887,7 @@ values = top; for ( nn = 0; nn < num_points; nn++ ) { - T1_Int x = values[0]; + FT_Int x = values[0]; for ( mm = 1; mm < blend->num_designs; mm++ ) x += FT_MulFix( *delta++, blend->weight_vector[mm] ); @@ -907,7 +907,7 @@ } else /* general operator */ { - T1_Int num_args = t1_args_count[op]; + FT_Int num_args = t1_args_count[op]; if ( top - decoder->stack < num_args ) goto Stack_Underflow; @@ -1114,7 +1114,7 @@ case op_callsubr: /***********************************************/ { - T1_Int index; + FT_Int index; FT_TRACE4(( " callsubr" )); index = top[0]; @@ -1256,12 +1256,12 @@ /**********************************************************************/ LOCAL_FUNC - T1_Error T1_Compute_Max_Advance( T1_Face face, - T1_Int *max_advance ) + FT_Error T1_Compute_Max_Advance( T1_Face face, + FT_Int *max_advance ) { - T1_Error error; + FT_Error error; T1_Decoder decoder; - T1_Int glyph_index; + FT_Int glyph_index; T1_Font* type1 = &face->type1; *max_advance = 0; @@ -1310,15 +1310,15 @@ LOCAL_FUNC - T1_Error T1_Load_Glyph( T1_GlyphSlot glyph, + FT_Error T1_Load_Glyph( T1_GlyphSlot glyph, T1_Size size, - T1_Int glyph_index, - T1_Int load_flags ) + FT_Int glyph_index, + FT_Int load_flags ) { - T1_Error error; + FT_Error error; T1_Decoder decoder; T1_Face face = (T1_Face)glyph->root.face; - T1_Bool hinting; + FT_Bool hinting; T1_Font* type1 = &face->type1; if (load_flags & FT_LOAD_NO_RECURSE) @@ -1396,11 +1396,11 @@ if ( (load_flags & FT_LOAD_NO_SCALE) == 0 ) { /* scale the outline and the metrics */ - T1_Int n; + FT_Int n; FT_Outline* cur = &decoder.builder.base; - T1_Vector* vec = cur->points; - T1_Fixed x_scale = glyph->x_scale; - T1_Fixed y_scale = glyph->y_scale; + FT_Vector* vec = cur->points; + FT_Fixed x_scale = glyph->x_scale; + FT_Fixed y_scale = glyph->y_scale; /* First of all, scale the points */ for ( n = cur->n_points; n > 0; n--, vec++ ) diff --git a/src/type1z/t1gload.h b/src/type1z/t1gload.h index 0a87ab09d..7f331c15b 100644 --- a/src/type1z/t1gload.h +++ b/src/type1z/t1gload.h @@ -90,27 +90,27 @@ FT_Outline current; /* the current glyph outline */ FT_Outline base; /* the composite glyph outline */ - T1_Int max_points; /* capacity of base outline in points */ - T1_Int max_contours; /* capacity of base outline in contours */ + FT_Int max_points; /* capacity of base outline in points */ + FT_Int max_contours; /* capacity of base outline in contours */ - T1_Vector last; + FT_Vector last; - T1_Fixed scale_x; - T1_Fixed scale_y; + FT_Fixed scale_x; + FT_Fixed scale_y; - T1_Pos pos_x; - T1_Pos pos_y; + FT_Pos pos_x; + FT_Pos pos_y; - T1_Vector left_bearing; - T1_Vector advance; + FT_Vector left_bearing; + FT_Vector advance; - T1_BBox bbox; /* bounding box */ - T1_Bool path_begun; - T1_Bool load_points; - T1_Bool no_recurse; + FT_BBox bbox; /* bounding box */ + FT_Bool path_begun; + FT_Bool load_points; + FT_Bool no_recurse; - T1_Error error; /* only used for memory errors */ - T1_Bool metrics_only; + FT_Error error; /* only used for memory errors */ + FT_Bool metrics_only; } T1_Builder; @@ -118,9 +118,9 @@ /* execution context charstring zone */ typedef struct T1_Decoder_Zone_ { - T1_Byte* base; - T1_Byte* limit; - T1_Byte* cursor; + FT_Byte* base; + FT_Byte* limit; + FT_Byte* cursor; } T1_Decoder_Zone; @@ -129,15 +129,15 @@ { T1_Builder builder; - T1_Int stack[ T1_MAX_CHARSTRINGS_OPERANDS ]; - T1_Int* top; + FT_Int stack[ T1_MAX_CHARSTRINGS_OPERANDS ]; + FT_Int* top; T1_Decoder_Zone zones[ T1_MAX_SUBRS_CALLS+1 ]; T1_Decoder_Zone* zone; - T1_Int flex_state; - T1_Int num_flex_vectors; - T1_Vector flex_vectors[7]; + FT_Int flex_state; + FT_Int num_flex_vectors; + FT_Vector flex_vectors[7]; T1_Blend* blend; /* for multiple masters */ @@ -161,26 +161,26 @@ /* Compute the maximum advance width of a font through quick parsing */ LOCAL_DEF - T1_Error T1_Compute_Max_Advance( T1_Face face, - T1_Int *max_advance ); + FT_Error T1_Compute_Max_Advance( T1_Face face, + FT_Int *max_advance ); /* This function is exported, because it is used by the T1Dump utility */ LOCAL_DEF - T1_Error T1_Parse_CharStrings( T1_Decoder* decoder, - T1_Byte* charstring_base, - T1_Int charstring_len, - T1_Int num_subrs, - T1_Byte** subrs_base, - T1_Int* subrs_len ); + FT_Error T1_Parse_CharStrings( T1_Decoder* decoder, + FT_Byte* charstring_base, + FT_Int charstring_len, + FT_Int num_subrs, + FT_Byte** subrs_base, + FT_Int* subrs_len ); LOCAL_DEF - T1_Error T1_Load_Glyph( T1_GlyphSlot glyph, + FT_Error T1_Load_Glyph( T1_GlyphSlot glyph, T1_Size size, - T1_Int glyph_index, - T1_Int load_flags ); + FT_Int glyph_index, + FT_Int load_flags ); #ifdef __cplusplus diff --git a/src/type1z/t1load.c b/src/type1z/t1load.c index 92e1ce620..779c7c510 100644 --- a/src/type1z/t1load.c +++ b/src/type1z/t1load.c @@ -80,13 +80,13 @@ /***************************************************************************/ /***************************************************************************/ - static T1_Error t1_allocate_blend( T1_Face face, - T1_UInt num_designs, - T1_UInt num_axis ) + static FT_Error t1_allocate_blend( T1_Face face, + FT_UInt num_designs, + FT_UInt num_axis ) { T1_Blend* blend; FT_Memory memory = face->root.memory; - T1_Error error = 0; + FT_Error error = 0; blend = face->blend; if (!blend) @@ -148,12 +148,12 @@ goto Exit; } - LOCAL_FUNC T1_Error T1_Get_Multi_Master( T1_Face face, + LOCAL_FUNC FT_Error T1_Get_Multi_Master( T1_Face face, FT_Multi_Master* master ) { T1_Blend* blend = face->blend; - T1_UInt n; - T1_Error error; + FT_UInt n; + FT_Error error; error = T1_Err_Invalid_Argument; if (blend) @@ -175,13 +175,13 @@ } - LOCAL_FUNC T1_Error T1_Set_MM_Blend( T1_Face face, - T1_UInt num_coords, - T1_Fixed* coords ) + LOCAL_FUNC FT_Error T1_Set_MM_Blend( T1_Face face, + FT_UInt num_coords, + FT_Fixed* coords ) { T1_Blend* blend = face->blend; - T1_Error error; - T1_UInt n, m; + FT_Error error; + FT_UInt n, m; error = T1_Err_Invalid_Argument; if (blend && blend->num_axis == num_coords) @@ -213,32 +213,32 @@ } - LOCAL_FUNC T1_Error T1_Set_MM_Design( T1_Face face, - T1_UInt num_coords, - T1_Long* coords ) + LOCAL_FUNC FT_Error T1_Set_MM_Design( T1_Face face, + FT_UInt num_coords, + FT_Long* coords ) { T1_Blend* blend = face->blend; - T1_Error error; - T1_UInt n, p; + FT_Error error; + FT_UInt n, p; error = T1_Err_Invalid_Argument; if (blend && blend->num_axis == num_coords) { /* compute the blend coordinates through the blend design map */ - T1_Fixed final_blends[ T1_MAX_MM_DESIGNS ]; + FT_Fixed final_blends[ T1_MAX_MM_DESIGNS ]; for ( n = 0; n < blend->num_axis; n++ ) { - T1_Long design = coords[n]; - T1_Fixed the_blend; + FT_Long design = coords[n]; + FT_Fixed the_blend; T1_DesignMap* map = blend->design_map + n; - T1_Fixed* designs = map->design_points; - T1_Fixed* blends = map->blend_points; - T1_Int before = -1, after = -1; + FT_Fixed* designs = map->design_points; + FT_Fixed* blends = map->blend_points; + FT_Int before = -1, after = -1; for ( p = 0; p < map->num_points; p++ ) { - T1_Fixed p_design = designs[p]; + FT_Fixed p_design = designs[p]; /* exact match ? */ if (design == p_design) @@ -284,9 +284,9 @@ if (blend) { - T1_UInt num_designs = blend->num_designs; - T1_UInt num_axis = blend->num_axis; - T1_UInt n; + FT_UInt num_designs = blend->num_designs; + FT_UInt num_axis = blend->num_axis; + FT_UInt n; /* release design pos table */ FREE( blend->design_pos[0] ); @@ -327,8 +327,8 @@ static void parse_blend_axis_types( T1_Face face, T1_Loader* loader ) { T1_Token_Rec axis_tokens[ T1_MAX_MM_AXIS ]; - T1_Int n, num_axis; - T1_Error error = 0; + FT_Int n, num_axis; + FT_Error error = 0; T1_Blend* blend; FT_Memory memory; @@ -343,7 +343,7 @@ } /* allocate blend if necessary */ - error = t1_allocate_blend( face, 0, (T1_UInt)num_axis ); + error = t1_allocate_blend( face, 0, (FT_UInt)num_axis ); if (error) goto Exit; blend = face->blend; @@ -353,8 +353,8 @@ for ( n = 0; n < num_axis; n++ ) { T1_Token_Rec* token = axis_tokens + n; - T1_Byte* name; - T1_Int len; + FT_Byte* name; + FT_Int len; /* skip first slash, if any */ if (token->start[0] == '/') @@ -370,7 +370,7 @@ if ( ALLOC( blend->axis_names[n], len+1 ) ) goto Exit; - name = (T1_Byte*)blend->axis_names[n]; + name = (FT_Byte*)blend->axis_names[n]; MEM_Copy( name, token->start, len ); name[len] = 0; } @@ -383,11 +383,11 @@ static void parse_blend_design_positions( T1_Face face, T1_Loader* loader ) { T1_Token_Rec design_tokens[ T1_MAX_MM_DESIGNS ]; - T1_Int num_designs; - T1_Int num_axis; + FT_Int num_designs; + FT_Int num_axis; T1_Parser* parser = &loader->parser; - T1_Error error = 0; + FT_Error error = 0; T1_Blend* blend; /* get the array of design tokens - compute number of designs */ @@ -401,16 +401,17 @@ } { - T1_Byte* old_cursor = parser->cursor; - T1_Byte* old_limit = parser->limit; - T1_UInt n; + FT_Byte* old_cursor = parser->cursor; + FT_Byte* old_limit = parser->limit; + FT_UInt n; - blend = face->blend; - for ( n = 0; n < (T1_UInt)num_designs; n++ ) + blend = face->blend; + num_axis = 0; /* make compiler happy */ + for ( n = 0; n < (FT_UInt)num_designs; n++ ) { T1_Token_Rec axis_tokens[ T1_MAX_MM_DESIGNS ]; T1_Token_Rec* token; - T1_Int axis, n_axis; + FT_Int axis, n_axis; /* read axis/coordinates tokens */ token = design_tokens + n; @@ -452,13 +453,13 @@ static void parse_blend_design_map( T1_Face face, T1_Loader* loader ) { - T1_Error error = 0; + FT_Error error = 0; T1_Parser* parser = &loader->parser; T1_Blend* blend; T1_Token_Rec axis_tokens[ T1_MAX_MM_AXIS ]; - T1_Int n, num_axis; - T1_Byte* old_cursor; - T1_Byte* old_limit; + FT_Int n, num_axis; + FT_Byte* old_cursor; + FT_Byte* old_limit; FT_Memory memory = face->root.memory; T1_ToTokenArray( parser, axis_tokens, T1_MAX_MM_AXIS, &num_axis ); @@ -481,7 +482,7 @@ { T1_DesignMap* map = blend->design_map + n; T1_Token_Rec* token; - T1_Int p, num_points; + FT_Int p, num_points; token = axis_tokens + n; parser->cursor = token->start; @@ -489,8 +490,8 @@ /* count the number of map points */ { - T1_Byte* p = token->start; - T1_Byte* limit = token->limit; + FT_Byte* p = token->start; + FT_Byte* limit = token->limit; num_points = 0; for ( ; p < limit; p++ ) @@ -525,13 +526,13 @@ static void parse_weight_vector( T1_Face face, T1_Loader* loader ) { - T1_Error error = 0; + FT_Error error = 0; T1_Parser* parser = &loader->parser; T1_Blend* blend = face->blend; T1_Token_Rec master; - T1_UInt n; - T1_Byte* old_cursor; - T1_Byte* old_limit; + FT_UInt n; + FT_Byte* old_cursor; + FT_Byte* old_limit; if (!blend || blend->num_designs == 0) { @@ -707,14 +708,14 @@ #define T1_TOPDICT_NUM_FIXED2(n,f,m) T1_KEYWORD_TYPE1(n,f), - static T1_Error t1_load_keyword( T1_Face face, + static FT_Error t1_load_keyword( T1_Face face, T1_Loader* loader, T1_KeyWord* keyword ) { - T1_Error error; + FT_Error error; void* dummy_object; void** objects; - T1_UInt max_objects; + FT_UInt max_objects; T1_Blend* blend = face->blend; /* if the keyword has a dedicated callback, call it */ @@ -790,7 +791,7 @@ static void skip_whitespace( T1_Parser* parser ) { - T1_Byte* cur = parser->cursor; + FT_Byte* cur = parser->cursor; while ( cur < parser->limit && is_space(*cur) ) cur++; @@ -801,7 +802,7 @@ static void skip_blackspace( T1_Parser* parser ) { - T1_Byte* cur = parser->cursor; + FT_Byte* cur = parser->cursor; while ( cur < parser->limit && !is_space(*cur) ) cur++; @@ -810,10 +811,10 @@ } static - int read_binary_data( T1_Parser* parser, T1_Int *size, T1_Byte* *base ) + int read_binary_data( T1_Parser* parser, FT_Int *size, FT_Byte* *base ) { - T1_Byte* cur; - T1_Byte* limit = parser->limit; + FT_Byte* cur; + FT_Byte* limit = parser->limit; /* the binary data has the following format */ /* */ @@ -823,7 +824,7 @@ skip_whitespace(parser); cur = parser->cursor; - if ( cur < limit && (T1_Byte)(*cur-'0') < 10 ) + if ( cur < limit && (FT_Byte)(*cur-'0') < 10 ) { *size = T1_ToInt(parser); @@ -852,12 +853,12 @@ void parse_font_name( T1_Face face, T1_Loader* loader ) { T1_Parser* parser = &loader->parser; - T1_Error error; + FT_Error error; FT_Memory memory = parser->memory; - T1_Int len; - T1_Byte* cur; - T1_Byte* cur2; - T1_Byte* limit; + FT_Int len; + FT_Byte* cur; + FT_Byte* cur2; + FT_Byte* limit; skip_whitespace(parser); cur = parser->cursor; @@ -886,8 +887,8 @@ void parse_font_bbox( T1_Face face, T1_Loader* loader ) { T1_Parser* parser = &loader->parser; - T1_Short temp[4]; - T1_BBox* bbox = &face->type1.font_bbox; + FT_Short temp[4]; + FT_BBox* bbox = &face->type1.font_bbox; (void)T1_ToCoordArray( parser, 4, temp ); bbox->xMin = temp[0]; @@ -901,7 +902,7 @@ { T1_Parser* parser = &loader->parser; FT_Matrix* matrix = &face->type1.font_matrix; - T1_Fixed temp[4]; + FT_Fixed temp[4]; (void)T1_ToFixedArray( parser, 4, temp, 3 ); matrix->xx = temp[0]; @@ -916,8 +917,8 @@ void parse_encoding( T1_Face face, T1_Loader* loader ) { T1_Parser* parser = &loader->parser; - T1_Byte* cur = parser->cursor; - T1_Byte* limit = parser->limit; + FT_Byte* cur = parser->cursor; + FT_Byte* limit = parser->limit; /* skip whitespace */ while (is_space(*cur)) @@ -933,13 +934,13 @@ /* if we have a number, then the encoding is an array, */ /* and we must load it now */ - if ((T1_Byte)(*cur - '0') < 10) + if ((FT_Byte)(*cur - '0') < 10) { T1_Encoding* encode = &face->type1.encoding; - T1_Int count, n; + FT_Int count, n; T1_Table* char_table = &loader->encoding_table; FT_Memory memory = parser->memory; - T1_Error error; + FT_Error error; /* read the number of entries in the encoding, should be 256 */ count = T1_ToInt( parser ); @@ -947,8 +948,8 @@ /* we use a T1_Table to store our charnames */ encode->num_chars = count; - if ( ALLOC_ARRAY( encode->char_index, count, T1_Short ) || - ALLOC_ARRAY( encode->char_name, count, T1_String* ) || + if ( ALLOC_ARRAY( encode->char_index, count, FT_Short ) || + ALLOC_ARRAY( encode->char_name, count, FT_String* ) || (error = T1_New_Table( char_table, count, memory )) != 0 ) { parser->error = error; @@ -975,7 +976,7 @@ for ( ; cur < limit; ) { - T1_Byte c; + FT_Byte c; c = *cur; @@ -993,9 +994,9 @@ } /* otherwise, we must find a number before anything else */ - if ( (T1_Byte)(c-'0') < 10 ) + if ( (FT_Byte)(c-'0') < 10 ) { - T1_Int charcode; + FT_Int charcode; parser->cursor = cur; charcode = T1_ToInt(parser); @@ -1009,7 +1010,7 @@ /* bingo, we have an immediate name - it must be a */ /* character name */ FT_Byte* cur2 = cur+1; - T1_Int len; + FT_Int len; while (cur2 < limit && is_alpha(*cur2)) cur2++; len = cur2-cur-1; @@ -1054,8 +1055,8 @@ T1_Parser* parser = &loader->parser; T1_Table* table = &loader->subrs; FT_Memory memory = parser->memory; - T1_Error error; - T1_Int n; + FT_Error error; + FT_Int n; loader->num_subrs = T1_ToInt( parser ); if (parser->error) return; @@ -1071,8 +1072,8 @@ for ( n = 0; n < loader->num_subrs; n++ ) { - T1_Int index, size; - T1_Byte* base; + FT_Int index, size; + FT_Byte* base; index = T1_ToInt(parser); if (!read_binary_data(parser,&size,&base)) return; @@ -1100,11 +1101,11 @@ T1_Table* code_table = &loader->charstrings; T1_Table* name_table = &loader->glyph_names; FT_Memory memory = parser->memory; - T1_Error error; + FT_Error error; - T1_Byte* cur; - T1_Byte* limit = parser->limit; - T1_Int n; + FT_Byte* cur; + FT_Byte* limit = parser->limit; + FT_Int n; loader->num_glyphs = T1_ToInt( parser ); if (parser->error) return; @@ -1117,8 +1118,8 @@ n = 0; for ( ;; ) { - T1_Int size; - T1_Byte* base; + FT_Int size; + FT_Byte* base; /* the format is simple : */ /* "/glyphname" + binary data */ @@ -1146,8 +1147,8 @@ skip_blackspace(parser); else { - T1_Byte* cur2 = cur+1; - T1_Int len; + FT_Byte* cur2 = cur+1; + FT_Int len; while (cur2 < limit && is_alpha(*cur2)) cur2++; len = cur2-cur-1; @@ -1207,10 +1208,10 @@ static - T1_Error parse_dict( T1_Face face, + FT_Error parse_dict( T1_Face face, T1_Loader* loader, - T1_Byte* base, - T1_Long size ) + FT_Byte* base, + FT_Long size ) { T1_Parser* parser = &loader->parser; @@ -1219,8 +1220,8 @@ parser->error = 0; { - T1_Byte* cur = base; - T1_Byte* limit = cur + size; + FT_Byte* cur = base; + FT_Byte* limit = cur + size; for ( ;cur < limit; cur++ ) { @@ -1228,7 +1229,7 @@ if ( *cur == 'F' && cur+25 < limit && strncmp( (char*)cur, "FontDirectory", 13 ) == 0 ) { - T1_Byte* cur2; + FT_Byte* cur2; /* skip the "FontDirectory" keyword */ cur += 13; @@ -1256,8 +1257,8 @@ /* look for immediates */ else if (*cur == '/' && cur+2 < limit) { - T1_Byte* cur2; - T1_Int len; + FT_Byte* cur2; + FT_Int len; cur ++; cur2 = cur; @@ -1278,15 +1279,15 @@ for (;;) { - T1_Byte* name; + FT_Byte* name; - name = (T1_Byte*)keyword->name; + name = (FT_Byte*)keyword->name; if (!name) break; if ( cur[0] == name[0] && - len == (T1_Int)strlen((const char*)name) ) + len == (FT_Int)strlen((const char*)name) ) { - T1_Int n; + FT_Int n; for ( n = 1; n < len; n++ ) if (cur[n] != name[n]) break; @@ -1347,12 +1348,12 @@ } LOCAL_FUNC - T1_Error T1_Open_Face( T1_Face face ) + FT_Error T1_Open_Face( T1_Face face ) { T1_Loader loader; T1_Parser* parser; T1_Font* type1 = &face->type1; - T1_Error error; + FT_Error error; t1_init_loader( &loader, face ); @@ -1402,7 +1403,7 @@ /* we copy the glyph names "block" and "elements" fields */ /* but the "lengths" field must be released later.. */ type1->glyph_names_block = loader.glyph_names.block; - type1->glyph_names = (T1_String**)loader.glyph_names.elements; + type1->glyph_names = (FT_String**)loader.glyph_names.elements; loader.glyph_names.block = 0; loader.glyph_names.elements = 0; @@ -1410,9 +1411,9 @@ /* array.. */ if ( type1->encoding_type == t1_encoding_array ) { - T1_Int charcode, index, min_char, max_char; - T1_Byte* char_name; - T1_Byte* glyph_name; + FT_Int charcode, index, min_char, max_char; + FT_Byte* char_name; + FT_Byte* glyph_name; /* OK, we do the following : for each element in the encoding */ /* table, lookup the index of the glyph having the same name */ @@ -1432,7 +1433,7 @@ if (char_name) for ( index = 0; index < type1->num_glyphs; index++ ) { - glyph_name = (T1_Byte*)type1->glyph_names[index]; + glyph_name = (FT_Byte*)type1->glyph_names[index]; if ( strcmp( (const char*)char_name, (const char*)glyph_name ) == 0 ) { diff --git a/src/type1z/t1load.h b/src/type1z/t1load.h index 98a1359ae..e4a667656 100644 --- a/src/type1z/t1load.h +++ b/src/type1z/t1load.h @@ -31,37 +31,37 @@ { T1_Parser parser; /* parser used to read the stream */ - T1_Int num_chars; /* number of characters in encoding */ + FT_Int num_chars; /* number of characters in encoding */ T1_Table encoding_table; /* T1_Table used to store the */ /* encoding character names */ - T1_Int num_glyphs; + FT_Int num_glyphs; T1_Table glyph_names; T1_Table charstrings; - T1_Int num_subrs; + FT_Int num_subrs; T1_Table subrs; - T1_Bool fontdata; + FT_Bool fontdata; } T1_Loader; LOCAL_DEF - T1_Error T1_Open_Face( T1_Face face ); + FT_Error T1_Open_Face( T1_Face face ); #ifndef T1_CONFIG_OPTION_NO_MM_SUPPORT LOCAL_DEF - T1_Error T1_Get_Multi_Master( T1_Face face, + FT_Error T1_Get_Multi_Master( T1_Face face, FT_Multi_Master* master ); LOCAL_DEF - T1_Error T1_Set_MM_Blend( T1_Face face, - T1_UInt num_coords, - T1_Fixed* coords ); + FT_Error T1_Set_MM_Blend( T1_Face face, + FT_UInt num_coords, + FT_Fixed* coords ); LOCAL_DEF - T1_Error T1_Set_MM_Design( T1_Face face, - T1_UInt num_coords, - T1_Long* coords ); + FT_Error T1_Set_MM_Design( T1_Face face, + FT_UInt num_coords, + FT_Long* coords ); LOCAL_DEF void T1_Done_Blend( T1_Face face ); diff --git a/src/type1z/t1objs.c b/src/type1z/t1objs.c index a711d2fd1..c2dec5691 100644 --- a/src/type1z/t1objs.c +++ b/src/type1z/t1objs.c @@ -74,7 +74,7 @@ ******************************************************************/ LOCAL_DEF - T1_Error T1_Init_Size( T1_Size size ) + FT_Error T1_Init_Size( T1_Size size ) { size->valid = 0; return T1_Err_Ok; @@ -99,7 +99,7 @@ ******************************************************************/ LOCAL_FUNC - T1_Error T1_Reset_Size( T1_Size size ) + FT_Error T1_Reset_Size( T1_Size size ) { /* recompute ascender, descender, etc.. */ T1_Face face = (T1_Face)size->root.face; @@ -220,13 +220,13 @@ ******************************************************************/ LOCAL_FUNC - T1_Error T1_Init_Face( FT_Stream stream, + FT_Error T1_Init_Face( FT_Stream stream, T1_Face face, FT_Int face_index, FT_Int num_params, FT_Parameter* params ) { - T1_Error error; + FT_Error error; PSNames_Interface* psnames; UNUSED(num_params); @@ -319,8 +319,8 @@ root->bbox = face->type1.font_bbox; root->units_per_EM = 1000; - root->ascender = (T1_Short)face->type1.font_bbox.yMax; - root->descender = -(T1_Short)face->type1.font_bbox.yMin; + root->ascender = (FT_Short)face->type1.font_bbox.yMax; + root->descender = -(FT_Short)face->type1.font_bbox.yMin; root->height = ((root->ascender + root->descender)*12)/10; /* now compute the maximum advance width */ @@ -330,7 +330,7 @@ /* compute max advance width for proportional fonts */ if (!face->type1.font_info.is_fixed_pitch) { - T1_Int max_advance; + FT_Int max_advance; error = T1_Compute_Max_Advance( face, &max_advance ); @@ -454,7 +454,7 @@ ******************************************************************/ LOCAL_FUNC - T1_Error T1_Init_GlyphSlot( T1_GlyphSlot glyph ) + FT_Error T1_Init_GlyphSlot( T1_GlyphSlot glyph ) { FT_Library library = glyph->root.face->driver->library; @@ -482,7 +482,7 @@ ******************************************************************/ LOCAL_FUNC - T1_Error T1_Init_Driver( T1_Driver driver ) + FT_Error T1_Init_Driver( T1_Driver driver ) { UNUSED(driver); return T1_Err_Ok; diff --git a/src/type1z/t1objs.h b/src/type1z/t1objs.h index 0b1af90b0..b872102aa 100644 --- a/src/type1z/t1objs.h +++ b/src/type1z/t1objs.h @@ -94,7 +94,7 @@ typedef struct T1_SizeRec_ { FT_SizeRec root; - T1_Bool valid; + FT_Bool valid; T1_Size_Hints* hints; /* defined in the hinter. This allows */ /* us to experiment with different */ /* hinting schemes without having to */ @@ -114,11 +114,11 @@ { FT_GlyphSlotRec root; - T1_Bool hint; - T1_Bool scaled; + FT_Bool hint; + FT_Bool scaled; - T1_Int max_points; - T1_Int max_contours; + FT_Int max_points; + FT_Int max_contours; FT_Fixed x_scale; FT_Fixed y_scale; @@ -146,7 +146,7 @@ ******************************************************************/ LOCAL_DEF - T1_Error T1_Init_Face( FT_Stream stream, + FT_Error T1_Init_Face( FT_Stream stream, T1_Face face, FT_Int face_index, FT_Int num_params, @@ -187,7 +187,7 @@ ******************************************************************/ LOCAL_DEF - T1_Error T1_Init_Size( T1_Size size ); + FT_Error T1_Init_Size( T1_Size size ); @@ -221,7 +221,7 @@ ******************************************************************/ LOCAL_DEF - T1_Error T1_Reset_Size( T1_Size size ); + FT_Error T1_Reset_Size( T1_Size size ); @@ -238,7 +238,7 @@ ******************************************************************/ LOCAL_DEF - T1_Error T1_Init_GlyphSlot( T1_GlyphSlot slot ); + FT_Error T1_Init_GlyphSlot( T1_GlyphSlot slot ); @@ -275,7 +275,7 @@ ******************************************************************/ LOCAL_DEF - T1_Error T1_Init_Driver( T1_Driver driver ); + FT_Error T1_Init_Driver( T1_Driver driver ); diff --git a/src/type1z/t1parse.c b/src/type1z/t1parse.c index 7b05a935c..c4a033953 100644 --- a/src/type1z/t1parse.c +++ b/src/type1z/t1parse.c @@ -67,15 +67,15 @@ /* */ LOCAL_FUNC - T1_Error T1_New_Table( T1_Table* table, - T1_Int count, + FT_Error T1_New_Table( T1_Table* table, + FT_Int count, FT_Memory memory ) { - T1_Error error; + FT_Error error; table->memory = memory; - if ( ALLOC_ARRAY( table->elements, count, T1_Byte* ) || - ALLOC_ARRAY( table->lengths, count, T1_Byte* ) ) + if ( ALLOC_ARRAY( table->elements, count, FT_Byte* ) || + ALLOC_ARRAY( table->lengths, count, FT_Byte* ) ) goto Exit; table->max_elems = count; @@ -112,11 +112,11 @@ /* */ - static void shift_elements( T1_Table* table, T1_Byte* old_base ) + static void shift_elements( T1_Table* table, FT_Byte* old_base ) { - T1_Long delta = table->block - old_base; - T1_Byte** offset = table->elements; - T1_Byte** limit = offset + table->max_elems; + FT_Long delta = table->block - old_base; + FT_Byte** offset = table->elements; + FT_Byte** limit = offset + table->max_elems; if (delta) for ( ; offset < limit; offset++ ) @@ -127,12 +127,12 @@ } static - T1_Error reallocate_t1_table( T1_Table* table, - T1_Int new_size ) + FT_Error reallocate_t1_table( T1_Table* table, + FT_Int new_size ) { FT_Memory memory = table->memory; - T1_Byte* old_base = table->block; - T1_Error error; + FT_Byte* old_base = table->block; + FT_Error error; /* realloc the base block */ if ( REALLOC( table->block, table->capacity, new_size ) ) @@ -150,10 +150,10 @@ LOCAL_FUNC - T1_Error T1_Add_Table( T1_Table* table, - T1_Int index, + FT_Error T1_Add_Table( T1_Table* table, + FT_Int index, void* object, - T1_Int length ) + FT_Int length ) { if (index < 0 || index > table->max_elems) { @@ -164,8 +164,8 @@ /* grow the base block if needed */ if ( table->cursor + length > table->capacity ) { - T1_Error error; - T1_Int new_size = table->capacity; + FT_Error error; + FT_Int new_size = table->capacity; while ( new_size < table->cursor+length ) new_size += 1024; @@ -203,8 +203,8 @@ void T1_Done_Table( T1_Table* table ) { FT_Memory memory = table->memory; - T1_Error error; - T1_Byte* old_base; + FT_Error error; + FT_Byte* old_base; /* should never fail, as rec.cursor <= rec.size */ old_base = table->block; @@ -252,12 +252,12 @@ LOCAL_FUNC void T1_Skip_Spaces( T1_Parser* parser ) { - T1_Byte* cur = parser->cursor; - T1_Byte* limit = parser->limit; + FT_Byte* cur = parser->cursor; + FT_Byte* limit = parser->limit; while (cur < limit) { - T1_Byte c = *cur; + FT_Byte c = *cur; if (!IS_T1_SPACE(c)) break; cur++; @@ -269,10 +269,10 @@ void T1_ToToken( T1_Parser* parser, T1_Token_Rec* token ) { - T1_Byte* cur; - T1_Byte* limit; - T1_Byte starter, ender; - T1_Int embed; + FT_Byte* cur; + FT_Byte* limit; + FT_Byte starter, ender; + FT_Int embed; token->type = t1_token_none; token->start = 0; @@ -350,8 +350,8 @@ LOCAL_FUNC void T1_ToTokenArray( T1_Parser* parser, T1_Token_Rec* tokens, - T1_UInt max_tokens, - T1_Int *pnum_tokens ) + FT_UInt max_tokens, + FT_Int *pnum_tokens ) { T1_Token_Rec master; @@ -360,8 +360,8 @@ T1_ToToken( parser, &master ); if (master.type == t1_token_array) { - T1_Byte* old_cursor = parser->cursor; - T1_Byte* old_limit = parser->limit; + FT_Byte* old_cursor = parser->cursor; + FT_Byte* old_limit = parser->limit; T1_Token_Rec* cur = tokens; T1_Token_Rec* limit = cur + max_tokens; @@ -391,17 +391,17 @@ static - T1_Long t1_toint( T1_Byte* *cursor, - T1_Byte* limit ) + FT_Long t1_toint( FT_Byte* *cursor, + FT_Byte* limit ) { - T1_Long result = 0; - T1_Byte* cur = *cursor; - T1_Byte c, d; + FT_Long result = 0; + FT_Byte* cur = *cursor; + FT_Byte c, d; for (; cur < limit; cur++) { c = *cur; - d = (T1_Byte)(c - '0'); + d = (FT_Byte)(c - '0'); if (d < 10) break; if ( c=='-' ) @@ -415,7 +415,7 @@ { do { - d = (T1_Byte)(cur[0] - '0'); + d = (FT_Byte)(cur[0] - '0'); if (d >= 10) break; @@ -434,14 +434,14 @@ static - T1_Long t1_tofixed( T1_Byte* *cursor, - T1_Byte* limit, - T1_Long power_ten ) + FT_Long t1_tofixed( FT_Byte* *cursor, + FT_Byte* limit, + FT_Long power_ten ) { - T1_Byte* cur = *cursor; - T1_Long num, divider, result; - T1_Int sign = 0; - T1_Byte d; + FT_Byte* cur = *cursor; + FT_Long num, divider, result; + FT_Int sign = 0; + FT_Byte d; if (cur >= limit) return 0; @@ -464,7 +464,7 @@ for (;;) { - d = (T1_Byte)(*cur - '0'); + d = (FT_Byte)(*cur - '0'); if (d >= 10) break; if (divider < 10000000L) @@ -512,14 +512,14 @@ static - T1_Int t1_tocoordarray( T1_Byte* *cursor, - T1_Byte* limit, - T1_Int max_coords, - T1_Short* coords ) + FT_Int t1_tocoordarray( FT_Byte* *cursor, + FT_Byte* limit, + FT_Int max_coords, + FT_Short* coords ) { - T1_Byte* cur = *cursor; - T1_Int count = 0; - T1_Byte c, ender; + FT_Byte* cur = *cursor; + FT_Int count = 0; + FT_Byte c, ender; if (cur >= limit) goto Exit; @@ -552,7 +552,7 @@ if (count >= max_coords || c == ender) break; - coords[count] = (T1_Short)(t1_tofixed(&cur,limit,0) >> 16); + coords[count] = (FT_Short)(t1_tofixed(&cur,limit,0) >> 16); count++; if (!ender) @@ -567,15 +567,15 @@ static - T1_Int t1_tofixedarray( T1_Byte* *cursor, - T1_Byte* limit, - T1_Int max_values, - T1_Fixed* values, - T1_Int power_ten ) + FT_Int t1_tofixedarray( FT_Byte* *cursor, + FT_Byte* limit, + FT_Int max_values, + FT_Fixed* values, + FT_Int power_ten ) { - T1_Byte* cur = *cursor; - T1_Int count = 0; - T1_Byte c, ender; + FT_Byte* cur = *cursor; + FT_Int count = 0; + FT_Byte c, ender; if (cur >= limit) goto Exit; @@ -623,13 +623,13 @@ #if 0 static - T1_String* t1_tostring( T1_Byte* *cursor, T1_Byte* limit, FT_Memory memory ) + FT_String* t1_tostring( FT_Byte* *cursor, FT_Byte* limit, FT_Memory memory ) { - T1_Byte* cur = *cursor; - T1_Int len = 0; - T1_Int count; - T1_String* result; - T1_Error error; + FT_Byte* cur = *cursor; + FT_Int len = 0; + FT_Int count; + FT_String* result; + FT_Error error; /* XXX : some stupid fonts have a "Notice" or "Copyright" string */ /* that simply doesn't begin with an opening parenthesis, even */ @@ -674,10 +674,10 @@ #endif static - int t1_tobool( T1_Byte* *cursor, T1_Byte* limit ) + int t1_tobool( FT_Byte* *cursor, FT_Byte* limit ) { - T1_Byte* cur = *cursor; - T1_Bool result = 0; + FT_Byte* cur = *cursor; + FT_Bool result = 0; /* return 1 if we find a "true", 0 otherwise */ if ( cur+3 < limit && @@ -707,18 +707,18 @@ /* Loads a simple field (i.e. non-table) into the current list of objects */ LOCAL_FUNC - T1_Error T1_Load_Field( T1_Parser* parser, + FT_Error T1_Load_Field( T1_Parser* parser, const T1_Field_Rec* field, void** objects, - T1_UInt max_objects, - T1_ULong* pflags ) + FT_UInt max_objects, + FT_ULong* pflags ) { T1_Token_Rec token; - T1_Byte* cur; - T1_Byte* limit; - T1_UInt count; - T1_UInt index; - T1_Error error; + FT_Byte* cur; + FT_Byte* limit; + FT_UInt count; + FT_UInt index; + FT_Error error; T1_ToToken( parser, &token ); if (!token.type) @@ -741,9 +741,9 @@ for ( ; count > 0; count--, index++ ) { - T1_Byte* q = (T1_Byte*)objects[index] + field->offset; - T1_Long val; - T1_String* string; + FT_Byte* q = (FT_Byte*)objects[index] + field->offset; + FT_Long val; + FT_String* string; switch (field->type) { @@ -765,9 +765,9 @@ Store_Integer: switch (field->size) { - case 1: *(T1_Byte*)q = (T1_Byte)val; break; - case 2: *(T1_UShort*)q = (T1_UShort)val; break; - default: *(T1_Long*)q = val; + case 1: *(FT_Byte*)q = (FT_Byte)val; break; + case 2: *(FT_UShort*)q = (FT_UShort)val; break; + default: *(FT_Long*)q = val; } } break; @@ -783,7 +783,7 @@ MEM_Copy( string, cur, len ); string[len] = 0; - *(T1_String**)q = string; + *(FT_String**)q = string; } break; @@ -807,18 +807,18 @@ #define T1_MAX_TABLE_ELEMENTS 32 LOCAL_FUNC - T1_Error T1_Load_Field_Table( T1_Parser* parser, + FT_Error T1_Load_Field_Table( T1_Parser* parser, const T1_Field_Rec* field, void** objects, - T1_UInt max_objects, - T1_ULong* pflags ) + FT_UInt max_objects, + FT_ULong* pflags ) { T1_Token_Rec elements[T1_MAX_TABLE_ELEMENTS]; T1_Token_Rec* token; - T1_Int num_elements; - T1_Error error = 0; - T1_Byte* old_cursor; - T1_Byte* old_limit; + FT_Int num_elements; + FT_Error error = 0; + FT_Byte* old_cursor; + FT_Byte* old_limit; T1_Field_Rec fieldrec = *(T1_Field_Rec*)field; T1_ToTokenArray( parser, elements, 32, &num_elements ); @@ -832,7 +832,7 @@ old_limit = parser->limit; /* we store the elements count */ - *(T1_Byte*)((T1_Byte*)objects[0] + field->count_offset) = num_elements; + *(FT_Byte*)((FT_Byte*)objects[0] + field->count_offset) = num_elements; /* we now load each element, adjusting the field.offset on each one */ token = elements; @@ -864,33 +864,33 @@ LOCAL_FUNC - T1_Long T1_ToInt ( T1_Parser* parser ) + FT_Long T1_ToInt ( T1_Parser* parser ) { return t1_toint( &parser->cursor, parser->limit ); } LOCAL_FUNC - T1_Long T1_ToFixed( T1_Parser* parser, T1_Int power_ten ) + FT_Long T1_ToFixed( T1_Parser* parser, FT_Int power_ten ) { return t1_tofixed( &parser->cursor, parser->limit, power_ten ); } LOCAL_FUNC - T1_Int T1_ToCoordArray( T1_Parser* parser, - T1_Int max_coords, - T1_Short* coords ) + FT_Int T1_ToCoordArray( T1_Parser* parser, + FT_Int max_coords, + FT_Short* coords ) { return t1_tocoordarray( &parser->cursor, parser->limit, max_coords, coords ); } LOCAL_FUNC - T1_Int T1_ToFixedArray( T1_Parser* parser, - T1_Int max_values, - T1_Fixed* values, - T1_Int power_ten ) + FT_Int T1_ToFixedArray( T1_Parser* parser, + FT_Int max_values, + FT_Fixed* values, + FT_Int power_ten ) { return t1_tofixedarray( &parser->cursor, parser->limit, max_values, values, power_ten ); } @@ -898,14 +898,14 @@ #if 0 LOCAL_FUNC - T1_String* T1_ToString( T1_Parser* parser ) + FT_String* T1_ToString( T1_Parser* parser ) { return t1_tostring( &parser->cursor, parser->limit, parser->memory ); } LOCAL_FUNC - T1_Bool T1_ToBool( T1_Parser* parser ) + FT_Bool T1_ToBool( T1_Parser* parser ) { return t1_tobool( &parser->cursor, parser->limit ); } @@ -913,9 +913,9 @@ static - T1_Error read_pfb_tag( FT_Stream stream, T1_UShort *tag, T1_Long* size ) + FT_Error read_pfb_tag( FT_Stream stream, FT_UShort *tag, FT_Long* size ) { - T1_Error error; + FT_Error error; if (READ_UShort(*tag)) goto Exit; if (*tag == 0x8001 || *tag == 0x8002) @@ -938,13 +938,13 @@ LOCAL_FUNC - T1_Error T1_New_Parser( T1_Parser* parser, + FT_Error T1_New_Parser( T1_Parser* parser, FT_Stream stream, FT_Memory memory ) { - T1_Error error; - T1_UShort tag; - T1_Long size; + FT_Error error; + FT_UShort tag; + FT_Long size; parser->stream = stream; parser->memory = memory; @@ -999,7 +999,7 @@ /* if it's a memory-based resource, set up pointers */ if ( !stream->read ) { - parser->base_dict = (T1_Byte*)stream->base + stream->pos; + parser->base_dict = (FT_Byte*)stream->base + stream->pos; parser->base_len = size; parser->in_memory = 1; @@ -1074,13 +1074,13 @@ LOCAL_FUNC - void T1_Decrypt( T1_Byte* buffer, - T1_Int length, - T1_UShort seed ) + void T1_Decrypt( FT_Byte* buffer, + FT_Int length, + FT_UShort seed ) { while ( length > 0 ) { - T1_Byte plain; + FT_Byte plain; plain = (*buffer ^ (seed >> 8)); seed = (*buffer+seed)*52845+22719; @@ -1091,12 +1091,12 @@ LOCAL_FUNC - T1_Error T1_Get_Private_Dict( T1_Parser* parser ) + FT_Error T1_Get_Private_Dict( T1_Parser* parser ) { FT_Stream stream = parser->stream; FT_Memory memory = parser->memory; - T1_Error error = 0; - T1_Long size; + FT_Error error = 0; + FT_Long size; if (parser->in_pfb) { @@ -1104,9 +1104,9 @@ /* made of several segments. We thus first read the number of */ /* segments to compute the total size of the private dictionary */ /* then re-read them into memory.. */ - T1_Long start_pos = FILE_Pos(); - T1_UShort tag; - T1_Long size; + FT_Long start_pos = FILE_Pos(); + FT_UShort tag; + FT_Long size; parser->private_len = 0; for (;;) @@ -1226,8 +1226,8 @@ { /* ASCII hexadecimal encoding.. This blows goats !!.. */ - T1_Byte* write; - T1_Int count; + FT_Byte* write; + FT_Int count; write = parser->private_dict; count = 0; diff --git a/src/type1z/t1parse.h b/src/type1z/t1parse.h index 9ef51fc59..e14728b7c 100644 --- a/src/type1z/t1parse.h +++ b/src/type1z/t1parse.h @@ -54,8 +54,8 @@ /* a simple structure used to identify tokens */ typedef struct T1_Token_Rec_ { - T1_Byte* start; /* first character of token in input stream */ - T1_Byte* limit; /* first character after the token */ + FT_Byte* start; /* first character of token in input stream */ + FT_Byte* limit; /* first character after the token */ T1_Token_Type type; /* type of token.. */ } T1_Token_Rec; @@ -80,11 +80,11 @@ typedef struct T1_Field_Rec_ { T1_Field_Type type; /* type of field */ - T1_UInt offset; /* offset of field in object */ - T1_UInt size; /* size of field in bytes */ - T1_UInt array_max; /* maximum number of elements for array */ - T1_UInt count_offset; /* offset of element count for arrays */ - T1_Int flag_bit; /* bit number for field flag */ + FT_UInt offset; /* offset of field in object */ + FT_UInt size; /* size of field in bytes */ + FT_UInt array_max; /* maximum number of elements for array */ + FT_UInt count_offset; /* offset of element count for arrays */ + FT_Int flag_bit; /* bit number for field flag */ } T1_Field_Rec; @@ -92,54 +92,54 @@ #define T1_FIELD_BOOL( _ftype, _fname ) \ { t1_field_bool, \ - (T1_UInt)(char*)&T1_FIELD_REF(_ftype,_fname), \ + (FT_UInt)(char*)&T1_FIELD_REF(_ftype,_fname), \ sizeof(T1_FIELD_REF(_ftype,_fname)), \ 0, 0, 0 } #define T1_FIELD_NUM( _ftype, _fname ) \ { t1_field_integer, \ - (T1_UInt)(char*)&T1_FIELD_REF(_ftype,_fname), \ + (FT_UInt)(char*)&T1_FIELD_REF(_ftype,_fname), \ sizeof(T1_FIELD_REF(_ftype,_fname)), \ 0, 0, 0 } #define T1_FIELD_FIXED( _ftype, _fname, _power ) \ { t1_field_fixed, \ - (T1_UInt)(char*)&T1_FIELD_REF(_ftype,_fname), \ + (FT_UInt)(char*)&T1_FIELD_REF(_ftype,_fname), \ sizeof(T1_FIELD_REF(_ftype,_fname)), \ 0, 0, 0 } #define T1_FIELD_STRING( _ftype, _fname ) \ { t1_field_string, \ - (T1_UInt)(char*)&T1_FIELD_REF(_ftype,_fname), \ + (FT_UInt)(char*)&T1_FIELD_REF(_ftype,_fname), \ sizeof(T1_FIELD_REF(_ftype,_fname)), \ 0, 0, 0 } #define T1_FIELD_NUM_ARRAY( _ftype, _fname, _fcount, _fmax ) \ { t1_field_integer, \ - (T1_UInt)(char*)&T1_FIELD_REF(_ftype,_fname), \ + (FT_UInt)(char*)&T1_FIELD_REF(_ftype,_fname), \ sizeof(T1_FIELD_REF(_ftype,_fname)[0]), \ _fmax, \ - (T1_UInt)(char*)&T1_FIELD_REF(_ftype,_fcount), \ + (FT_UInt)(char*)&T1_FIELD_REF(_ftype,_fcount), \ 0 } #define T1_FIELD_FIXED_ARRAY( _ftype, _fname, _fcount, _fmax ) \ { t1_field_fixed, \ - (T1_UInt)(char*)&T1_FIELD_REF(_ftype,_fname), \ + (FT_UInt)(char*)&T1_FIELD_REF(_ftype,_fname), \ sizeof(T1_FIELD_REF(_ftype,_fname)[0]), \ _fmax, \ - (T1_UInt)(char*)&T1_FIELD_REF(_ftype,_fcount), \ + (FT_UInt)(char*)&T1_FIELD_REF(_ftype,_fcount), \ 0 } #define T1_FIELD_NUM_ARRAY2( _ftype, _fname, _fmax ) \ { t1_field_integer, \ - (T1_UInt)(char*)&T1_FIELD_REF(_ftype,_fname), \ + (FT_UInt)(char*)&T1_FIELD_REF(_ftype,_fname), \ sizeof(T1_FIELD_REF(_ftype,_fname)[0]), \ _fmax, \ 0, 0 } #define T1_FIELD_FIXED_ARRAY2( _ftype, _fname, _fmax ) \ { t1_field_fixed, \ - (T1_UInt)(char*)&T1_FIELD_REF(_ftype,_fname), \ + (FT_UInt)(char*)&T1_FIELD_REF(_ftype,_fname), \ sizeof(T1_FIELD_REF(_ftype,_fname)[0]), \ _fmax, \ 0, 0 } @@ -177,15 +177,15 @@ typedef struct T1_Table_ { - T1_Byte* block; /* current memory block */ - T1_Int cursor; /* current cursor in memory block */ - T1_Int capacity; /* current size of memory block */ - T1_Long init; + FT_Byte* block; /* current memory block */ + FT_Int cursor; /* current cursor in memory block */ + FT_Int capacity; /* current size of memory block */ + FT_Long init; - T1_Int max_elems; - T1_Int num_elems; - T1_Byte** elements; /* addresses of table elements */ - T1_Int* lengths; /* lengths of table elements */ + FT_Int max_elems; + FT_Int num_elems; + FT_Byte** elements; /* addresses of table elements */ + FT_Int* lengths; /* lengths of table elements */ FT_Memory memory; @@ -226,34 +226,34 @@ FT_Stream stream; FT_Memory memory; - T1_Byte* base_dict; - T1_Int base_len; + FT_Byte* base_dict; + FT_Int base_len; - T1_Byte* private_dict; - T1_Int private_len; + FT_Byte* private_dict; + FT_Int private_len; - T1_Byte in_pfb; - T1_Byte in_memory; - T1_Byte single_block; + FT_Byte in_pfb; + FT_Byte in_memory; + FT_Byte single_block; - T1_Byte* cursor; - T1_Byte* limit; - T1_Error error; + FT_Byte* cursor; + FT_Byte* limit; + FT_Error error; } T1_Parser; LOCAL_DEF - T1_Error T1_New_Table( T1_Table* table, - T1_Int count, + FT_Error T1_New_Table( T1_Table* table, + FT_Int count, FT_Memory memory ); LOCAL_DEF - T1_Error T1_Add_Table( T1_Table* table, - T1_Int index, + FT_Error T1_Add_Table( T1_Table* table, + FT_Int index, void* object, - T1_Int length ); + FT_Int length ); #if 0 LOCAL_DEF @@ -264,28 +264,28 @@ void T1_Release_Table( T1_Table* table ); LOCAL_DEF - T1_Long T1_ToInt ( T1_Parser* parser ); + FT_Long T1_ToInt ( T1_Parser* parser ); LOCAL_DEF - T1_Long T1_ToFixed( T1_Parser* parser, T1_Int power_ten ); + FT_Long T1_ToFixed( T1_Parser* parser, FT_Int power_ten ); LOCAL_DEF - T1_Int T1_ToCoordArray( T1_Parser* parser, - T1_Int max_coords, - T1_Short* coords ); + FT_Int T1_ToCoordArray( T1_Parser* parser, + FT_Int max_coords, + FT_Short* coords ); LOCAL_DEF - T1_Int T1_ToFixedArray( T1_Parser* parser, - T1_Int max_values, - T1_Fixed* values, - T1_Int power_ten ); + FT_Int T1_ToFixedArray( T1_Parser* parser, + FT_Int max_values, + FT_Fixed* values, + FT_Int power_ten ); #if 0 LOCAL_DEF - T1_String* T1_ToString( T1_Parser* parser ); + FT_String* T1_ToString( T1_Parser* parser ); LOCAL_DEF - T1_Bool T1_ToBool( T1_Parser* parser ); + FT_Bool T1_ToBool( T1_Parser* parser ); #endif @@ -303,36 +303,36 @@ LOCAL_FUNC void T1_ToTokenArray( T1_Parser* parser, T1_Token_Rec* tokens, - T1_UInt max_tokens, - T1_Int* pnum_tokens ); + FT_UInt max_tokens, + FT_Int* pnum_tokens ); LOCAL_DEF - T1_Error T1_Load_Field( T1_Parser* parser, + FT_Error T1_Load_Field( T1_Parser* parser, const T1_Field_Rec* field, void** objects, - T1_UInt max_objects, - T1_ULong* pflags ); + FT_UInt max_objects, + FT_ULong* pflags ); LOCAL_DEF - T1_Error T1_Load_Field_Table( T1_Parser* parser, + FT_Error T1_Load_Field_Table( T1_Parser* parser, const T1_Field_Rec* field, void** objects, - T1_UInt max_objects, - T1_ULong* pflags ); + FT_UInt max_objects, + FT_ULong* pflags ); LOCAL_DEF - T1_Error T1_New_Parser( T1_Parser* parser, + FT_Error T1_New_Parser( T1_Parser* parser, FT_Stream stream, FT_Memory memory ); LOCAL_DEF - T1_Error T1_Get_Private_Dict( T1_Parser* parser ); + FT_Error T1_Get_Private_Dict( T1_Parser* parser ); LOCAL_DEF - void T1_Decrypt( T1_Byte* buffer, - T1_Int length, - T1_UShort seed ); + void T1_Decrypt( FT_Byte* buffer, + FT_Int length, + FT_UShort seed ); LOCAL_DEF void T1_Done_Parser( T1_Parser* parser ); diff --git a/src/type1z/t1tokens.h b/src/type1z/t1tokens.h index 98f552841..e3a88da8f 100644 --- a/src/type1z/t1tokens.h +++ b/src/type1z/t1tokens.h @@ -75,8 +75,8 @@ PARSE_INT("ItalicAngle",italic_angle) PARSE_BOOL("isFixedPitch",is_fixed_pitch) - PARSE_NUM("UnderlinePosition",underline_position,T1_Short) - PARSE_NUM("UnderlineThickness",underline_thickness,T1_UShort) + PARSE_NUM("UnderlinePosition",underline_position,FT_Short) + PARSE_NUM("UnderlineThickness",underline_thickness,FT_UShort) /* define the private dict parsing callbacks */ @@ -114,8 +114,8 @@ /* PARSE_STRING( "FontName", font_name ) -- handled by special routine */ - PARSE_NUM( "PaintType", paint_type, T1_Byte ) - PARSE_NUM( "FontType", font_type, T1_Byte ) + PARSE_NUM( "PaintType", paint_type, FT_Byte ) + PARSE_NUM( "FontType", font_type, FT_Byte ) PARSE_FIXEDS2( "FontMatrix", 4, font_matrix ) /* PARSE_COORDS2( "FontBBox", 4, font_bbox ) -- handled by special func */ PARSE_INT( "StrokeWidth", stroke_width )