* include/freetype/internal/psaux.h,

src/cid/cidload.c, src/cidtoken.h,
          src/psaux/psobjs.c, src/psaux/psobjs.h, src/psaux/t1decode.c,
          stc/type1/t1load.c, src/type1/t1tokens.h: updated common Postscript
          type definitions
This commit is contained in:
David Turner 2002-03-14 10:09:35 +00:00
parent 44c5177782
commit 72a849f394
9 changed files with 93 additions and 85 deletions

View File

@ -35,6 +35,13 @@
FT_Glyph_Name_Requester => FT_Face_GetGlyphNameFunc
FT_Name_Index_Requester => FT_Face_GetGlyphNameIndexFunc
* include/freetype/internal/psaux.h,
src/cid/cidload.c, src/cidtoken.h,
src/psaux/psobjs.c, src/psaux/psobjs.h, src/psaux/t1decode.c,
stc/type1/t1load.c, src/type1/t1tokens.h: updated common Postscript
type definitions
2002-03-13 Antoine Leca <antoine@oriolnet.com>
* include/freetype/config/ftoption.h: changed the automatic detection

View File

@ -114,15 +114,15 @@ FT_BEGIN_HEADER
/* */
typedef struct PS_TableRec_
{
FT_Byte* block; /* current memory block */
FT_Offset cursor; /* current cursor in memory block */
FT_Offset capacity; /* current size of memory block */
FT_Long init;
FT_Byte* block; /* current memory block */
FT_Offset cursor; /* current cursor in memory block */
FT_Offset capacity; /* current size of memory block */
FT_Long init;
FT_Int max_elems;
FT_Int num_elems;
FT_Byte** elements; /* addresses of table elements */
FT_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;
PS_Table_FuncsRec funcs;
@ -146,7 +146,7 @@ FT_BEGIN_HEADER
/* simple enumeration type used to identify token types */
typedef enum T1_Token_Type_
typedef enum T1_TokenType_
{
T1_TOKEN_TYPE_NONE = 0,
T1_TOKEN_TYPE_ANY,
@ -156,7 +156,7 @@ FT_BEGIN_HEADER
/* do not remove */
T1_TOKEN_TYPE_MAX
} T1_Token_Type;
} T1_TokenType;
/* a simple structure used to identify tokens */
@ -164,13 +164,13 @@ FT_BEGIN_HEADER
{
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_TokenType type; /* type of token */
} T1_TokenRec;
/* enumeration type used to identify object fields */
typedef enum T1_Field_Type_
typedef enum T1_FieldType_
{
T1_FIELD_TYPE_NONE = 0,
T1_FIELD_TYPE_BOOL,
@ -184,39 +184,39 @@ FT_BEGIN_HEADER
/* do not remove */
T1_FIELD_TYPE_MAX
} T1_Field_Type;
} T1_FieldType;
typedef enum T1_Field_Location_
typedef enum T1_FieldLocation_
{
t1_field_cid_info,
t1_field_font_dict,
t1_field_font_info,
t1_field_private,
T1_FIELD_LOCATION_CID_INFO,
T1_FIELD_LOCATION_FONT_DICT,
T1_FIELD_LOCATION_FONT_INFO,
T1_FIELD_LOCATION_PRIVATE,
/* do not remove */
t1_field_location_max
T1_FIELD_LOCATION_MAX
} T1_Field_Location;
} T1_FieldLocation;
typedef void
(*T1_Field_Parser)( FT_Face face,
FT_Pointer parser );
(*T1_Field_ParseFunc)( FT_Face face,
FT_Pointer parser );
/* structure type used to model object fields */
typedef struct T1_FieldRec_
{
const char* ident; /* field identifier */
T1_Field_Location location;
T1_Field_Type type; /* type of field */
T1_Field_Parser reader;
FT_UInt offset; /* offset of field in object */
FT_Byte size; /* size of field in bytes */
FT_UInt array_max; /* maximal number of elements for */
/* array */
FT_UInt count_offset; /* offset of element count for */
/* arrays */
const char* ident; /* field identifier */
T1_FieldLocation location;
T1_FieldType type; /* type of field */
T1_Field_ParseFunc reader;
FT_UInt offset; /* offset of field in object */
FT_Byte size; /* size of field in bytes */
FT_UInt array_max; /* maximal number of elements for */
/* array */
FT_UInt count_offset; /* offset of element count for */
/* arrays */
} T1_FieldRec;
@ -232,7 +232,7 @@ FT_BEGIN_HEADER
#define T1_NEW_CALLBACK_FIELD( _ident, _reader ) \
{ \
_ident, T1CODE, T1_FIELD_TYPE_CALLBACK, \
(T1_Field_Parser)_reader, \
(T1_Field_ParseFunc)_reader, \
0, 0, \
0, 0 \
},
@ -402,34 +402,34 @@ FT_BEGIN_HEADER
/*************************************************************************/
typedef struct T1_Builder_ T1_Builder;
typedef struct T1_BuilderRec_* T1_Builder;
typedef FT_Error
(*T1_Builder_Check_Points_Func)( T1_Builder* builder,
FT_Int count );
(*T1_Builder_Check_Points_Func)( T1_Builder builder,
FT_Int count );
typedef void
(*T1_Builder_Add_Point_Func)( T1_Builder* builder,
(*T1_Builder_Add_Point_Func)( T1_Builder builder,
FT_Pos x,
FT_Pos y,
FT_Byte flag );
typedef FT_Error
(*T1_Builder_Add_Point1_Func)( T1_Builder* builder,
(*T1_Builder_Add_Point1_Func)( T1_Builder builder,
FT_Pos x,
FT_Pos y );
typedef FT_Error
(*T1_Builder_Add_Contour_Func)( T1_Builder* builder );
(*T1_Builder_Add_Contour_Func)( T1_Builder builder );
typedef FT_Error
(*T1_Builder_Start_Point_Func)( T1_Builder* builder,
(*T1_Builder_Start_Point_Func)( T1_Builder builder,
FT_Pos x,
FT_Pos y );
typedef void
(*T1_Builder_Close_Contour_Func)( T1_Builder* builder );
(*T1_Builder_Close_Contour_Func)( T1_Builder builder );
typedef const struct T1_Builder_FuncsRec_* T1_Builder_Funcs;
@ -437,14 +437,14 @@ FT_BEGIN_HEADER
typedef struct T1_Builder_FuncsRec_
{
void
(*init)( T1_Builder* builder,
(*init)( T1_Builder builder,
FT_Face face,
FT_Size size,
FT_GlyphSlot slot,
FT_Bool hinting );
void
(*done)( T1_Builder* builder );
(*done)( T1_Builder builder );
T1_Builder_Check_Points_Func check_points;
T1_Builder_Add_Point_Func add_point;
@ -459,7 +459,7 @@ FT_BEGIN_HEADER
/*************************************************************************/
/* */
/* <Structure> */
/* T1_Builder */
/* T1_BuilderRec */
/* */
/* <Description> */
/* A structure used during glyph loading to store its outline. */
@ -512,7 +512,7 @@ FT_BEGIN_HEADER
/* */
/* funcs :: An array of function pointers for the builder. */
/* */
struct T1_Builder_
typedef struct T1_BuilderRec_
{
FT_Memory memory;
FT_Face face;
@ -545,7 +545,8 @@ FT_BEGIN_HEADER
void* hints_globals; /* hinter-specific */
T1_Builder_FuncsRec funcs;
};
} T1_BuilderRec;
/*************************************************************************/
@ -602,7 +603,7 @@ FT_BEGIN_HEADER
FT_Size size,
FT_GlyphSlot slot,
FT_Byte** glyph_names,
PS_Blend blend,
PS_Blend blend,
FT_Bool hinting,
T1_Decoder_Callback callback );
@ -619,7 +620,7 @@ FT_BEGIN_HEADER
typedef struct T1_DecoderRec_
{
T1_Builder builder;
T1_BuilderRec builder;
FT_Long stack[T1_MAX_CHARSTRINGS_OPERANDS];
FT_Long* top;
@ -643,7 +644,7 @@ FT_BEGIN_HEADER
FT_Int num_flex_vectors;
FT_Vector flex_vectors[7];
PS_Blend blend; /* for multiple master support */
PS_Blend blend; /* for multiple master support */
T1_Decoder_Callback parse_callback;
T1_Decoder_FuncsRec funcs;
@ -661,10 +662,10 @@ FT_BEGIN_HEADER
typedef struct PSAux_Interface_
{
const PS_Table_FuncsRec* ps_table_funcs;
const PS_Parser_FuncsRec* ps_parser_funcs;
const T1_Builder_FuncsRec* t1_builder_funcs;
const T1_Decoder_FuncsRec* t1_decoder_funcs;
const PS_Table_Funcs ps_table_funcs;
const PS_Parser_Funcs ps_parser_funcs;
const T1_Builder_Funcs t1_builder_funcs;
const T1_Decoder_Funcs t1_decoder_funcs;
void
(*t1_decrypt)( FT_Byte* buffer,

View File

@ -110,11 +110,11 @@
/* we must now compute the address of our target object */
switch ( keyword->location )
{
case t1_field_cid_info:
case T1_FIELD_LOCATION_CID_INFO:
object = (FT_Byte*)cid;
break;
case t1_field_font_info:
case T1_FIELD_LOCATION_FONT_INFO:
object = (FT_Byte*)&cid->font_info;
break;
@ -134,7 +134,7 @@
dict = cid->font_dicts + parser->num_dict;
switch ( keyword->location )
{
case t1_field_private:
case T1_FIELD_LOCATION_PRIVATE:
object = (FT_Byte*)&dict->private_dict;
break;
@ -278,7 +278,7 @@
T1_FIELD_CALLBACK( "FontBBox", parse_font_bbox )
T1_FIELD_CALLBACK( "FDArray", parse_fd_array )
T1_FIELD_CALLBACK( "FontMatrix", parse_font_matrix )
{ 0, t1_field_cid_info, T1_FIELD_TYPE_NONE, 0, 0, 0, 0, 0 }
{ 0, T1_FIELD_LOCATION_CID_INFO, T1_FIELD_TYPE_NONE, 0, 0, 0, 0, 0 }
};

View File

@ -19,7 +19,7 @@
#undef FT_STRUCTURE
#define FT_STRUCTURE CID_FaceInfoRec
#undef T1CODE
#define T1CODE t1_field_cid_info
#define T1CODE T1_FIELD_LOCATION_CID_INFO
T1_FIELD_STRING( "CIDFontName", cid_font_name )
T1_FIELD_NUM ( "CIDFontVersion", cid_version )
@ -37,7 +37,7 @@
#undef FT_STRUCTURE
#define FT_STRUCTURE PS_FontInfoRec
#undef T1CODE
#define T1CODE t1_field_font_info
#define T1CODE T1_FIELD_LOCATION_FONT_INFO
T1_FIELD_STRING( "version", version )
T1_FIELD_STRING( "Notice", notice )
@ -53,7 +53,7 @@
#undef FT_STRUCTURE
#define FT_STRUCTURE CID_FaceDictRec
#undef T1CODE
#define T1CODE t1_field_font_dict
#define T1CODE T1_FIELD_LOCATION_FONT_DICT
T1_FIELD_NUM ( "PaintType", paint_type )
T1_FIELD_NUM ( "FontType", font_type )
@ -69,7 +69,7 @@
#undef FT_STRUCTURE
#define FT_STRUCTURE PS_PrivateRec
#undef T1CODE
#define T1CODE t1_field_private
#define T1CODE T1_FIELD_LOCATION_PRIVATE
T1_FIELD_NUM ( "UniqueID", unique_id )
T1_FIELD_NUM ( "lenIV", lenIV )

View File

@ -133,7 +133,7 @@
/* PS_Table_Add */
/* */
/* <Description> */
/* Adds an object to a PS_TableRec, possibly growing its memory block. */
/* Adds an object to a PS_Table, possibly growing its memory block. */
/* */
/* <InOut> */
/* table :: The target table. */
@ -1071,7 +1071,7 @@
/* glyph :: The current glyph object. */
/* */
FT_LOCAL_DEF( void )
T1_Builder_Init( T1_Builder* builder,
T1_Builder_Init( T1_Builder builder,
FT_Face face,
FT_Size size,
FT_GlyphSlot glyph,
@ -1133,7 +1133,7 @@
/* builder :: A pointer to the glyph builder to finalize. */
/* */
FT_LOCAL_DEF( void )
T1_Builder_Done( T1_Builder* builder )
T1_Builder_Done( T1_Builder builder )
{
FT_GlyphSlot glyph = builder->glyph;
@ -1145,7 +1145,7 @@
/* check that there is enough room for `count' more points */
FT_LOCAL_DEF( FT_Error )
T1_Builder_Check_Points( T1_Builder* builder,
T1_Builder_Check_Points( T1_Builder builder,
FT_Int count )
{
return FT_GlyphLoader_Check_Points( builder->loader, count, 0 );
@ -1154,7 +1154,7 @@
/* add a new point, do not check space */
FT_LOCAL_DEF( void )
T1_Builder_Add_Point( T1_Builder* builder,
T1_Builder_Add_Point( T1_Builder builder,
FT_Pos x,
FT_Pos y,
FT_Byte flag )
@ -1185,7 +1185,7 @@
/* check space for a new on-curve point, then add it */
FT_LOCAL_DEF( FT_Error )
T1_Builder_Add_Point1( T1_Builder* builder,
T1_Builder_Add_Point1( T1_Builder builder,
FT_Pos x,
FT_Pos y )
{
@ -1202,7 +1202,7 @@
/* check room for a new contour, then add it */
FT_LOCAL_DEF( FT_Error )
T1_Builder_Add_Contour( T1_Builder* builder )
T1_Builder_Add_Contour( T1_Builder builder )
{
FT_Outline* outline = builder->current;
FT_Error error;
@ -1230,7 +1230,7 @@
/* if a path was begun, add its first on-curve point */
FT_LOCAL_DEF( FT_Error )
T1_Builder_Start_Point( T1_Builder* builder,
T1_Builder_Start_Point( T1_Builder builder,
FT_Pos x,
FT_Pos y )
{
@ -1251,7 +1251,7 @@
/* close the current contour */
FT_LOCAL_DEF( void )
T1_Builder_Close_Contour( T1_Builder* builder )
T1_Builder_Close_Contour( T1_Builder builder )
{
FT_Outline* outline = builder->current;

View File

@ -144,42 +144,42 @@ FT_BEGIN_HEADER
/*************************************************************************/
FT_LOCAL( void )
T1_Builder_Init( T1_Builder* builder,
T1_Builder_Init( T1_Builder builder,
FT_Face face,
FT_Size size,
FT_GlyphSlot glyph,
FT_Bool hinting );
FT_LOCAL( void )
T1_Builder_Done( T1_Builder* builder );
T1_Builder_Done( T1_Builder builder );
FT_LOCAL( FT_Error )
T1_Builder_Check_Points( T1_Builder* builder,
T1_Builder_Check_Points( T1_Builder builder,
FT_Int count );
FT_LOCAL( void )
T1_Builder_Add_Point( T1_Builder* builder,
T1_Builder_Add_Point( T1_Builder builder,
FT_Pos x,
FT_Pos y,
FT_Byte flag );
FT_LOCAL( FT_Error )
T1_Builder_Add_Point1( T1_Builder* builder,
T1_Builder_Add_Point1( T1_Builder builder,
FT_Pos x,
FT_Pos y );
FT_LOCAL( FT_Error )
T1_Builder_Add_Contour( T1_Builder* builder );
T1_Builder_Add_Contour( T1_Builder builder );
FT_LOCAL( FT_Error )
T1_Builder_Start_Point( T1_Builder* builder,
T1_Builder_Start_Point( T1_Builder builder,
FT_Pos x,
FT_Pos y );
FT_LOCAL( void )
T1_Builder_Close_Contour( T1_Builder* builder );
T1_Builder_Close_Contour( T1_Builder builder );
/*************************************************************************/

View File

@ -339,7 +339,7 @@
T1_Decoder_Zone zone;
FT_Byte* ip;
FT_Byte* limit;
T1_Builder* builder = &decoder->builder;
T1_Builder builder = &decoder->builder;
FT_Pos x, y, orig_x, orig_y;
T1_Hints_Funcs hinter;

View File

@ -713,7 +713,7 @@
/* we are now going to take care of it */
switch ( field->location )
{
case t1_field_font_info:
case T1_FIELD_LOCATION_FONT_INFO:
dummy_object = &face->type1.font_info;
objects = &dummy_object;
max_objects = 0;
@ -725,7 +725,7 @@
}
break;
case t1_field_private:
case T1_FIELD_LOCATION_PRIVATE:
dummy_object = &face->type1.private_dict;
objects = &dummy_object;
max_objects = 0;
@ -1478,7 +1478,7 @@
T1_FIELD_CALLBACK( "shareddict", parse_shared_dict )
#endif
{ 0, t1_field_cid_info, T1_FIELD_TYPE_NONE, 0, 0, 0, 0, 0 }
{ 0, T1_FIELD_LOCATION_CID_INFO, T1_FIELD_TYPE_NONE, 0, 0, 0, 0, 0 }
};

View File

@ -19,7 +19,7 @@
#undef FT_STRUCTURE
#define FT_STRUCTURE PS_FontInfoRec
#undef T1CODE
#define T1CODE t1_field_font_info
#define T1CODE T1_FIELD_LOCATION_FONT_INFO
T1_FIELD_STRING( "version", version )
T1_FIELD_STRING( "Notice", notice )
@ -36,7 +36,7 @@
#undef FT_STRUCTURE
#define FT_STRUCTURE PS_PrivateRec
#undef T1CODE
#define T1CODE t1_field_private
#define T1CODE T1_FIELD_LOCATION_PRIVATE
T1_FIELD_NUM ( "UniqueID", unique_id )
T1_FIELD_NUM ( "lenIV", lenIV )
@ -63,7 +63,7 @@
#undef FT_STRUCTURE
#define FT_STRUCTURE T1_FontRec
#undef T1CODE
#define T1CODE t1_field_font_dict
#define T1CODE T1_FIELD_LOCATION_FONT_DICT
T1_FIELD_NUM( "PaintType", paint_type )
T1_FIELD_NUM( "FontType", font_type )