* renaming stream macros. Examples:
FILE_Skip => FT_STREAM_SKIP FILE_Read => FT_STREAM_READ ACCESS_Frame => FT_FRAME_ENTER FORGET_Frame => FT_FRAME_EXIT etc...
This commit is contained in:
parent
de388f501f
commit
5cff1134e9
10
ChangeLog
10
ChangeLog
|
@ -1,5 +1,15 @@
|
|||
2002-03-20 David Turner <david@freetype.org>
|
||||
|
||||
* renaming stream macros. Examples:
|
||||
|
||||
FILE_Skip => FT_STREAM_SKIP
|
||||
FILE_Read => FT_STREAM_READ
|
||||
ACCESS_Frame => FT_FRAME_ENTER
|
||||
FORGET_Frame => FT_FRAME_EXIT
|
||||
etc...
|
||||
|
||||
* src/sfnt/sfdriver.c (get_sfnt_postscript_name): fixed memory leak
|
||||
|
||||
* include/freetype/internal/ftobjs.h: changing the definition of
|
||||
FT_CMap_CharNextFunc slightly
|
||||
|
||||
|
|
|
@ -265,38 +265,38 @@ FT_BEGIN_HEADER
|
|||
/* */
|
||||
#define FT_GET_MACRO( func, type ) ( (type)func( stream ) )
|
||||
|
||||
#define GET_Char() FT_GET_MACRO( FT_Stream_Get_Char, FT_Char )
|
||||
#define GET_Byte() FT_GET_MACRO( FT_Stream_Get_Char, FT_Byte )
|
||||
#define GET_Short() FT_GET_MACRO( FT_Stream_Get_Short, FT_Short )
|
||||
#define GET_UShort() FT_GET_MACRO( FT_Stream_Get_Short, FT_UShort )
|
||||
#define GET_Offset() FT_GET_MACRO( FT_Stream_Get_Offset, FT_Long )
|
||||
#define GET_UOffset() FT_GET_MACRO( FT_Stream_Get_Offset, FT_ULong )
|
||||
#define GET_Long() FT_GET_MACRO( FT_Stream_Get_Long, FT_Long )
|
||||
#define GET_ULong() FT_GET_MACRO( FT_Stream_Get_Long, FT_ULong )
|
||||
#define GET_Tag4() FT_GET_MACRO( FT_Stream_Get_Long, FT_ULong )
|
||||
#define GET_Char() FT_GET_MACRO( FT_Stream_GetChar, FT_Char )
|
||||
#define GET_Byte() FT_GET_MACRO( FT_Stream_GetChar, FT_Byte )
|
||||
#define GET_Short() FT_GET_MACRO( FT_Stream_GetShort, FT_Short )
|
||||
#define GET_UShort() FT_GET_MACRO( FT_Stream_GetShort, FT_UShort )
|
||||
#define GET_Offset() FT_GET_MACRO( FT_Stream_GetOffset, FT_Long )
|
||||
#define GET_UOffset() FT_GET_MACRO( FT_Stream_GetOffset, FT_ULong )
|
||||
#define GET_Long() FT_GET_MACRO( FT_Stream_GetLong, FT_Long )
|
||||
#define GET_ULong() FT_GET_MACRO( FT_Stream_GetLong, FT_ULong )
|
||||
#define GET_Tag4() FT_GET_MACRO( FT_Stream_GetLong, FT_ULong )
|
||||
|
||||
#define GET_ShortLE() FT_GET_MACRO( FT_Stream_Get_ShortLE, FT_Short )
|
||||
#define GET_UShortLE() FT_GET_MACRO( FT_Stream_Get_ShortLE, FT_UShort )
|
||||
#define GET_LongLE() FT_GET_MACRO( FT_Stream_Get_LongLE, FT_Long )
|
||||
#define GET_ULongLE() FT_GET_MACRO( FT_Stream_Get_LongLE, FT_ULong )
|
||||
#define GET_ShortLE() FT_GET_MACRO( FT_Stream_GetShortLE, FT_Short )
|
||||
#define GET_UShortLE() FT_GET_MACRO( FT_Stream_GetShortLE, FT_UShort )
|
||||
#define GET_LongLE() FT_GET_MACRO( FT_Stream_GetLongLE, FT_Long )
|
||||
#define GET_ULongLE() FT_GET_MACRO( FT_Stream_GetLongLE, FT_ULong )
|
||||
|
||||
#define FT_READ_MACRO( func, type, var ) \
|
||||
( var = (type)func( stream, &error ), \
|
||||
error != FT_Err_Ok )
|
||||
|
||||
#define READ_Byte( var ) FT_READ_MACRO( FT_Stream_Read_Char, FT_Byte, var )
|
||||
#define READ_Char( var ) FT_READ_MACRO( FT_Stream_Read_Char, FT_Char, var )
|
||||
#define READ_Short( var ) FT_READ_MACRO( FT_Stream_Read_Short, FT_Short, var )
|
||||
#define READ_UShort( var ) FT_READ_MACRO( FT_Stream_Read_Short, FT_UShort, var )
|
||||
#define READ_Offset( var ) FT_READ_MACRO( FT_Stream_Read_Offset, FT_Long, var )
|
||||
#define READ_UOffset( var ) FT_READ_MACRO( FT_Stream_Read_Offset, FT_ULong, var )
|
||||
#define READ_Long( var ) FT_READ_MACRO( FT_Stream_Read_Long, FT_Long, var )
|
||||
#define READ_ULong( var ) FT_READ_MACRO( FT_Stream_Read_Long, FT_ULong, var )
|
||||
#define READ_Byte( var ) FT_READ_MACRO( FT_Stream_ReadChar, FT_Byte, var )
|
||||
#define READ_Char( var ) FT_READ_MACRO( FT_Stream_ReadChar, FT_Char, var )
|
||||
#define READ_Short( var ) FT_READ_MACRO( FT_Stream_ReadShort, FT_Short, var )
|
||||
#define READ_UShort( var ) FT_READ_MACRO( FT_Stream_ReadShort, FT_UShort, var )
|
||||
#define READ_Offset( var ) FT_READ_MACRO( FT_Stream_ReadOffset, FT_Long, var )
|
||||
#define READ_UOffset( var ) FT_READ_MACRO( FT_Stream_ReadOffset, FT_ULong, var )
|
||||
#define READ_Long( var ) FT_READ_MACRO( FT_Stream_ReadLong, FT_Long, var )
|
||||
#define READ_ULong( var ) FT_READ_MACRO( FT_Stream_ReadLong, FT_ULong, var )
|
||||
|
||||
#define READ_ShortLE( var ) FT_READ_MACRO( FT_Stream_Read_ShortLE, FT_Short, var )
|
||||
#define READ_UShortLE( var ) FT_READ_MACRO( FT_Stream_Read_ShortLE, FT_UShort, var )
|
||||
#define READ_LongLE( var ) FT_READ_MACRO( FT_Stream_Read_LongLE, FT_Long, var )
|
||||
#define READ_ULongLE( var ) FT_READ_MACRO( FT_Stream_Read_LongLE, FT_ULong, var )
|
||||
#define READ_ShortLE( var ) FT_READ_MACRO( FT_Stream_ReadShortLE, FT_Short, var )
|
||||
#define READ_UShortLE( var ) FT_READ_MACRO( FT_Stream_ReadShortLE, FT_UShort, var )
|
||||
#define READ_LongLE( var ) FT_READ_MACRO( FT_Stream_ReadLongLE, FT_Long, var )
|
||||
#define READ_ULongLE( var ) FT_READ_MACRO( FT_Stream_ReadLongLE, FT_ULong, var )
|
||||
|
||||
|
||||
|
||||
|
@ -313,9 +313,9 @@ FT_BEGIN_HEADER
|
|||
|
||||
/* initialize a stream for reading in-memory data */
|
||||
FT_BASE( void )
|
||||
FT_Stream_Open_Memory( FT_Stream stream,
|
||||
const FT_Byte* base,
|
||||
FT_ULong size );
|
||||
FT_Stream_OpenMemory( FT_Stream stream,
|
||||
const FT_Byte* base,
|
||||
FT_ULong size );
|
||||
|
||||
/* close a stream (does not destroy the stream structure) */
|
||||
FT_BASE( void )
|
||||
|
@ -346,27 +346,27 @@ FT_BEGIN_HEADER
|
|||
|
||||
/* read bytes from a stream at a given position */
|
||||
FT_BASE( FT_Error )
|
||||
FT_Stream_Read_At( FT_Stream stream,
|
||||
FT_ULong pos,
|
||||
FT_Byte* buffer,
|
||||
FT_ULong count );
|
||||
FT_Stream_ReadAt( FT_Stream stream,
|
||||
FT_ULong pos,
|
||||
FT_Byte* buffer,
|
||||
FT_ULong count );
|
||||
|
||||
/* enter a frame of 'count' consecutive bytes in a stream. returns an */
|
||||
/* error if the frame could not be read/accessed. The caller can use */
|
||||
/* the FT_Stream_Get_XXX function to retrieve frame data without */
|
||||
/* error checks.. */
|
||||
/* */
|
||||
/* you must _always_ call FT_Stream_Exit_Frame once you've entered */
|
||||
/* you must _always_ call FT_Stream_ExitFrame once you've entered */
|
||||
/* a stream frame !! */
|
||||
/* */
|
||||
FT_BASE( FT_Error )
|
||||
FT_Stream_Enter_Frame( FT_Stream stream,
|
||||
FT_ULong count );
|
||||
FT_Stream_EnterFrame( FT_Stream stream,
|
||||
FT_ULong count );
|
||||
|
||||
/* exit a stream frame.. */
|
||||
/* */
|
||||
FT_BASE( void )
|
||||
FT_Stream_Exit_Frame( FT_Stream stream );
|
||||
FT_Stream_ExitFrame( FT_Stream stream );
|
||||
|
||||
/* extract a stream frame. if the stream is disk-based, a heap block */
|
||||
/* is allocated and the frame bytes are read into it. if the stream */
|
||||
|
@ -375,126 +375,119 @@ FT_BEGIN_HEADER
|
|||
/* useful to optimize access to memory-based streams transparently. */
|
||||
/* */
|
||||
/* all extracted frames must be "freed" with a call to the function */
|
||||
/* FT_Stream_Release_Frame */
|
||||
/* FT_Stream_ReleaseFrame */
|
||||
/* */
|
||||
FT_BASE( FT_Error )
|
||||
FT_Stream_Extract_Frame( FT_Stream stream,
|
||||
FT_ULong count,
|
||||
FT_Byte** pbytes );
|
||||
FT_Stream_ExtractFrame( FT_Stream stream,
|
||||
FT_ULong count,
|
||||
FT_Byte** pbytes );
|
||||
|
||||
/* release an extract frame (see FT_Stream_Extract_Frame) */
|
||||
/* release an extract frame (see FT_Stream_ExtractFrame) */
|
||||
/* */
|
||||
FT_BASE( void )
|
||||
FT_Stream_Release_Frame( FT_Stream stream,
|
||||
FT_Byte** pbytes );
|
||||
|
||||
FT_Stream_ReleaseFrame( FT_Stream stream,
|
||||
FT_Byte** pbytes );
|
||||
|
||||
/* read a byte from an entered frame */
|
||||
FT_BASE( FT_Char )
|
||||
FT_Stream_Get_Char( FT_Stream stream );
|
||||
FT_Stream_GetChar( FT_Stream stream );
|
||||
|
||||
/* read a 16-bit big-endian integer from an entered frame */
|
||||
FT_BASE( FT_Short )
|
||||
FT_Stream_Get_Short( FT_Stream stream );
|
||||
FT_Stream_GetShort( FT_Stream stream );
|
||||
|
||||
/* read a 24-bit big-endian integer from an entered frame */
|
||||
FT_BASE( FT_Long )
|
||||
FT_Stream_Get_Offset( FT_Stream stream );
|
||||
FT_Stream_GetOffset( FT_Stream stream );
|
||||
|
||||
/* read a 32-bit big-endian integer from an entered frame */
|
||||
FT_BASE( FT_Long )
|
||||
FT_Stream_Get_Long( FT_Stream stream );
|
||||
FT_Stream_GetLong( FT_Stream stream );
|
||||
|
||||
/* read a 16-bit little-endian integer from an entered frame */
|
||||
FT_BASE( FT_Short )
|
||||
FT_Stream_Get_ShortLE( FT_Stream stream );
|
||||
FT_Stream_GetShortLE( FT_Stream stream );
|
||||
|
||||
/* read a 32-bit little-endian integer from an entered frame */
|
||||
FT_BASE( FT_Long )
|
||||
FT_Stream_Get_LongLE( FT_Stream stream );
|
||||
FT_Stream_GetLongLE( FT_Stream stream );
|
||||
|
||||
|
||||
/* read a byte from a stream */
|
||||
FT_BASE( FT_Char )
|
||||
FT_Stream_Read_Char( FT_Stream stream,
|
||||
FT_Error* error );
|
||||
FT_Stream_ReadChar( FT_Stream stream,
|
||||
FT_Error* error );
|
||||
|
||||
/* read a 16-bit big-endian integer from a stream */
|
||||
FT_BASE( FT_Short )
|
||||
FT_Stream_Read_Short( FT_Stream stream,
|
||||
FT_Error* error );
|
||||
FT_Stream_ReadShort( FT_Stream stream,
|
||||
FT_Error* error );
|
||||
|
||||
/* read a 24-bit big-endian integer from a stream */
|
||||
FT_BASE( FT_Long )
|
||||
FT_Stream_Read_Offset( FT_Stream stream,
|
||||
FT_Error* error );
|
||||
FT_Stream_ReadOffset( FT_Stream stream,
|
||||
FT_Error* error );
|
||||
|
||||
/* read a 32-bit big-endian integer from a stream */
|
||||
FT_BASE( FT_Long )
|
||||
FT_Stream_Read_Long( FT_Stream stream,
|
||||
FT_Error* error );
|
||||
FT_Stream_ReadLong( FT_Stream stream,
|
||||
FT_Error* error );
|
||||
|
||||
/* read a 16-bit little-endian integer from a stream */
|
||||
FT_BASE( FT_Short )
|
||||
FT_Stream_Read_ShortLE( FT_Stream stream,
|
||||
FT_Error* error );
|
||||
FT_Stream_ReadShortLE( FT_Stream stream,
|
||||
FT_Error* error );
|
||||
|
||||
/* read a 32-bit little-endian integer from a stream */
|
||||
FT_BASE( FT_Long )
|
||||
FT_Stream_Read_LongLE( FT_Stream stream,
|
||||
FT_Error* error );
|
||||
FT_Stream_ReadLongLE( FT_Stream stream,
|
||||
FT_Error* error );
|
||||
|
||||
/* read a structure from a stream. The structure must be described */
|
||||
/* by an array of FT_Frame_Field records.. */
|
||||
FT_BASE( FT_Error )
|
||||
FT_Stream_Read_Fields( FT_Stream stream,
|
||||
const FT_Frame_Field* fields,
|
||||
void* structure );
|
||||
FT_Stream_ReadFields( FT_Stream stream,
|
||||
const FT_Frame_Field* fields,
|
||||
void* structure );
|
||||
|
||||
|
||||
|
||||
|
||||
#define USE_Stream( resource, stream ) \
|
||||
FT_SET_ERROR( FT_Open_Stream( resource, stream ) )
|
||||
|
||||
#define DONE_Stream( stream ) \
|
||||
FT_Stream_Close( stream )
|
||||
|
||||
|
||||
#define ACCESS_Frame( size ) \
|
||||
FT_SET_ERROR( FT_Stream_Enter_Frame( stream, size ) )
|
||||
|
||||
#define FORGET_Frame() \
|
||||
FT_Stream_Exit_Frame( stream )
|
||||
|
||||
#define EXTRACT_Frame( size, bytes ) \
|
||||
FT_SET_ERROR( FT_Stream_Extract_Frame( stream, size, \
|
||||
(FT_Byte**)&(bytes) ) )
|
||||
|
||||
#define RELEASE_Frame( bytes ) \
|
||||
FT_Stream_Release_Frame( stream, (FT_Byte**)&(bytes) )
|
||||
|
||||
#define FILE_Seek( position ) \
|
||||
FT_SET_ERROR( FT_Stream_Seek( stream, position ) )
|
||||
|
||||
#define FILE_Skip( distance ) \
|
||||
FT_SET_ERROR( FT_Stream_Skip( stream, distance ) )
|
||||
|
||||
#define FILE_Pos() \
|
||||
#define FT_STREAM_POS() \
|
||||
FT_Stream_Pos( stream )
|
||||
|
||||
#define FILE_Read( buffer, count ) \
|
||||
FT_SET_ERROR( FT_Stream_Read( stream, \
|
||||
(FT_Byte*)buffer, \
|
||||
#define FT_STREAM_SEEK( position ) \
|
||||
FT_SET_ERROR( FT_Stream_Seek( stream, position ) )
|
||||
|
||||
#define FT_STREAM_SKIP( distance ) \
|
||||
FT_SET_ERROR( FT_Stream_Skip( stream, distance ) )
|
||||
|
||||
#define FT_STREAM_READ( buffer, count ) \
|
||||
FT_SET_ERROR( FT_Stream_Read( stream, \
|
||||
(FT_Byte*)buffer, \
|
||||
count ) )
|
||||
|
||||
#define FILE_Read_At( position, buffer, count ) \
|
||||
FT_SET_ERROR( FT_Stream_Read_At( stream, \
|
||||
#define FT_STREAM_READ_AT( position, buffer, count ) \
|
||||
FT_SET_ERROR( FT_Stream_ReadAt( stream, \
|
||||
position, \
|
||||
(FT_Byte*)buffer, \
|
||||
count ) )
|
||||
|
||||
#define READ_Fields( fields, object ) \
|
||||
( ( error = FT_Stream_Read_Fields( stream, fields, object ) ) != FT_Err_Ok )
|
||||
#define FT_STREAM_READ_FIELDS( fields, object ) \
|
||||
FT_SET_ERROR( FT_Stream_ReadFields( stream, fields, object ) )
|
||||
|
||||
|
||||
#define FT_FRAME_ENTER( size ) \
|
||||
FT_SET_ERROR( FT_Stream_EnterFrame( stream, size ) )
|
||||
|
||||
#define FT_FRAME_EXIT() \
|
||||
FT_Stream_ExitFrame( stream )
|
||||
|
||||
#define FT_FRAME_EXTRACT( size, bytes ) \
|
||||
FT_SET_ERROR( FT_Stream_ExtractFrame( stream, size, \
|
||||
(FT_Byte**)&(bytes) ) )
|
||||
|
||||
#define FT_FRAME_RELEASE( bytes ) \
|
||||
FT_Stream_ReleaseFrame( stream, (FT_Byte**)&(bytes) )
|
||||
|
||||
|
||||
|
||||
FT_END_HEADER
|
||||
|
|
|
@ -1220,8 +1220,8 @@ FT_BEGIN_HEADER
|
|||
/* FreeType error code. 0 means success. */
|
||||
/* */
|
||||
/* <Note> */
|
||||
/* This function is normally equivalent to FILE_Seek(offset) */
|
||||
/* followed by ACCESS_Frame(byte_count) with the loader's stream, but */
|
||||
/* This function is normally equivalent to FT_STREAM_SEEK(offset) */
|
||||
/* followed by FT_FRAME_ENTER(byte_count) with the loader's stream, but */
|
||||
/* alternative formats (e.g. compressed ones) might use something */
|
||||
/* different. */
|
||||
/* */
|
||||
|
|
2000
src/base/ftapi.c
2000
src/base/ftapi.c
File diff suppressed because it is too large
Load Diff
|
@ -69,9 +69,9 @@
|
|||
if ( args->flags & ft_open_memory )
|
||||
{
|
||||
/* create a memory-based stream */
|
||||
FT_Stream_Open_Memory( stream,
|
||||
(FT_Byte*)args->memory_base,
|
||||
args->memory_size );
|
||||
FT_Stream_OpenMemory( stream,
|
||||
(const FT_Byte*)args->memory_base,
|
||||
args->memory_size );
|
||||
}
|
||||
else if ( args->flags & ft_open_pathname )
|
||||
{
|
||||
|
|
|
@ -32,9 +32,9 @@
|
|||
|
||||
|
||||
FT_BASE_DEF( void )
|
||||
FT_Stream_Open_Memory( FT_Stream stream,
|
||||
const FT_Byte* base,
|
||||
FT_ULong size )
|
||||
FT_Stream_OpenMemory( FT_Stream stream,
|
||||
const FT_Byte* base,
|
||||
FT_ULong size )
|
||||
{
|
||||
stream->base = (FT_Byte*) base;
|
||||
stream->size = size;
|
||||
|
@ -60,7 +60,7 @@
|
|||
FT_Stream_Seek( FT_Stream stream,
|
||||
FT_ULong pos )
|
||||
{
|
||||
FT_Error error;
|
||||
FT_Error error = FT_Err_Ok;
|
||||
|
||||
|
||||
stream->pos = pos;
|
||||
|
@ -69,28 +69,21 @@
|
|||
{
|
||||
if ( stream->read( stream, pos, 0, 0 ) )
|
||||
{
|
||||
FT_ERROR(( "FT_Stream_Seek:" ));
|
||||
FT_ERROR(( " invalid i/o; pos = 0x%lx, size = 0x%lx\n",
|
||||
pos, stream->size ));
|
||||
FT_ERROR(( "%s: invalid i/o; pos = 0x%lx, size = 0x%lx\n",
|
||||
"FT_Stream_Seek", pos, stream->size ));
|
||||
|
||||
error = FT_Err_Invalid_Stream_Operation;
|
||||
}
|
||||
else
|
||||
error = FT_Err_Ok;
|
||||
}
|
||||
/* note that seeking to the first position after the file is valid */
|
||||
else if ( pos > stream->size )
|
||||
{
|
||||
FT_ERROR(( "FT_Stream_Seek:" ));
|
||||
FT_ERROR(( " invalid i/o; pos = 0x%lx, size = 0x%lx\n",
|
||||
pos, stream->size ));
|
||||
FT_ERROR(( "%s: invalid i/o; pos = 0x%lx, size = 0x%lx\n",
|
||||
"FT_Stream_Seek", pos, stream->size ));
|
||||
|
||||
error = FT_Err_Invalid_Stream_Operation;
|
||||
}
|
||||
|
||||
else
|
||||
error = FT_Err_Ok;
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
|
@ -115,15 +108,15 @@
|
|||
FT_Byte* buffer,
|
||||
FT_ULong count )
|
||||
{
|
||||
return FT_Stream_Read_At( stream, stream->pos, buffer, count );
|
||||
return FT_Stream_ReadAt( stream, stream->pos, buffer, count );
|
||||
}
|
||||
|
||||
|
||||
FT_BASE_DEF( FT_Error )
|
||||
FT_Stream_Read_At( FT_Stream stream,
|
||||
FT_ULong pos,
|
||||
FT_Byte* buffer,
|
||||
FT_ULong count )
|
||||
FT_Stream_ReadAt( FT_Stream stream,
|
||||
FT_ULong pos,
|
||||
FT_Byte* buffer,
|
||||
FT_ULong count )
|
||||
{
|
||||
FT_Error error = FT_Err_Ok;
|
||||
FT_ULong read_bytes;
|
||||
|
@ -131,9 +124,8 @@
|
|||
|
||||
if ( pos >= stream->size )
|
||||
{
|
||||
FT_ERROR(( "FT_Stream_Read_At:" ));
|
||||
FT_ERROR(( " invalid i/o; pos = 0x%lx, size = 0x%lx\n",
|
||||
pos, stream->size ));
|
||||
FT_ERROR(( "%s: invalid i/o; pos = 0x%lx, size = 0x%lx\n",
|
||||
"FT_Stream_ReadAt", pos, stream->size ));
|
||||
|
||||
return FT_Err_Invalid_Stream_Operation;
|
||||
}
|
||||
|
@ -153,9 +145,8 @@
|
|||
|
||||
if ( read_bytes < count )
|
||||
{
|
||||
FT_ERROR(( "FT_Stream_Read_At:" ));
|
||||
FT_ERROR(( " invalid read; expected %lu bytes, got %lu\n",
|
||||
count, read_bytes ));
|
||||
FT_ERROR(( "%s: invalid read; expected %lu bytes, got %lu\n",
|
||||
"FT_Stream_ReadAt", count, read_bytes ));
|
||||
|
||||
error = FT_Err_Invalid_Stream_Operation;
|
||||
}
|
||||
|
@ -165,19 +156,19 @@
|
|||
|
||||
|
||||
FT_BASE_DEF( FT_Error )
|
||||
FT_Stream_Extract_Frame( FT_Stream stream,
|
||||
FT_ULong count,
|
||||
FT_Byte** pbytes )
|
||||
FT_Stream_ExtractFrame( FT_Stream stream,
|
||||
FT_ULong count,
|
||||
FT_Byte** pbytes )
|
||||
{
|
||||
FT_Error error;
|
||||
|
||||
|
||||
error = FT_Stream_Enter_Frame( stream, count );
|
||||
error = FT_Stream_EnterFrame( stream, count );
|
||||
if ( !error )
|
||||
{
|
||||
*pbytes = (FT_Byte*)stream->cursor;
|
||||
|
||||
/* equivalent to FT_Stream_Exit_Frame(), with no memory block release */
|
||||
/* equivalent to FT_Stream_ExitFrame(), with no memory block release */
|
||||
stream->cursor = 0;
|
||||
stream->limit = 0;
|
||||
}
|
||||
|
@ -187,8 +178,8 @@
|
|||
|
||||
|
||||
FT_BASE_DEF( void )
|
||||
FT_Stream_Release_Frame( FT_Stream stream,
|
||||
FT_Byte** pbytes )
|
||||
FT_Stream_ReleaseFrame( FT_Stream stream,
|
||||
FT_Byte** pbytes )
|
||||
{
|
||||
if ( stream->read )
|
||||
{
|
||||
|
@ -202,8 +193,8 @@
|
|||
|
||||
|
||||
FT_BASE_DEF( FT_Error )
|
||||
FT_Stream_Enter_Frame( FT_Stream stream,
|
||||
FT_ULong count )
|
||||
FT_Stream_EnterFrame( FT_Stream stream,
|
||||
FT_ULong count )
|
||||
{
|
||||
FT_Error error = FT_Err_Ok;
|
||||
FT_ULong read_bytes;
|
||||
|
@ -226,7 +217,7 @@
|
|||
stream->base, count );
|
||||
if ( read_bytes < count )
|
||||
{
|
||||
FT_ERROR(( "FT_Stream_Enter_Frame:" ));
|
||||
FT_ERROR(( "FT_Stream_EnterFrame:" ));
|
||||
FT_ERROR(( " invalid read; expected %lu bytes, got %lu\n",
|
||||
count, read_bytes ));
|
||||
|
||||
|
@ -243,7 +234,7 @@
|
|||
if ( stream->pos >= stream->size ||
|
||||
stream->pos + count > stream->size )
|
||||
{
|
||||
FT_ERROR(( "FT_Stream_Enter_Frame:" ));
|
||||
FT_ERROR(( "FT_Stream_EnterFrame:" ));
|
||||
FT_ERROR(( " invalid i/o; pos = 0x%lx, count = %lu, size = 0x%lx\n",
|
||||
stream->pos, count, stream->size ));
|
||||
|
||||
|
@ -263,7 +254,7 @@
|
|||
|
||||
|
||||
FT_BASE_DEF( void )
|
||||
FT_Stream_Exit_Frame( FT_Stream stream )
|
||||
FT_Stream_ExitFrame( FT_Stream stream )
|
||||
{
|
||||
/* IMPORTANT: The assertion stream->cursor != 0 was removed, given */
|
||||
/* that it is possible to access a frame of length 0 in */
|
||||
|
@ -272,7 +263,7 @@
|
|||
/* */
|
||||
/* In this case, the loader code handles the 0-length table */
|
||||
/* gracefully; however, stream.cursor is really set to 0 by the */
|
||||
/* FT_Stream_Enter_Frame() call, and this is not an error. */
|
||||
/* FT_Stream_EnterFrame() call, and this is not an error. */
|
||||
/* */
|
||||
FT_ASSERT( stream );
|
||||
|
||||
|
@ -289,7 +280,7 @@
|
|||
|
||||
|
||||
FT_BASE_DEF( FT_Char )
|
||||
FT_Stream_Get_Char( FT_Stream stream )
|
||||
FT_Stream_GetChar( FT_Stream stream )
|
||||
{
|
||||
FT_Char result;
|
||||
|
||||
|
@ -305,7 +296,7 @@
|
|||
|
||||
|
||||
FT_BASE_DEF( FT_Short )
|
||||
FT_Stream_Get_Short( FT_Stream stream )
|
||||
FT_Stream_GetShort( FT_Stream stream )
|
||||
{
|
||||
FT_Byte* p;
|
||||
FT_Short result;
|
||||
|
@ -324,7 +315,7 @@
|
|||
|
||||
|
||||
FT_BASE_DEF( FT_Short )
|
||||
FT_Stream_Get_ShortLE( FT_Stream stream )
|
||||
FT_Stream_GetShortLE( FT_Stream stream )
|
||||
{
|
||||
FT_Byte* p;
|
||||
FT_Short result;
|
||||
|
@ -343,7 +334,7 @@
|
|||
|
||||
|
||||
FT_BASE_DEF( FT_Long )
|
||||
FT_Stream_Get_Offset( FT_Stream stream )
|
||||
FT_Stream_GetOffset( FT_Stream stream )
|
||||
{
|
||||
FT_Byte* p;
|
||||
FT_Long result;
|
||||
|
@ -361,7 +352,7 @@
|
|||
|
||||
|
||||
FT_BASE_DEF( FT_Long )
|
||||
FT_Stream_Get_Long( FT_Stream stream )
|
||||
FT_Stream_GetLong( FT_Stream stream )
|
||||
{
|
||||
FT_Byte* p;
|
||||
FT_Long result;
|
||||
|
@ -379,7 +370,7 @@
|
|||
|
||||
|
||||
FT_BASE_DEF( FT_Long )
|
||||
FT_Stream_Get_LongLE( FT_Stream stream )
|
||||
FT_Stream_GetLongLE( FT_Stream stream )
|
||||
{
|
||||
FT_Byte* p;
|
||||
FT_Long result;
|
||||
|
@ -397,8 +388,8 @@
|
|||
|
||||
|
||||
FT_BASE_DEF( FT_Char )
|
||||
FT_Stream_Read_Char( FT_Stream stream,
|
||||
FT_Error* error )
|
||||
FT_Stream_ReadChar( FT_Stream stream,
|
||||
FT_Error* error )
|
||||
{
|
||||
FT_Byte result = 0;
|
||||
|
||||
|
@ -425,17 +416,16 @@
|
|||
|
||||
Fail:
|
||||
*error = FT_Err_Invalid_Stream_Operation;
|
||||
FT_ERROR(( "FT_Stream_Read_Char:" ));
|
||||
FT_ERROR(( " invalid i/o; pos = 0x%lx, size = 0x%lx\n",
|
||||
stream->pos, stream->size ));
|
||||
FT_ERROR(( "%s: invalid i/o; pos = 0x%lx, size = 0x%lx\n",
|
||||
"FT_Stream_ReadChar", stream->pos, stream->size ));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
FT_BASE_DEF( FT_Short )
|
||||
FT_Stream_Read_Short( FT_Stream stream,
|
||||
FT_Error* error )
|
||||
FT_Stream_ReadShort( FT_Stream stream,
|
||||
FT_Error* error )
|
||||
{
|
||||
FT_Byte reads[2];
|
||||
FT_Byte* p = 0;
|
||||
|
@ -472,7 +462,7 @@
|
|||
|
||||
Fail:
|
||||
*error = FT_Err_Invalid_Stream_Operation;
|
||||
FT_ERROR(( "FT_Stream_Read_Short:" ));
|
||||
FT_ERROR(( "FT_Stream_ReadShort:" ));
|
||||
FT_ERROR(( " invalid i/o; pos = 0x%lx, size = 0x%lx\n",
|
||||
stream->pos, stream->size ));
|
||||
|
||||
|
@ -481,8 +471,8 @@
|
|||
|
||||
|
||||
FT_BASE_DEF( FT_Short )
|
||||
FT_Stream_Read_ShortLE( FT_Stream stream,
|
||||
FT_Error* error )
|
||||
FT_Stream_ReadShortLE( FT_Stream stream,
|
||||
FT_Error* error )
|
||||
{
|
||||
FT_Byte reads[2];
|
||||
FT_Byte* p = 0;
|
||||
|
@ -519,7 +509,7 @@
|
|||
|
||||
Fail:
|
||||
*error = FT_Err_Invalid_Stream_Operation;
|
||||
FT_ERROR(( "FT_Stream_Read_Short:" ));
|
||||
FT_ERROR(( "FT_Stream_ReadShort:" ));
|
||||
FT_ERROR(( " invalid i/o; pos = 0x%lx, size = 0x%lx\n",
|
||||
stream->pos, stream->size ));
|
||||
|
||||
|
@ -528,8 +518,8 @@
|
|||
|
||||
|
||||
FT_BASE_DEF( FT_Long )
|
||||
FT_Stream_Read_Offset( FT_Stream stream,
|
||||
FT_Error* error )
|
||||
FT_Stream_ReadOffset( FT_Stream stream,
|
||||
FT_Error* error )
|
||||
{
|
||||
FT_Byte reads[3];
|
||||
FT_Byte* p = 0;
|
||||
|
@ -566,19 +556,18 @@
|
|||
|
||||
Fail:
|
||||
*error = FT_Err_Invalid_Stream_Operation;
|
||||
FT_ERROR(( "FT_Stream_Read_Offset:" ));
|
||||
FT_ERROR(( " invalid i/o; pos = 0x%lx, size = 0x%lx\n",
|
||||
stream->pos, stream->size ));
|
||||
FT_ERROR(( "%s: invalid i/o; pos = 0x%lx, size = 0x%lx\n",
|
||||
"FT_Stream_ReadOffset", stream->pos, stream->size ));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
FT_BASE_DEF( FT_Long )
|
||||
FT_Stream_Read_Long( FT_Stream stream,
|
||||
FT_Error* error )
|
||||
FT_Stream_ReadLong( FT_Stream stream,
|
||||
FT_Error* error )
|
||||
{
|
||||
FT_Byte reads[4];
|
||||
FT_Byte reads[4];
|
||||
FT_Byte* p = 0;
|
||||
FT_Long result = 0;
|
||||
|
||||
|
@ -612,9 +601,8 @@
|
|||
return result;
|
||||
|
||||
Fail:
|
||||
FT_ERROR(( "FT_Stream_Read_Long:" ));
|
||||
FT_ERROR(( " invalid i/o; pos = 0x%lx, size = 0x%lx\n",
|
||||
stream->pos, stream->size ));
|
||||
FT_ERROR(( "%s: invalid i/o; pos = 0x%lx, size = 0x%lx\n",
|
||||
"FT_Stream_ReadLong", stream->pos, stream->size ));
|
||||
*error = FT_Err_Invalid_Stream_Operation;
|
||||
|
||||
return 0;
|
||||
|
@ -622,8 +610,8 @@
|
|||
|
||||
|
||||
FT_BASE_DEF( FT_Long )
|
||||
FT_Stream_Read_LongLE( FT_Stream stream,
|
||||
FT_Error* error )
|
||||
FT_Stream_ReadLongLE( FT_Stream stream,
|
||||
FT_Error* error )
|
||||
{
|
||||
FT_Byte reads[4];
|
||||
FT_Byte* p = 0;
|
||||
|
@ -659,7 +647,7 @@
|
|||
return result;
|
||||
|
||||
Fail:
|
||||
FT_ERROR(( "FT_Stream_Read_Long:" ));
|
||||
FT_ERROR(( "FT_Stream_ReadLong:" ));
|
||||
FT_ERROR(( " invalid i/o; pos = 0x%lx, size = 0x%lx\n",
|
||||
stream->pos, stream->size ));
|
||||
*error = FT_Err_Invalid_Stream_Operation;
|
||||
|
@ -669,9 +657,9 @@
|
|||
|
||||
|
||||
FT_BASE_DEF( FT_Error )
|
||||
FT_Stream_Read_Fields( FT_Stream stream,
|
||||
const FT_Frame_Field* fields,
|
||||
void* structure )
|
||||
FT_Stream_ReadFields( FT_Stream stream,
|
||||
const FT_Frame_Field* fields,
|
||||
void* structure )
|
||||
{
|
||||
FT_Error error;
|
||||
FT_Bool frame_accessed = 0;
|
||||
|
@ -692,7 +680,7 @@
|
|||
switch ( fields->value )
|
||||
{
|
||||
case ft_frame_start: /* access a new frame */
|
||||
error = FT_Stream_Enter_Frame( stream, fields->offset );
|
||||
error = FT_Stream_EnterFrame( stream, fields->offset );
|
||||
if ( error )
|
||||
goto Exit;
|
||||
|
||||
|
@ -804,7 +792,7 @@
|
|||
Exit:
|
||||
/* close the frame if it was opened by this read */
|
||||
if ( frame_accessed )
|
||||
FT_Stream_Exit_Frame( stream );
|
||||
FT_Stream_ExitFrame( stream );
|
||||
|
||||
return error;
|
||||
}
|
||||
|
|
|
@ -39,6 +39,7 @@ BASE_SRC := $(BASE_)ftcalc.c \
|
|||
$(BASE_)ftgloadr.c \
|
||||
$(BASE_)ftoutln.c \
|
||||
$(BASE_)ftobjs.c \
|
||||
$(BASE_)ftapi.c \
|
||||
$(BASE_)ftnames.c \
|
||||
$(BASE_)ftdbgmem.c
|
||||
|
||||
|
|
|
@ -1114,7 +1114,7 @@
|
|||
data_size = (FT_ULong)( count + 1 ) * offsize;
|
||||
|
||||
if ( ALLOC_ARRAY( idx->offsets, count + 1, FT_ULong ) ||
|
||||
ACCESS_Frame( data_size ) )
|
||||
FT_FRAME_ENTER( data_size ) )
|
||||
goto Exit;
|
||||
|
||||
poff = idx->offsets;
|
||||
|
@ -1127,21 +1127,21 @@
|
|||
p += offsize;
|
||||
}
|
||||
|
||||
FORGET_Frame();
|
||||
FT_FRAME_EXIT();
|
||||
|
||||
idx->data_offset = FILE_Pos();
|
||||
idx->data_offset = FT_STREAM_POS();
|
||||
data_size = poff[-1] - 1;
|
||||
|
||||
if ( load )
|
||||
{
|
||||
/* load the data */
|
||||
if ( EXTRACT_Frame( data_size, idx->bytes ) )
|
||||
if ( FT_FRAME_EXTRACT( data_size, idx->bytes ) )
|
||||
goto Exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* skip the data */
|
||||
if ( FILE_Skip( data_size ) )
|
||||
if ( FT_STREAM_SKIP( data_size ) )
|
||||
goto Exit;
|
||||
}
|
||||
}
|
||||
|
@ -1164,7 +1164,7 @@
|
|||
|
||||
|
||||
if ( idx->bytes )
|
||||
RELEASE_Frame( idx->bytes );
|
||||
FT_FRAME_RELEASE( idx->bytes );
|
||||
|
||||
FREE( idx->offsets );
|
||||
MEM_Set( idx, 0, sizeof ( *idx ) );
|
||||
|
@ -1249,8 +1249,8 @@
|
|||
FT_Stream stream = idx->stream;
|
||||
|
||||
|
||||
if ( FILE_Seek( idx->data_offset + off1 - 1 ) ||
|
||||
EXTRACT_Frame( off2 - off1, *pbytes ) )
|
||||
if ( FT_STREAM_SEEK( idx->data_offset + off1 - 1 ) ||
|
||||
FT_FRAME_EXTRACT( off2 - off1, *pbytes ) )
|
||||
goto Exit;
|
||||
}
|
||||
}
|
||||
|
@ -1278,7 +1278,7 @@
|
|||
FT_Stream stream = idx->stream;
|
||||
|
||||
|
||||
RELEASE_Frame( *pbytes );
|
||||
FT_FRAME_RELEASE( *pbytes );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1361,7 +1361,7 @@
|
|||
FT_Stream stream )
|
||||
{
|
||||
if ( select->data )
|
||||
RELEASE_Frame( select->data );
|
||||
FT_FRAME_RELEASE( select->data );
|
||||
|
||||
select->data_size = 0;
|
||||
select->format = 0;
|
||||
|
@ -1381,7 +1381,7 @@
|
|||
|
||||
|
||||
/* read format */
|
||||
if ( FILE_Seek( offset ) || READ_Byte( format ) )
|
||||
if ( FT_STREAM_SEEK( offset ) || READ_Byte( format ) )
|
||||
goto Exit;
|
||||
|
||||
select->format = format;
|
||||
|
@ -1400,7 +1400,7 @@
|
|||
select->data_size = num_ranges * 3 + 2;
|
||||
|
||||
Load_Data:
|
||||
if ( EXTRACT_Frame( select->data_size, select->data ) )
|
||||
if ( FT_FRAME_EXTRACT( select->data_size, select->data ) )
|
||||
goto Exit;
|
||||
break;
|
||||
|
||||
|
@ -1528,7 +1528,7 @@
|
|||
charset->offset = base_offset + offset;
|
||||
|
||||
/* Get the format of the table. */
|
||||
if ( FILE_Seek( charset->offset ) ||
|
||||
if ( FT_STREAM_SEEK( charset->offset ) ||
|
||||
READ_Byte( charset->format ) )
|
||||
goto Exit;
|
||||
|
||||
|
@ -1746,7 +1746,7 @@
|
|||
encoding->offset = base_offset + offset;
|
||||
|
||||
/* we need to parse the table to determine its size */
|
||||
if ( FILE_Seek( encoding->offset ) ||
|
||||
if ( FT_STREAM_SEEK( encoding->offset ) ||
|
||||
READ_Byte( encoding->format ) ||
|
||||
READ_Byte( count ) )
|
||||
goto Exit;
|
||||
|
@ -2009,14 +2009,14 @@
|
|||
|
||||
CFF_Parser_Init( &parser, CFF_CODE_PRIVATE, priv );
|
||||
|
||||
if ( FILE_Seek( base_offset + font->font_dict.private_offset ) ||
|
||||
ACCESS_Frame( font->font_dict.private_size ) )
|
||||
if ( FT_STREAM_SEEK( base_offset + font->font_dict.private_offset ) ||
|
||||
FT_FRAME_ENTER( font->font_dict.private_size ) )
|
||||
goto Exit;
|
||||
|
||||
error = CFF_Parser_Run( &parser,
|
||||
(FT_Byte*)stream->cursor,
|
||||
(FT_Byte*)stream->limit );
|
||||
FORGET_Frame();
|
||||
FT_FRAME_EXIT();
|
||||
if ( error )
|
||||
goto Exit;
|
||||
}
|
||||
|
@ -2024,7 +2024,7 @@
|
|||
/* read the local subrs, if any */
|
||||
if ( priv->local_subrs_offset )
|
||||
{
|
||||
if ( FILE_Seek( base_offset + top->private_offset +
|
||||
if ( FT_STREAM_SEEK( base_offset + top->private_offset +
|
||||
priv->local_subrs_offset ) )
|
||||
goto Exit;
|
||||
|
||||
|
@ -2085,10 +2085,10 @@
|
|||
font->stream = stream;
|
||||
font->memory = memory;
|
||||
dict = &font->top_font.font_dict;
|
||||
base_offset = FILE_Pos();
|
||||
base_offset = FT_STREAM_POS();
|
||||
|
||||
/* read CFF font header */
|
||||
if ( READ_Fields( cff_header_fields, font ) )
|
||||
if ( FT_STREAM_READ_FIELDS( cff_header_fields, font ) )
|
||||
goto Exit;
|
||||
|
||||
/* check format */
|
||||
|
@ -2102,7 +2102,7 @@
|
|||
}
|
||||
|
||||
/* skip the rest of the header */
|
||||
if ( FILE_Skip( font->header_size - 4 ) )
|
||||
if ( FT_STREAM_SKIP( font->header_size - 4 ) )
|
||||
goto Exit;
|
||||
|
||||
/* read the name, top dict, string and global subrs index */
|
||||
|
@ -2144,7 +2144,7 @@
|
|||
|
||||
/* this is a CID-keyed font, we must now allocate a table of */
|
||||
/* sub-fonts, then load each of them separately */
|
||||
if ( FILE_Seek( base_offset + dict->cid_fd_array_offset ) )
|
||||
if ( FT_STREAM_SEEK( base_offset + dict->cid_fd_array_offset ) )
|
||||
goto Exit;
|
||||
|
||||
error = cff_new_index( &fd_index, stream, 0 );
|
||||
|
@ -2199,7 +2199,7 @@
|
|||
goto Exit;
|
||||
}
|
||||
|
||||
if ( FILE_Seek( base_offset + dict->charstrings_offset ) )
|
||||
if ( FT_STREAM_SEEK( base_offset + dict->charstrings_offset ) )
|
||||
goto Exit;
|
||||
|
||||
error = cff_new_index( &font->charstrings_index, stream, 0 );
|
||||
|
|
|
@ -326,7 +326,7 @@
|
|||
face->root.driver->root.library, "pshinter" );
|
||||
|
||||
/* create input stream from resource */
|
||||
if ( FILE_Seek( 0 ) )
|
||||
if ( FT_STREAM_SEEK( 0 ) )
|
||||
goto Exit;
|
||||
|
||||
/* check that we have a valid OpenType file */
|
||||
|
@ -378,7 +378,7 @@
|
|||
else
|
||||
{
|
||||
/* rewind to start of file; we are going to load a pure-CFF font */
|
||||
if ( FILE_Seek( 0 ) )
|
||||
if ( FT_STREAM_SEEK( 0 ) )
|
||||
goto Exit;
|
||||
error = CFF_Err_Ok;
|
||||
}
|
||||
|
|
|
@ -51,9 +51,9 @@
|
|||
|
||||
|
||||
/* read the CID font dict index and charstring offset from the CIDMap */
|
||||
if ( FILE_Seek( cid->data_offset + cid->cidmap_offset +
|
||||
if ( FT_STREAM_SEEK( cid->data_offset + cid->cidmap_offset +
|
||||
glyph_index * entry_len ) ||
|
||||
ACCESS_Frame( 2 * entry_len ) )
|
||||
FT_FRAME_ENTER( 2 * entry_len ) )
|
||||
goto Exit;
|
||||
|
||||
p = (FT_Byte*)stream->cursor;
|
||||
|
@ -62,7 +62,7 @@
|
|||
p += cid->fd_bytes;
|
||||
glyph_len = cid_get_offset( &p, (FT_Byte)cid->gd_bytes ) - off1;
|
||||
|
||||
FORGET_Frame();
|
||||
FT_FRAME_EXIT();
|
||||
|
||||
/* now, if the glyph is not empty, set up the subrs array, and parse */
|
||||
/* the charstrings */
|
||||
|
@ -92,7 +92,7 @@
|
|||
if ( ALLOC( charstring, glyph_len ) )
|
||||
goto Exit;
|
||||
|
||||
if ( !FILE_Read_At( cid->data_offset + off1, charstring, glyph_len ) )
|
||||
if ( !FT_STREAM_READ_AT( cid->data_offset + off1, charstring, glyph_len ) )
|
||||
{
|
||||
FT_Int cs_offset;
|
||||
|
||||
|
|
|
@ -426,15 +426,15 @@
|
|||
}
|
||||
|
||||
/* read the subrmap's offsets */
|
||||
if ( FILE_Seek( cid->data_offset + dict->subrmap_offset ) ||
|
||||
ACCESS_Frame( ( num_subrs + 1 ) * dict->sd_bytes ) )
|
||||
if ( FT_STREAM_SEEK( cid->data_offset + dict->subrmap_offset ) ||
|
||||
FT_FRAME_ENTER( ( num_subrs + 1 ) * dict->sd_bytes ) )
|
||||
goto Fail;
|
||||
|
||||
p = (FT_Byte*)stream->cursor;
|
||||
for ( count = 0; count <= num_subrs; count++ )
|
||||
offsets[count] = cid_get_offset( &p, (FT_Byte)dict->sd_bytes );
|
||||
|
||||
FORGET_Frame();
|
||||
FT_FRAME_EXIT();
|
||||
|
||||
/* now, compute the size of subrs charstrings, */
|
||||
/* allocate, and read them */
|
||||
|
@ -444,8 +444,8 @@
|
|||
ALLOC( subr->code[0], data_len ) )
|
||||
goto Fail;
|
||||
|
||||
if ( FILE_Seek( cid->data_offset + offsets[0] ) ||
|
||||
FILE_Read( subr->code[0], data_len ) )
|
||||
if ( FT_STREAM_SEEK( cid->data_offset + offsets[0] ) ||
|
||||
FT_STREAM_READ( subr->code[0], data_len ) )
|
||||
goto Fail;
|
||||
|
||||
/* set up pointers */
|
||||
|
|
|
@ -310,7 +310,7 @@
|
|||
}
|
||||
|
||||
/* open the tokenizer; this will also check the font format */
|
||||
if ( FILE_Seek( 0 ) )
|
||||
if ( FT_STREAM_SEEK( 0 ) )
|
||||
goto Exit;
|
||||
|
||||
error = CID_Open_Face( face );
|
||||
|
|
|
@ -67,10 +67,10 @@
|
|||
|
||||
parser->stream = stream;
|
||||
|
||||
base_offset = FILE_Pos();
|
||||
base_offset = FT_STREAM_POS();
|
||||
|
||||
/* first of all, check the font format in the header */
|
||||
if ( ACCESS_Frame( 31 ) )
|
||||
if ( FT_FRAME_ENTER( 31 ) )
|
||||
goto Exit;
|
||||
|
||||
if ( strncmp( (char *)stream->cursor,
|
||||
|
@ -80,7 +80,7 @@
|
|||
error = CID_Err_Unknown_File_Format;
|
||||
}
|
||||
|
||||
FORGET_Frame();
|
||||
FT_FRAME_EXIT();
|
||||
if ( error )
|
||||
goto Exit;
|
||||
|
||||
|
@ -99,10 +99,10 @@
|
|||
|
||||
p = buffer + buff_len;
|
||||
|
||||
if ( FILE_Read( p, 256 + 10 - buff_len ) )
|
||||
if ( FT_STREAM_READ( p, 256 + 10 - buff_len ) )
|
||||
goto Exit;
|
||||
|
||||
top_position = FILE_Pos() - buff_len;
|
||||
top_position = FT_STREAM_POS() - buff_len;
|
||||
buff_len = 256 + 10;
|
||||
|
||||
/* look for `StartData' */
|
||||
|
@ -123,8 +123,8 @@
|
|||
/* section */
|
||||
|
||||
ps_len = offset - base_offset;
|
||||
if ( FILE_Seek( base_offset ) ||
|
||||
EXTRACT_Frame( ps_len, parser->postscript ) )
|
||||
if ( FT_STREAM_SEEK( base_offset ) ||
|
||||
FT_FRAME_EXTRACT( ps_len, parser->postscript ) )
|
||||
goto Exit;
|
||||
|
||||
parser->data_offset = offset;
|
||||
|
@ -148,7 +148,7 @@
|
|||
FT_Stream stream = parser->stream;
|
||||
|
||||
|
||||
RELEASE_Frame( parser->postscript );
|
||||
FT_FRAME_RELEASE( parser->postscript );
|
||||
}
|
||||
parser->root.funcs.done( &parser->root );
|
||||
}
|
||||
|
|
|
@ -211,8 +211,8 @@ THE SOFTWARE.
|
|||
if ( ALLOC( bitmap->buffer, bytes ) )
|
||||
goto Exit;
|
||||
|
||||
if ( FILE_Seek( metric->bits ) ||
|
||||
FILE_Read( bitmap->buffer, bytes ) )
|
||||
if ( FT_STREAM_SEEK( metric->bits ) ||
|
||||
FT_STREAM_READ( bitmap->buffer, bytes ) )
|
||||
goto Exit;
|
||||
|
||||
if ( PCF_BIT_ORDER( face->bitmapsFormat ) != MSBFirst )
|
||||
|
|
|
@ -98,8 +98,8 @@ THE SOFTWARE.
|
|||
FT_UInt n;
|
||||
|
||||
|
||||
if ( FILE_Seek ( 0 ) ||
|
||||
READ_Fields ( pcf_toc_header, toc ) )
|
||||
if ( FT_STREAM_SEEK ( 0 ) ||
|
||||
FT_STREAM_READ_FIELDS ( pcf_toc_header, toc ) )
|
||||
return PCF_Err_Cannot_Open_Resource;
|
||||
|
||||
if ( toc->version != PCF_FILE_VERSION )
|
||||
|
@ -111,7 +111,7 @@ THE SOFTWARE.
|
|||
tables = face->toc.tables;
|
||||
for ( n = 0; n < toc->count; n++ )
|
||||
{
|
||||
if ( READ_Fields( pcf_table_header, tables ) )
|
||||
if ( FT_STREAM_READ_FIELDS( pcf_table_header, tables ) )
|
||||
goto Exit;
|
||||
tables++;
|
||||
}
|
||||
|
@ -220,7 +220,7 @@ THE SOFTWARE.
|
|||
: pcf_metric_header;
|
||||
|
||||
/* the following sets 'error' but doesn't return in case of failure */
|
||||
(void) READ_Fields( fields, metric );
|
||||
(void) FT_STREAM_READ_FIELDS( fields, metric );
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -228,7 +228,7 @@ THE SOFTWARE.
|
|||
|
||||
|
||||
/* parsing compressed metrics */
|
||||
if ( READ_Fields( pcf_compressed_metric_header, &compr ) )
|
||||
if ( FT_STREAM_READ_FIELDS( pcf_compressed_metric_header, &compr ) )
|
||||
goto Exit;
|
||||
|
||||
metric->leftSideBearing = (FT_Short)( compr.leftSideBearing - 0x80 );
|
||||
|
@ -262,7 +262,7 @@ THE SOFTWARE.
|
|||
if ( stream->pos > tables[i].offset )
|
||||
return PCF_Err_Invalid_Stream_Skip;
|
||||
|
||||
if ( FILE_Skip( tables[i].offset - stream->pos ) )
|
||||
if ( FT_STREAM_SKIP( tables[i].offset - stream->pos ) )
|
||||
return PCF_Err_Invalid_Stream_Skip;
|
||||
|
||||
*asize = tables[i].size; /* unused - to be removed */
|
||||
|
@ -390,12 +390,12 @@ THE SOFTWARE.
|
|||
{
|
||||
if ( PCF_BYTE_ORDER( format ) == MSBFirst )
|
||||
{
|
||||
if ( READ_Fields( pcf_property_msb_header, props + i ) )
|
||||
if ( FT_STREAM_READ_FIELDS( pcf_property_msb_header, props + i ) )
|
||||
goto Bail;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( READ_Fields( pcf_property_header, props + i ) )
|
||||
if ( FT_STREAM_READ_FIELDS( pcf_property_header, props + i ) )
|
||||
goto Bail;
|
||||
}
|
||||
}
|
||||
|
@ -568,7 +568,7 @@ THE SOFTWARE.
|
|||
if ( error )
|
||||
return error;
|
||||
|
||||
error = FT_Stream_Enter_Frame( stream, 8 );
|
||||
error = FT_Stream_EnterFrame( stream, 8 );
|
||||
if ( error )
|
||||
return error;
|
||||
|
||||
|
@ -578,7 +578,7 @@ THE SOFTWARE.
|
|||
else
|
||||
nbitmaps = GET_ULongLE();
|
||||
|
||||
FT_Stream_Exit_Frame( stream );
|
||||
FT_Stream_ExitFrame( stream );
|
||||
|
||||
if ( !PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) )
|
||||
return PCF_Err_Invalid_File_Format;
|
||||
|
@ -660,7 +660,7 @@ THE SOFTWARE.
|
|||
if ( error )
|
||||
return error;
|
||||
|
||||
error = FT_Stream_Enter_Frame( stream, 14 );
|
||||
error = FT_Stream_EnterFrame( stream, 14 );
|
||||
if ( error )
|
||||
return error;
|
||||
|
||||
|
@ -683,7 +683,7 @@ THE SOFTWARE.
|
|||
face->defaultChar = GET_ShortLE();
|
||||
}
|
||||
|
||||
FT_Stream_Exit_Frame( stream );
|
||||
FT_Stream_ExitFrame( stream );
|
||||
|
||||
if ( !PCF_FORMAT_MATCH( format, PCF_DEFAULT_FORMAT ) )
|
||||
return PCF_Err_Invalid_File_Format;
|
||||
|
@ -696,7 +696,7 @@ THE SOFTWARE.
|
|||
if ( ALLOC( tmpEncoding, nencoding * sizeof ( PCF_EncodingRec ) ) )
|
||||
return PCF_Err_Out_Of_Memory;
|
||||
|
||||
error = FT_Stream_Enter_Frame( stream, 2 * nencoding );
|
||||
error = FT_Stream_EnterFrame( stream, 2 * nencoding );
|
||||
if ( error )
|
||||
goto Bail;
|
||||
|
||||
|
@ -721,7 +721,7 @@ THE SOFTWARE.
|
|||
FT_TRACE4(( "enc n. %d ; Uni %ld ; Glyph %d\n",
|
||||
i, tmpEncoding[j - 1].enc, encodingOffset ));
|
||||
}
|
||||
FT_Stream_Exit_Frame( stream );
|
||||
FT_Stream_ExitFrame( stream );
|
||||
|
||||
if ( ALLOC( encoding, (--j) * sizeof ( PCF_EncodingRec ) ) )
|
||||
goto Bail;
|
||||
|
@ -816,12 +816,12 @@ THE SOFTWARE.
|
|||
|
||||
if ( PCF_BYTE_ORDER( format ) == MSBFirst )
|
||||
{
|
||||
if ( READ_Fields( pcf_accel_msb_header, accel ) )
|
||||
if ( FT_STREAM_READ_FIELDS( pcf_accel_msb_header, accel ) )
|
||||
goto Bail;
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( READ_Fields( pcf_accel_header, accel ) )
|
||||
if ( FT_STREAM_READ_FIELDS( pcf_accel_header, accel ) )
|
||||
goto Bail;
|
||||
}
|
||||
|
||||
|
|
|
@ -135,7 +135,7 @@
|
|||
|
||||
memory = stream->memory;
|
||||
|
||||
if ( FILE_Seek( cmap->offset ) )
|
||||
if ( FT_STREAM_SEEK( cmap->offset ) )
|
||||
return error;
|
||||
|
||||
switch ( cmap->format )
|
||||
|
@ -145,7 +145,7 @@
|
|||
|
||||
if ( READ_UShort( cmap0->language ) ||
|
||||
ALLOC( cmap0->glyphIdArray, 256L ) ||
|
||||
FILE_Read( cmap0->glyphIdArray, 256L ) )
|
||||
FT_STREAM_READ( cmap0->glyphIdArray, 256L ) )
|
||||
goto Fail;
|
||||
|
||||
cmap->get_index = code_to_index0;
|
||||
|
@ -159,7 +159,7 @@
|
|||
/* allocate subheader keys */
|
||||
|
||||
if ( ALLOC_ARRAY( cmap2->subHeaderKeys, 256, FT_UShort ) ||
|
||||
ACCESS_Frame( 2L + 512L ) )
|
||||
FT_FRAME_ENTER( 2L + 512L ) )
|
||||
goto Fail;
|
||||
|
||||
cmap2->language = GET_UShort();
|
||||
|
@ -173,7 +173,7 @@
|
|||
num_SH = u;
|
||||
}
|
||||
|
||||
FORGET_Frame();
|
||||
FT_FRAME_EXIT();
|
||||
|
||||
/* load subheaders */
|
||||
|
||||
|
@ -183,7 +183,7 @@
|
|||
if ( ALLOC_ARRAY( cmap2->subHeaders,
|
||||
num_SH + 1,
|
||||
TT_CMap2SubHeaderRec ) ||
|
||||
ACCESS_Frame( ( num_SH + 1 ) * 8L ) )
|
||||
FT_FRAME_ENTER( ( num_SH + 1 ) * 8L ) )
|
||||
{
|
||||
FREE( cmap2->subHeaderKeys );
|
||||
goto Fail;
|
||||
|
@ -203,12 +203,12 @@
|
|||
cmap2sub++;
|
||||
}
|
||||
|
||||
FORGET_Frame();
|
||||
FT_FRAME_EXIT();
|
||||
|
||||
/* load glyph IDs */
|
||||
|
||||
if ( ALLOC_ARRAY( cmap2->glyphIdArray, l, FT_UShort ) ||
|
||||
ACCESS_Frame( l * 2L ) )
|
||||
FT_FRAME_ENTER( l * 2L ) )
|
||||
{
|
||||
FREE( cmap2->subHeaders );
|
||||
FREE( cmap2->subHeaderKeys );
|
||||
|
@ -218,7 +218,7 @@
|
|||
for ( i = 0; i < l; i++ )
|
||||
cmap2->glyphIdArray[i] = GET_UShort();
|
||||
|
||||
FORGET_Frame();
|
||||
FT_FRAME_EXIT();
|
||||
|
||||
cmap->get_index = code_to_index2;
|
||||
cmap->get_next_char = code_to_next2;
|
||||
|
@ -229,7 +229,7 @@
|
|||
|
||||
/* load header */
|
||||
|
||||
if ( ACCESS_Frame( 10L ) )
|
||||
if ( FT_FRAME_ENTER( 10L ) )
|
||||
goto Fail;
|
||||
|
||||
cmap4->language = GET_UShort();
|
||||
|
@ -240,14 +240,14 @@
|
|||
|
||||
num_Seg = (FT_UShort)( cmap4->segCountX2 / 2 );
|
||||
|
||||
FORGET_Frame();
|
||||
FT_FRAME_EXIT();
|
||||
|
||||
/* load segments */
|
||||
|
||||
if ( ALLOC_ARRAY( cmap4->segments,
|
||||
num_Seg,
|
||||
TT_CMap4SegmentRec ) ||
|
||||
ACCESS_Frame( ( num_Seg * 4 + 1 ) * 2L ) )
|
||||
FT_FRAME_ENTER( ( num_Seg * 4 + 1 ) * 2L ) )
|
||||
goto Fail;
|
||||
|
||||
segments = cmap4->segments;
|
||||
|
@ -266,7 +266,7 @@
|
|||
for ( i = 0; i < num_Seg; i++ )
|
||||
segments[i].idRangeOffset = GET_UShort();
|
||||
|
||||
FORGET_Frame();
|
||||
FT_FRAME_EXIT();
|
||||
|
||||
cmap4->numGlyphId = l = (FT_UShort)(
|
||||
( ( cmap->length - ( 16L + 8L * num_Seg ) ) & 0xFFFF ) / 2 );
|
||||
|
@ -274,7 +274,7 @@
|
|||
/* load IDs */
|
||||
|
||||
if ( ALLOC_ARRAY( cmap4->glyphIdArray, l, FT_UShort ) ||
|
||||
ACCESS_Frame( l * 2L ) )
|
||||
FT_FRAME_ENTER( l * 2L ) )
|
||||
{
|
||||
FREE( cmap4->segments );
|
||||
goto Fail;
|
||||
|
@ -283,7 +283,7 @@
|
|||
for ( i = 0; i < l; i++ )
|
||||
cmap4->glyphIdArray[i] = GET_UShort();
|
||||
|
||||
FORGET_Frame();
|
||||
FT_FRAME_EXIT();
|
||||
|
||||
cmap4->last_segment = cmap4->segments;
|
||||
|
||||
|
@ -294,25 +294,25 @@
|
|||
case 6:
|
||||
cmap6 = &cmap->c.cmap6;
|
||||
|
||||
if ( ACCESS_Frame( 6L ) )
|
||||
if ( FT_FRAME_ENTER( 6L ) )
|
||||
goto Fail;
|
||||
|
||||
cmap6->language = GET_UShort();
|
||||
cmap6->firstCode = GET_UShort();
|
||||
cmap6->entryCount = GET_UShort();
|
||||
|
||||
FORGET_Frame();
|
||||
FT_FRAME_EXIT();
|
||||
|
||||
l = cmap6->entryCount;
|
||||
|
||||
if ( ALLOC_ARRAY( cmap6->glyphIdArray, l, FT_Short ) ||
|
||||
ACCESS_Frame( l * 2L ) )
|
||||
FT_FRAME_ENTER( l * 2L ) )
|
||||
goto Fail;
|
||||
|
||||
for ( i = 0; i < l; i++ )
|
||||
cmap6->glyphIdArray[i] = GET_UShort();
|
||||
|
||||
FORGET_Frame();
|
||||
FT_FRAME_EXIT();
|
||||
cmap->get_index = code_to_index6;
|
||||
cmap->get_next_char = code_to_next6;
|
||||
break;
|
||||
|
@ -321,16 +321,16 @@
|
|||
case 12:
|
||||
cmap8_12 = &cmap->c.cmap8_12;
|
||||
|
||||
if ( ACCESS_Frame( 8L ) )
|
||||
if ( FT_FRAME_ENTER( 8L ) )
|
||||
goto Fail;
|
||||
|
||||
cmap->length = GET_ULong();
|
||||
cmap8_12->language = GET_ULong();
|
||||
|
||||
FORGET_Frame();
|
||||
FT_FRAME_EXIT();
|
||||
|
||||
if ( cmap->format == 8 )
|
||||
if ( FILE_Skip( 8192L ) )
|
||||
if ( FT_STREAM_SKIP( 8192L ) )
|
||||
goto Fail;
|
||||
|
||||
if ( READ_ULong( cmap8_12->nGroups ) )
|
||||
|
@ -339,7 +339,7 @@
|
|||
n = cmap8_12->nGroups;
|
||||
|
||||
if ( ALLOC_ARRAY( cmap8_12->groups, n, TT_CMapGroupRec ) ||
|
||||
ACCESS_Frame( n * 3 * 4L ) )
|
||||
FT_FRAME_ENTER( n * 3 * 4L ) )
|
||||
goto Fail;
|
||||
|
||||
groups = cmap8_12->groups;
|
||||
|
@ -351,7 +351,7 @@
|
|||
groups[j].startGlyphID = GET_ULong();
|
||||
}
|
||||
|
||||
FORGET_Frame();
|
||||
FT_FRAME_EXIT();
|
||||
|
||||
cmap8_12->last_group = cmap8_12->groups;
|
||||
|
||||
|
@ -362,7 +362,7 @@
|
|||
case 10:
|
||||
cmap10 = &cmap->c.cmap10;
|
||||
|
||||
if ( ACCESS_Frame( 16L ) )
|
||||
if ( FT_FRAME_ENTER( 16L ) )
|
||||
goto Fail;
|
||||
|
||||
cmap->length = GET_ULong();
|
||||
|
@ -370,18 +370,18 @@
|
|||
cmap10->startCharCode = GET_ULong();
|
||||
cmap10->numChars = GET_ULong();
|
||||
|
||||
FORGET_Frame();
|
||||
FT_FRAME_EXIT();
|
||||
|
||||
n = cmap10->numChars;
|
||||
|
||||
if ( ALLOC_ARRAY( cmap10->glyphs, n, FT_Short ) ||
|
||||
ACCESS_Frame( n * 2L ) )
|
||||
FT_FRAME_ENTER( n * 2L ) )
|
||||
goto Fail;
|
||||
|
||||
for ( j = 0; j < n; j++ )
|
||||
cmap10->glyphs[j] = GET_UShort();
|
||||
|
||||
FORGET_Frame();
|
||||
FT_FRAME_EXIT();
|
||||
cmap->get_index = code_to_index10;
|
||||
cmap->get_next_char = code_to_next10;
|
||||
break;
|
||||
|
|
|
@ -120,7 +120,7 @@
|
|||
if ( length )
|
||||
*length = table->Length;
|
||||
|
||||
if ( FILE_Seek( table->Offset ) )
|
||||
if ( FT_STREAM_SEEK( table->Offset ) )
|
||||
goto Exit;
|
||||
}
|
||||
else
|
||||
|
@ -217,20 +217,20 @@
|
|||
|
||||
/* it's a TrueType collection, i.e. a file containing several */
|
||||
/* font files. Read the font directory now */
|
||||
if ( READ_Fields( ttc_header_fields, &face->ttc_header ) )
|
||||
if ( FT_STREAM_READ_FIELDS( ttc_header_fields, &face->ttc_header ) )
|
||||
goto Exit;
|
||||
|
||||
/* now read the offsets of each font in the file */
|
||||
if ( ALLOC_ARRAY( face->ttc_header.offsets,
|
||||
face->ttc_header.count,
|
||||
FT_ULong ) ||
|
||||
ACCESS_Frame( face->ttc_header.count * 4L ) )
|
||||
FT_FRAME_ENTER( face->ttc_header.count * 4L ) )
|
||||
goto Exit;
|
||||
|
||||
for ( n = 0; n < face->ttc_header.count; n++ )
|
||||
face->ttc_header.offsets[n] = GET_ULong();
|
||||
|
||||
FORGET_Frame();
|
||||
FT_FRAME_EXIT();
|
||||
|
||||
/* check face index */
|
||||
if ( face_index >= face->ttc_header.count )
|
||||
|
@ -240,14 +240,14 @@
|
|||
}
|
||||
|
||||
/* seek to the appropriate TrueType file, then read tag */
|
||||
if ( FILE_Seek( face->ttc_header.offsets[face_index] ) ||
|
||||
if ( FT_STREAM_SEEK( face->ttc_header.offsets[face_index] ) ||
|
||||
READ_Long( format_tag ) )
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
/* the format tag was read, now check the rest of the header */
|
||||
sfnt->format_tag = format_tag;
|
||||
if ( READ_Fields( sfnt_header_fields, sfnt ) )
|
||||
if ( FT_STREAM_READ_FIELDS( sfnt_header_fields, sfnt ) )
|
||||
goto Exit;
|
||||
|
||||
/* now, check the values of `num_tables', `seach_range', etc. */
|
||||
|
@ -317,7 +317,7 @@
|
|||
TT_TableRec ) )
|
||||
goto Exit;
|
||||
|
||||
if ( ACCESS_Frame( face->num_tables * 16L ) )
|
||||
if ( FT_FRAME_ENTER( face->num_tables * 16L ) )
|
||||
goto Exit;
|
||||
|
||||
entry = face->dir_tables;
|
||||
|
@ -339,7 +339,7 @@
|
|||
entry->Length ));
|
||||
}
|
||||
|
||||
FORGET_Frame();
|
||||
FT_FRAME_EXIT();
|
||||
|
||||
FT_TRACE2(( "Directory loaded\n\n" ));
|
||||
|
||||
|
@ -430,7 +430,7 @@
|
|||
|
||||
stream = face->root.stream;
|
||||
/* the `if' is syntactic sugar for picky compilers */
|
||||
if ( FILE_Read_At( offset, buffer, size ) )
|
||||
if ( FT_STREAM_READ_AT( offset, buffer, size ) )
|
||||
goto Exit;
|
||||
|
||||
Exit:
|
||||
|
@ -507,7 +507,7 @@
|
|||
|
||||
header = &face->header;
|
||||
|
||||
if ( READ_Fields( header_fields, header ) )
|
||||
if ( FT_STREAM_READ_FIELDS( header_fields, header ) )
|
||||
goto Exit;
|
||||
|
||||
FT_TRACE2(( " Units per EM: %8u\n", header->Units_Per_EM ));
|
||||
|
@ -598,7 +598,7 @@
|
|||
if ( error )
|
||||
goto Exit;
|
||||
|
||||
if ( READ_Fields( maxp_fields, maxProfile ) )
|
||||
if ( FT_STREAM_READ_FIELDS( maxp_fields, maxProfile ) )
|
||||
goto Exit;
|
||||
|
||||
maxProfile->maxPoints = 0;
|
||||
|
@ -617,7 +617,7 @@
|
|||
|
||||
if ( maxProfile->version >= 0x10000L )
|
||||
{
|
||||
if ( READ_Fields( maxp_fields_extra, maxProfile ) )
|
||||
if ( FT_STREAM_READ_FIELDS( maxp_fields_extra, maxProfile ) )
|
||||
goto Exit;
|
||||
|
||||
/* XXX: an adjustment that is necessary to load certain */
|
||||
|
@ -753,7 +753,7 @@
|
|||
ALLOC_ARRAY( *shorts, num_shorts, TT_ShortMetrics ) )
|
||||
goto Exit;
|
||||
|
||||
if ( ACCESS_Frame( table_len ) )
|
||||
if ( FT_FRAME_ENTER( table_len ) )
|
||||
goto Exit;
|
||||
|
||||
{
|
||||
|
@ -791,7 +791,7 @@
|
|||
}
|
||||
}
|
||||
|
||||
FORGET_Frame();
|
||||
FT_FRAME_EXIT();
|
||||
|
||||
FT_TRACE2(( "loaded\n" ));
|
||||
|
||||
|
@ -883,7 +883,7 @@
|
|||
header = &face->horizontal;
|
||||
}
|
||||
|
||||
if ( READ_Fields( metrics_header_fields, header ) )
|
||||
if ( FT_STREAM_READ_FIELDS( metrics_header_fields, header ) )
|
||||
goto Exit;
|
||||
|
||||
header->long_metrics = NULL;
|
||||
|
@ -967,11 +967,11 @@
|
|||
goto Exit;
|
||||
}
|
||||
|
||||
table_pos = FILE_Pos();
|
||||
table_pos = FT_STREAM_POS();
|
||||
|
||||
names = &face->name_table;
|
||||
|
||||
if ( READ_Fields( name_table_fields, names ) )
|
||||
if ( FT_STREAM_READ_FIELDS( name_table_fields, names ) )
|
||||
goto Exit;
|
||||
|
||||
/* check the 'storageOffset' field */
|
||||
|
@ -989,7 +989,7 @@
|
|||
/* Allocate the array of name records. */
|
||||
if ( ALLOC( names->names,
|
||||
names->numNameRecords*sizeof(TT_NameEntryRec) + storageSize ) ||
|
||||
ACCESS_Frame( names->numNameRecords * 12L ) )
|
||||
FT_FRAME_ENTER( names->numNameRecords * 12L ) )
|
||||
goto Exit;
|
||||
|
||||
storage = (FT_Byte*)(names->names + names->numNameRecords);
|
||||
|
@ -1003,7 +1003,7 @@
|
|||
|
||||
for ( ; cur < limit; cur ++ )
|
||||
{
|
||||
if ( READ_Fields( name_record_fields, cur ) )
|
||||
if ( FT_STREAM_READ_FIELDS( name_record_fields, cur ) )
|
||||
break;
|
||||
|
||||
/* invalid name entries will have "cur->string" set to NULL !! */
|
||||
|
@ -1018,14 +1018,14 @@
|
|||
}
|
||||
}
|
||||
|
||||
FORGET_Frame();
|
||||
FT_FRAME_EXIT();
|
||||
|
||||
if (error)
|
||||
goto Exit;
|
||||
|
||||
storageOffset -= 6 + 12*names->numNameRecords;
|
||||
if ( FILE_Skip( storageOffset ) ||
|
||||
FILE_Read( storage, storageSize ) )
|
||||
if ( FT_STREAM_SKIP( storageOffset ) ||
|
||||
FT_STREAM_READ( storage, storageSize ) )
|
||||
goto Exit;
|
||||
|
||||
|
||||
|
@ -1165,9 +1165,9 @@
|
|||
goto Exit;
|
||||
}
|
||||
|
||||
table_start = FILE_Pos();
|
||||
table_start = FT_STREAM_POS();
|
||||
|
||||
if ( READ_Fields( cmap_fields, &cmap_dir ) )
|
||||
if ( FT_STREAM_READ_FIELDS( cmap_fields, &cmap_dir ) )
|
||||
goto Exit;
|
||||
|
||||
/* reserve space in face table for cmap tables */
|
||||
|
@ -1183,7 +1183,7 @@
|
|||
|
||||
|
||||
/* read the header of each charmap first */
|
||||
if ( ACCESS_Frame( face->num_charmaps * 8L ) )
|
||||
if ( FT_FRAME_ENTER( face->num_charmaps * 8L ) )
|
||||
goto Exit;
|
||||
|
||||
for ( ; charmap < limit; charmap++ )
|
||||
|
@ -1200,7 +1200,7 @@
|
|||
cmap->offset = (FT_ULong)GET_Long();
|
||||
}
|
||||
|
||||
FORGET_Frame();
|
||||
FT_FRAME_EXIT();
|
||||
|
||||
/* now read the rest of each table */
|
||||
for ( charmap = face->charmaps; charmap < limit; charmap++ )
|
||||
|
@ -1208,11 +1208,11 @@
|
|||
TT_CMapTable cmap = &charmap->cmap;
|
||||
|
||||
|
||||
if ( FILE_Seek( table_start + (FT_Long)cmap->offset ) ||
|
||||
READ_Fields( cmap_rec_fields, cmap ) )
|
||||
if ( FT_STREAM_SEEK( table_start + (FT_Long)cmap->offset ) ||
|
||||
FT_STREAM_READ_FIELDS( cmap_rec_fields, cmap ) )
|
||||
goto Exit;
|
||||
|
||||
cmap->offset = FILE_Pos();
|
||||
cmap->offset = FT_STREAM_POS();
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1333,7 +1333,7 @@
|
|||
|
||||
os2 = &face->os2;
|
||||
|
||||
if ( READ_Fields( os2_fields, os2 ) )
|
||||
if ( FT_STREAM_READ_FIELDS( os2_fields, os2 ) )
|
||||
goto Exit;
|
||||
|
||||
os2->ulCodePageRange1 = 0;
|
||||
|
@ -1347,13 +1347,13 @@
|
|||
if ( os2->version >= 0x0001 )
|
||||
{
|
||||
/* only version 1 tables */
|
||||
if ( READ_Fields( os2_fields_extra, os2 ) )
|
||||
if ( FT_STREAM_READ_FIELDS( os2_fields_extra, os2 ) )
|
||||
goto Exit;
|
||||
|
||||
if ( os2->version >= 0x0002 )
|
||||
{
|
||||
/* only version 2 tables */
|
||||
if ( READ_Fields( os2_fields_extra2, os2 ) )
|
||||
if ( FT_STREAM_READ_FIELDS( os2_fields_extra2, os2 ) )
|
||||
goto Exit;
|
||||
}
|
||||
}
|
||||
|
@ -1412,7 +1412,7 @@
|
|||
if ( error )
|
||||
return SFNT_Err_Post_Table_Missing;
|
||||
|
||||
if ( READ_Fields( post_fields, post ) )
|
||||
if ( FT_STREAM_READ_FIELDS( post_fields, post ) )
|
||||
return error;
|
||||
|
||||
/* we don't load the glyph names, we do that in another */
|
||||
|
@ -1480,7 +1480,7 @@
|
|||
return SFNT_Err_Ok;
|
||||
}
|
||||
|
||||
if ( READ_Fields( pclt_fields, pclt ) )
|
||||
if ( FT_STREAM_READ_FIELDS( pclt_fields, pclt ) )
|
||||
goto Exit;
|
||||
|
||||
FT_TRACE2(( "loaded\n" ));
|
||||
|
@ -1523,19 +1523,19 @@
|
|||
if ( error )
|
||||
return SFNT_Err_Ok;
|
||||
|
||||
if ( ACCESS_Frame( 4L ) )
|
||||
if ( FT_FRAME_ENTER( 4L ) )
|
||||
goto Exit;
|
||||
|
||||
face->gasp.version = GET_UShort();
|
||||
face->gasp.numRanges = GET_UShort();
|
||||
|
||||
FORGET_Frame();
|
||||
FT_FRAME_EXIT();
|
||||
|
||||
num_ranges = face->gasp.numRanges;
|
||||
FT_TRACE3(( "number of ranges = %d\n", num_ranges ));
|
||||
|
||||
if ( ALLOC_ARRAY( gaspranges, num_ranges, TT_GaspRangeRec ) ||
|
||||
ACCESS_Frame( num_ranges * 4L ) )
|
||||
FT_FRAME_ENTER( num_ranges * 4L ) )
|
||||
goto Exit;
|
||||
|
||||
face->gasp.gaspRanges = gaspranges;
|
||||
|
@ -1551,7 +1551,7 @@
|
|||
}
|
||||
FT_TRACE3(( "\n" ));
|
||||
|
||||
FORGET_Frame();
|
||||
FT_FRAME_EXIT();
|
||||
FT_TRACE2(( "GASP loaded\n" ));
|
||||
|
||||
Exit:
|
||||
|
@ -1597,13 +1597,13 @@
|
|||
if ( error )
|
||||
return SFNT_Err_Ok;
|
||||
|
||||
if ( ACCESS_Frame( 4L ) )
|
||||
if ( FT_FRAME_ENTER( 4L ) )
|
||||
goto Exit;
|
||||
|
||||
(void)GET_UShort(); /* version */
|
||||
num_tables = GET_UShort();
|
||||
|
||||
FORGET_Frame();
|
||||
FT_FRAME_EXIT();
|
||||
|
||||
for ( n = 0; n < num_tables; n++ )
|
||||
{
|
||||
|
@ -1611,14 +1611,14 @@
|
|||
FT_UInt length;
|
||||
|
||||
|
||||
if ( ACCESS_Frame( 6L ) )
|
||||
if ( FT_FRAME_ENTER( 6L ) )
|
||||
goto Exit;
|
||||
|
||||
(void)GET_UShort(); /* version */
|
||||
length = GET_UShort() - 6; /* substract header length */
|
||||
coverage = GET_UShort();
|
||||
|
||||
FORGET_Frame();
|
||||
FT_FRAME_EXIT();
|
||||
|
||||
if ( coverage == 0x0001 )
|
||||
{
|
||||
|
@ -1628,18 +1628,18 @@
|
|||
|
||||
|
||||
/* found a horizontal format 0 kerning table! */
|
||||
if ( ACCESS_Frame( 8L ) )
|
||||
if ( FT_FRAME_ENTER( 8L ) )
|
||||
goto Exit;
|
||||
|
||||
num_pairs = GET_UShort();
|
||||
|
||||
/* skip the rest */
|
||||
|
||||
FORGET_Frame();
|
||||
FT_FRAME_EXIT();
|
||||
|
||||
/* allocate array of kerning pairs */
|
||||
if ( ALLOC_ARRAY( face->kern_pairs, num_pairs, TT_Kern0_PairRec ) ||
|
||||
ACCESS_Frame( 6L * num_pairs ) )
|
||||
FT_FRAME_ENTER( 6L * num_pairs ) )
|
||||
goto Exit;
|
||||
|
||||
pair = face->kern_pairs;
|
||||
|
@ -1651,7 +1651,7 @@
|
|||
pair->value = GET_UShort();
|
||||
}
|
||||
|
||||
FORGET_Frame();
|
||||
FT_FRAME_EXIT();
|
||||
|
||||
face->num_kern_pairs = num_pairs;
|
||||
face->kern_table_index = n;
|
||||
|
@ -1679,7 +1679,7 @@
|
|||
goto Exit;
|
||||
}
|
||||
|
||||
if ( FILE_Skip( length ) )
|
||||
if ( FT_STREAM_SKIP( length ) )
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
|
@ -1750,14 +1750,14 @@
|
|||
if ( error )
|
||||
return SFNT_Err_Ok;
|
||||
|
||||
if ( ACCESS_Frame( 8L ) )
|
||||
if ( FT_FRAME_ENTER( 8L ) )
|
||||
goto Exit;
|
||||
|
||||
hdmx->version = GET_UShort();
|
||||
hdmx->num_records = GET_Short();
|
||||
record_size = GET_Long();
|
||||
|
||||
FORGET_Frame();
|
||||
FT_FRAME_EXIT();
|
||||
|
||||
/* Only recognize format 0 */
|
||||
if ( hdmx->version != 0 )
|
||||
|
@ -1782,11 +1782,11 @@
|
|||
goto Exit;
|
||||
|
||||
if ( ALLOC( cur->widths, num_glyphs ) ||
|
||||
FILE_Read( cur->widths, num_glyphs ) )
|
||||
FT_STREAM_READ( cur->widths, num_glyphs ) )
|
||||
goto Exit;
|
||||
|
||||
/* skip padding bytes */
|
||||
if ( record_size > 0 && FILE_Skip( record_size ) )
|
||||
if ( record_size > 0 && FT_STREAM_SKIP( record_size ) )
|
||||
goto Exit;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -186,13 +186,13 @@
|
|||
|
||||
|
||||
if ( ALLOC_ARRAY ( glyph_indices, num_glyphs, FT_UShort ) ||
|
||||
ACCESS_Frame( num_glyphs * 2L ) )
|
||||
FT_FRAME_ENTER( num_glyphs * 2L ) )
|
||||
goto Fail;
|
||||
|
||||
for ( n = 0; n < num_glyphs; n++ )
|
||||
glyph_indices[n] = GET_UShort();
|
||||
|
||||
FORGET_Frame();
|
||||
FT_FRAME_EXIT();
|
||||
}
|
||||
|
||||
/* compute number of names stored in table */
|
||||
|
@ -232,7 +232,7 @@
|
|||
|
||||
if ( READ_Byte ( len ) ||
|
||||
ALLOC_ARRAY( name_strings[n], len + 1, FT_Char ) ||
|
||||
FILE_Read ( name_strings[n], len ) )
|
||||
FT_STREAM_READ ( name_strings[n], len ) )
|
||||
goto Fail1;
|
||||
|
||||
name_strings[n][len] = '\0';
|
||||
|
@ -293,7 +293,7 @@
|
|||
}
|
||||
|
||||
if ( ALLOC ( offset_table, num_glyphs ) ||
|
||||
FILE_Read( offset_table, num_glyphs ) )
|
||||
FT_STREAM_READ( offset_table, num_glyphs ) )
|
||||
goto Fail;
|
||||
|
||||
/* now check the offset table */
|
||||
|
@ -352,7 +352,7 @@
|
|||
format = face->postscript.FormatType;
|
||||
|
||||
/* go to beginning of subtable */
|
||||
if ( FILE_Skip( 32 ) )
|
||||
if ( FT_STREAM_SKIP( 32 ) )
|
||||
goto Exit;
|
||||
|
||||
/* now read postscript table */
|
||||
|
|
|
@ -231,7 +231,7 @@
|
|||
if ( READ_ULong( range->image_size ) )
|
||||
return error;
|
||||
|
||||
return READ_Fields( sbit_metrics_fields, &range->metrics );
|
||||
return FT_STREAM_READ_FIELDS( sbit_metrics_fields, &range->metrics );
|
||||
}
|
||||
|
||||
|
||||
|
@ -281,7 +281,7 @@
|
|||
|
||||
/* Allocate glyph codes table and access frame */
|
||||
if ( ALLOC_ARRAY ( range->glyph_codes, count, FT_UShort ) ||
|
||||
ACCESS_Frame( size ) )
|
||||
FT_FRAME_ENTER( size ) )
|
||||
goto Exit;
|
||||
|
||||
for ( n = 0; n < count; n++ )
|
||||
|
@ -293,7 +293,7 @@
|
|||
GET_UShort();
|
||||
}
|
||||
|
||||
FORGET_Frame();
|
||||
FT_FRAME_EXIT();
|
||||
|
||||
Exit:
|
||||
return error;
|
||||
|
@ -342,14 +342,14 @@
|
|||
|
||||
if ( ALLOC_ARRAY( range->glyph_offsets,
|
||||
num_glyphs, FT_ULong ) ||
|
||||
ACCESS_Frame( num_glyphs * size_elem ) )
|
||||
FT_FRAME_ENTER( num_glyphs * size_elem ) )
|
||||
goto Exit;
|
||||
|
||||
for ( n = 0; n < num_glyphs; n++ )
|
||||
range->glyph_offsets[n] = (FT_ULong)( range->image_offset +
|
||||
( large ? GET_ULong()
|
||||
: GET_UShort() ) );
|
||||
FORGET_Frame();
|
||||
FT_FRAME_EXIT();
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -459,14 +459,14 @@
|
|||
if ( error )
|
||||
goto Exit;
|
||||
|
||||
table_base = FILE_Pos();
|
||||
if ( ACCESS_Frame( 8L ) )
|
||||
table_base = FT_STREAM_POS();
|
||||
if ( FT_FRAME_ENTER( 8L ) )
|
||||
goto Exit;
|
||||
|
||||
version = GET_Long();
|
||||
num_strikes = GET_ULong();
|
||||
|
||||
FORGET_Frame();
|
||||
FT_FRAME_EXIT();
|
||||
|
||||
/* check version number and strike count */
|
||||
if ( version != 0x00020000L ||
|
||||
|
@ -490,22 +490,22 @@
|
|||
FT_ULong count = num_strikes;
|
||||
|
||||
|
||||
if ( ACCESS_Frame( 48L * num_strikes ) )
|
||||
if ( FT_FRAME_ENTER( 48L * num_strikes ) )
|
||||
goto Exit;
|
||||
|
||||
while ( count > 0 )
|
||||
{
|
||||
if ( READ_Fields( strike_start_fields, strike ) ||
|
||||
READ_Fields( sbit_line_metrics_fields, &strike->hori ) ||
|
||||
READ_Fields( sbit_line_metrics_fields, &strike->vert ) ||
|
||||
READ_Fields( strike_end_fields, strike ) )
|
||||
if ( FT_STREAM_READ_FIELDS( strike_start_fields, strike ) ||
|
||||
FT_STREAM_READ_FIELDS( sbit_line_metrics_fields, &strike->hori ) ||
|
||||
FT_STREAM_READ_FIELDS( sbit_line_metrics_fields, &strike->vert ) ||
|
||||
FT_STREAM_READ_FIELDS( strike_end_fields, strike ) )
|
||||
break;
|
||||
|
||||
count--;
|
||||
strike++;
|
||||
}
|
||||
|
||||
FORGET_Frame();
|
||||
FT_FRAME_EXIT();
|
||||
}
|
||||
|
||||
/* allocate the index ranges for each strike table */
|
||||
|
@ -526,8 +526,8 @@
|
|||
goto Exit;
|
||||
|
||||
/* read each range */
|
||||
if ( FILE_Seek( table_base + strike->ranges_offset ) ||
|
||||
ACCESS_Frame( strike->num_ranges * 8L ) )
|
||||
if ( FT_STREAM_SEEK( table_base + strike->ranges_offset ) ||
|
||||
FT_FRAME_ENTER( strike->num_ranges * 8L ) )
|
||||
goto Exit;
|
||||
|
||||
range = strike->sbit_ranges;
|
||||
|
@ -541,7 +541,7 @@
|
|||
range++;
|
||||
}
|
||||
|
||||
FORGET_Frame();
|
||||
FT_FRAME_EXIT();
|
||||
|
||||
/* Now, read each index table */
|
||||
count2 = strike->num_ranges;
|
||||
|
@ -549,15 +549,15 @@
|
|||
while ( count2 > 0 )
|
||||
{
|
||||
/* Read the header */
|
||||
if ( FILE_Seek( range->table_offset ) ||
|
||||
ACCESS_Frame( 8L ) )
|
||||
if ( FT_STREAM_SEEK( range->table_offset ) ||
|
||||
FT_FRAME_ENTER( 8L ) )
|
||||
goto Exit;
|
||||
|
||||
range->index_format = GET_UShort();
|
||||
range->image_format = GET_UShort();
|
||||
range->image_offset = GET_ULong();
|
||||
|
||||
FORGET_Frame();
|
||||
FT_FRAME_EXIT();
|
||||
|
||||
error = Load_SBit_Range( range, stream );
|
||||
if ( error )
|
||||
|
@ -879,7 +879,7 @@
|
|||
|
||||
|
||||
/* read small metrics */
|
||||
if ( READ_Fields( sbit_small_metrics_fields, &smetrics ) )
|
||||
if ( FT_STREAM_READ_FIELDS( sbit_small_metrics_fields, &smetrics ) )
|
||||
goto Exit;
|
||||
|
||||
/* convert it to a big metrics */
|
||||
|
@ -901,7 +901,7 @@
|
|||
case 7:
|
||||
case 9:
|
||||
/* variable big metrics */
|
||||
if ( READ_Fields( sbit_metrics_fields, metrics ) )
|
||||
if ( FT_STREAM_READ_FIELDS( sbit_metrics_fields, metrics ) )
|
||||
goto Exit;
|
||||
break;
|
||||
|
||||
|
@ -1186,7 +1186,7 @@
|
|||
}
|
||||
|
||||
/* Now read data and draw glyph into target pixmap */
|
||||
if ( ACCESS_Frame( glyph_size ) )
|
||||
if ( FT_FRAME_ENTER( glyph_size ) )
|
||||
goto Exit;
|
||||
|
||||
/* don't forget to multiply `x_offset' by `map->pix_bits' as */
|
||||
|
@ -1195,7 +1195,7 @@
|
|||
blit_sbit( map, (FT_Byte*)stream->cursor, line_bits, pad_bytes,
|
||||
x_offset * pix_bits, y_offset );
|
||||
|
||||
FORGET_Frame();
|
||||
FT_FRAME_EXIT();
|
||||
}
|
||||
|
||||
Exit:
|
||||
|
@ -1219,7 +1219,7 @@
|
|||
|
||||
|
||||
/* place stream at beginning of glyph data and read metrics */
|
||||
if ( FILE_Seek( ebdt_pos + glyph_offset ) )
|
||||
if ( FT_STREAM_SEEK( ebdt_pos + glyph_offset ) )
|
||||
goto Exit;
|
||||
|
||||
error = Load_SBit_Metrics( stream, range, metrics );
|
||||
|
@ -1309,7 +1309,7 @@
|
|||
|
||||
count = num_components;
|
||||
|
||||
if ( ACCESS_Frame( 4L * num_components ) )
|
||||
if ( FT_FRAME_ENTER( 4L * num_components ) )
|
||||
goto Fail_Memory;
|
||||
|
||||
for ( comp = components; count > 0; count--, comp++ )
|
||||
|
@ -1319,7 +1319,7 @@
|
|||
comp->y_offset = GET_Char();
|
||||
}
|
||||
|
||||
FORGET_Frame();
|
||||
FT_FRAME_EXIT();
|
||||
|
||||
/* Now recursively load each element glyph */
|
||||
count = num_components;
|
||||
|
@ -1426,7 +1426,7 @@
|
|||
if (error)
|
||||
goto Exit;
|
||||
|
||||
ebdt_pos = FILE_Pos();
|
||||
ebdt_pos = FT_STREAM_POS();
|
||||
|
||||
/* clear the bitmap & load the bitmap */
|
||||
if ( face->root.glyph->flags & FT_GLYPH_OWN_BITMAP )
|
||||
|
|
|
@ -217,7 +217,7 @@
|
|||
FT_TRACE5(( "Glyph %ld\n", glyph_index ));
|
||||
|
||||
/* the following line sets the `error' variable through macros! */
|
||||
if ( FILE_Seek( offset ) || ACCESS_Frame( byte_count ) )
|
||||
if ( FT_STREAM_SEEK( offset ) || FT_FRAME_ENTER( byte_count ) )
|
||||
return error;
|
||||
|
||||
return TT_Err_Ok;
|
||||
|
@ -230,7 +230,7 @@
|
|||
FT_Stream stream = loader->stream;
|
||||
|
||||
|
||||
FORGET_Frame();
|
||||
FT_FRAME_EXIT();
|
||||
}
|
||||
|
||||
|
||||
|
@ -561,11 +561,11 @@
|
|||
|
||||
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
|
||||
{
|
||||
/* we must undo the ACCESS_Frame in order to point to the */
|
||||
/* we must undo the FT_FRAME_ENTER in order to point to the */
|
||||
/* composite instructions, if we find some. */
|
||||
/* we will process them later... */
|
||||
/* */
|
||||
loader->ins_pos = (FT_ULong)( FILE_Pos() +
|
||||
loader->ins_pos = (FT_ULong)( FT_STREAM_POS() +
|
||||
stream->cursor - stream->limit );
|
||||
}
|
||||
#endif
|
||||
|
@ -1108,7 +1108,7 @@
|
|||
|
||||
|
||||
/* read size of instructions */
|
||||
if ( FILE_Seek( ins_pos ) ||
|
||||
if ( FT_STREAM_SEEK( ins_pos ) ||
|
||||
READ_UShort( n_ins ) )
|
||||
goto Fail;
|
||||
FT_TRACE5(( " Instructions size = %d\n", n_ins ));
|
||||
|
@ -1127,7 +1127,7 @@
|
|||
}
|
||||
|
||||
/* read the instructions */
|
||||
if ( FILE_Read( exec->glyphIns, n_ins ) )
|
||||
if ( FT_STREAM_READ( exec->glyphIns, n_ins ) )
|
||||
goto Fail;
|
||||
|
||||
glyph->control_data = exec->glyphIns;
|
||||
|
@ -1564,7 +1564,7 @@
|
|||
loader.glyph = (FT_GlyphSlot)glyph;
|
||||
loader.stream = stream;
|
||||
|
||||
loader.glyf_offset = FILE_Pos();
|
||||
loader.glyf_offset = FT_STREAM_POS();
|
||||
|
||||
#ifdef TT_CONFIG_OPTION_BYTECODE_INTERPRETER
|
||||
|
||||
|
|
|
@ -171,7 +171,7 @@
|
|||
goto Bad_Format;
|
||||
|
||||
/* create input stream from resource */
|
||||
if ( FILE_Seek( 0 ) )
|
||||
if ( FT_STREAM_SEEK( 0 ) )
|
||||
goto Exit;
|
||||
|
||||
/* check that we have a valid TrueType file */
|
||||
|
@ -249,8 +249,8 @@
|
|||
face->cvt_size = 0;
|
||||
|
||||
/* freeing the programs */
|
||||
RELEASE_Frame( face->font_program );
|
||||
RELEASE_Frame( face->cvt_program );
|
||||
FT_FRAME_RELEASE( face->font_program );
|
||||
FT_FRAME_RELEASE( face->cvt_program );
|
||||
face->font_program_size = 0;
|
||||
face->cvt_program_size = 0;
|
||||
}
|
||||
|
|
|
@ -85,7 +85,7 @@
|
|||
FT_Long ) )
|
||||
goto Exit;
|
||||
|
||||
if ( ACCESS_Frame( face->num_locations * 4L ) )
|
||||
if ( FT_FRAME_ENTER( face->num_locations * 4L ) )
|
||||
goto Exit;
|
||||
|
||||
{
|
||||
|
@ -97,7 +97,7 @@
|
|||
*loc = GET_Long();
|
||||
}
|
||||
|
||||
FORGET_Frame();
|
||||
FT_FRAME_EXIT();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -110,7 +110,7 @@
|
|||
FT_Long ) )
|
||||
goto Exit;
|
||||
|
||||
if ( ACCESS_Frame( face->num_locations * 2L ) )
|
||||
if ( FT_FRAME_ENTER( face->num_locations * 2L ) )
|
||||
goto Exit;
|
||||
{
|
||||
FT_Long* loc = face->glyph_locations;
|
||||
|
@ -120,7 +120,7 @@
|
|||
for ( ; loc < limit; loc++ )
|
||||
*loc = (FT_Long)( (FT_ULong)GET_UShort() * 2 );
|
||||
}
|
||||
FORGET_Frame();
|
||||
FT_FRAME_EXIT();
|
||||
}
|
||||
|
||||
FT_TRACE2(( "loaded\n" ));
|
||||
|
@ -177,7 +177,7 @@
|
|||
FT_Short ) )
|
||||
goto Exit;
|
||||
|
||||
if ( ACCESS_Frame( face->cvt_size * 2L ) )
|
||||
if ( FT_FRAME_ENTER( face->cvt_size * 2L ) )
|
||||
goto Exit;
|
||||
|
||||
{
|
||||
|
@ -189,7 +189,7 @@
|
|||
*cur = GET_Short();
|
||||
}
|
||||
|
||||
FORGET_Frame();
|
||||
FT_FRAME_EXIT();
|
||||
FT_TRACE2(( "loaded\n" ));
|
||||
|
||||
Exit:
|
||||
|
@ -236,7 +236,7 @@
|
|||
else
|
||||
{
|
||||
face->font_program_size = table_len;
|
||||
if ( EXTRACT_Frame( table_len, face->font_program ) )
|
||||
if ( FT_FRAME_EXTRACT( table_len, face->font_program ) )
|
||||
goto Exit;
|
||||
|
||||
FT_TRACE2(( "loaded, %12d bytes\n", face->font_program_size ));
|
||||
|
@ -256,7 +256,7 @@
|
|||
else
|
||||
{
|
||||
face->cvt_program_size = table_len;
|
||||
if ( EXTRACT_Frame( table_len, face->cvt_program ) )
|
||||
if ( FT_FRAME_EXTRACT( table_len, face->cvt_program ) )
|
||||
goto Exit;
|
||||
|
||||
FT_TRACE2(( "loaded, %12d bytes\n", face->cvt_program_size ));
|
||||
|
|
|
@ -171,7 +171,7 @@
|
|||
T1_AFM* afm = 0;
|
||||
|
||||
|
||||
if ( ACCESS_Frame( stream->size ) )
|
||||
if ( FT_FRAME_ENTER( stream->size ) )
|
||||
return error;
|
||||
|
||||
start = (FT_Byte*)stream->cursor;
|
||||
|
@ -237,7 +237,7 @@
|
|||
if ( error )
|
||||
FREE( afm );
|
||||
|
||||
FORGET_Frame();
|
||||
FT_FRAME_EXIT();
|
||||
|
||||
return error;
|
||||
}
|
||||
|
|
|
@ -106,7 +106,7 @@
|
|||
|
||||
*tag = 0;
|
||||
*size = 0;
|
||||
if ( !READ_Fields( pfb_tag_fields, &head ) )
|
||||
if ( !FT_STREAM_READ_FIELDS( pfb_tag_fields, &head ) )
|
||||
{
|
||||
if ( head.tag == 0x8001 || head.tag == 0x8002 )
|
||||
{
|
||||
|
@ -158,7 +158,7 @@
|
|||
|
||||
/* try to compute the size of the base dictionary; */
|
||||
/* look for a Postscript binary file tag, i.e 0x8001 */
|
||||
if ( FILE_Seek( 0L ) )
|
||||
if ( FT_STREAM_SEEK( 0L ) )
|
||||
goto Exit;
|
||||
|
||||
error = read_pfb_tag( stream, &tag, &size );
|
||||
|
@ -169,7 +169,7 @@
|
|||
{
|
||||
/* assume that this is a PFA file for now; an error will */
|
||||
/* be produced later when more things are checked */
|
||||
if ( FILE_Seek( 0L ) )
|
||||
if ( FT_STREAM_SEEK( 0L ) )
|
||||
goto Exit;
|
||||
size = stream->size;
|
||||
}
|
||||
|
@ -187,14 +187,14 @@
|
|||
parser->in_memory = 1;
|
||||
|
||||
/* check that the `size' field is valid */
|
||||
if ( FILE_Skip( size ) )
|
||||
if ( FT_STREAM_SKIP( size ) )
|
||||
goto Exit;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* read segment in memory */
|
||||
if ( ALLOC( parser->base_dict, size ) ||
|
||||
FILE_Read( parser->base_dict, size ) )
|
||||
FT_STREAM_READ( parser->base_dict, size ) )
|
||||
goto Exit;
|
||||
parser->base_len = size;
|
||||
}
|
||||
|
@ -283,7 +283,7 @@
|
|||
/* 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. */
|
||||
FT_Long start_pos = FILE_Pos();
|
||||
FT_Long start_pos = FT_STREAM_POS();
|
||||
FT_UShort tag;
|
||||
|
||||
|
||||
|
@ -299,7 +299,7 @@
|
|||
|
||||
parser->private_len += size;
|
||||
|
||||
if ( FILE_Skip( size ) )
|
||||
if ( FT_STREAM_SKIP( size ) )
|
||||
goto Fail;
|
||||
}
|
||||
|
||||
|
@ -313,7 +313,7 @@
|
|||
goto Fail;
|
||||
}
|
||||
|
||||
if ( FILE_Seek( start_pos ) ||
|
||||
if ( FT_STREAM_SEEK( start_pos ) ||
|
||||
ALLOC( parser->private_dict, parser->private_len ) )
|
||||
goto Fail;
|
||||
|
||||
|
@ -327,7 +327,7 @@
|
|||
break;
|
||||
}
|
||||
|
||||
if ( FILE_Read( parser->private_dict + parser->private_len, size ) )
|
||||
if ( FT_STREAM_READ( parser->private_dict + parser->private_len, size ) )
|
||||
goto Fail;
|
||||
|
||||
parser->private_len += size;
|
||||
|
|
|
@ -116,7 +116,7 @@
|
|||
FT_Stream stream )
|
||||
{
|
||||
if ( font->fnt_frame )
|
||||
RELEASE_Frame( font->fnt_frame );
|
||||
FT_FRAME_RELEASE( font->fnt_frame );
|
||||
|
||||
font->fnt_size = 0;
|
||||
font->fnt_frame = 0;
|
||||
|
@ -132,8 +132,8 @@
|
|||
|
||||
|
||||
/* first of all, read the FNT header */
|
||||
if ( FILE_Seek( font->offset ) ||
|
||||
READ_Fields( winfnt_header_fields, header ) )
|
||||
if ( FT_STREAM_SEEK( font->offset ) ||
|
||||
FT_STREAM_READ_FIELDS( winfnt_header_fields, header ) )
|
||||
goto Exit;
|
||||
|
||||
/* check header */
|
||||
|
@ -157,8 +157,8 @@
|
|||
header->pixel_width = header->pixel_height;
|
||||
|
||||
/* this is a FNT file/table, we now extract its frame */
|
||||
if ( FILE_Seek( font->offset ) ||
|
||||
EXTRACT_Frame( header->file_size, font->fnt_frame ) )
|
||||
if ( FT_STREAM_SEEK( font->offset ) ||
|
||||
FT_FRAME_EXTRACT( header->file_size, font->fnt_frame ) )
|
||||
goto Exit;
|
||||
|
||||
Exit:
|
||||
|
@ -196,8 +196,8 @@
|
|||
face->num_fonts = 0;
|
||||
|
||||
/* does it begin with a MZ header? */
|
||||
if ( FILE_Seek( 0 ) ||
|
||||
READ_Fields( winmz_header_fields, &mz_header ) )
|
||||
if ( FT_STREAM_SEEK( 0 ) ||
|
||||
FT_STREAM_READ_FIELDS( winmz_header_fields, &mz_header ) )
|
||||
goto Exit;
|
||||
|
||||
error = FNT_Err_Unknown_File_Format;
|
||||
|
@ -207,8 +207,8 @@
|
|||
WinNE_HeaderRec ne_header;
|
||||
|
||||
|
||||
if ( FILE_Seek( mz_header.lfanew ) ||
|
||||
READ_Fields( winne_header_fields, &ne_header ) )
|
||||
if ( FT_STREAM_SEEK( mz_header.lfanew ) ||
|
||||
FT_STREAM_READ_FIELDS( winne_header_fields, &ne_header ) )
|
||||
goto Exit;
|
||||
|
||||
error = FNT_Err_Unknown_File_Format;
|
||||
|
@ -223,8 +223,8 @@
|
|||
FT_ULong font_offset = 0;
|
||||
|
||||
|
||||
if ( FILE_Seek( res_offset ) ||
|
||||
ACCESS_Frame( ne_header.rname_tab_offset -
|
||||
if ( FT_STREAM_SEEK( res_offset ) ||
|
||||
FT_FRAME_ENTER( ne_header.rname_tab_offset -
|
||||
ne_header.resource_tab_offset ) )
|
||||
goto Exit;
|
||||
|
||||
|
@ -244,14 +244,14 @@
|
|||
if ( type_id == 0x8008 )
|
||||
{
|
||||
font_count = count;
|
||||
font_offset = (FT_ULong)( FILE_Pos() + 4 +
|
||||
font_offset = (FT_ULong)( FT_STREAM_POS() + 4 +
|
||||
( stream->cursor - stream->limit ) );
|
||||
break;
|
||||
}
|
||||
|
||||
stream->cursor += 4 + count * 12;
|
||||
}
|
||||
FORGET_Frame();
|
||||
FT_FRAME_EXIT();
|
||||
|
||||
if ( !font_count || !font_offset )
|
||||
{
|
||||
|
@ -260,13 +260,13 @@
|
|||
goto Exit;
|
||||
}
|
||||
|
||||
if ( FILE_Seek( font_offset ) ||
|
||||
if ( FT_STREAM_SEEK( font_offset ) ||
|
||||
ALLOC_ARRAY( face->fonts, font_count, FNT_FontRec ) )
|
||||
goto Exit;
|
||||
|
||||
face->num_fonts = font_count;
|
||||
|
||||
if ( ACCESS_Frame( (FT_Long)font_count * 12 ) )
|
||||
if ( FT_FRAME_ENTER( (FT_Long)font_count * 12 ) )
|
||||
goto Exit;
|
||||
|
||||
/* now read the offset and position of each FNT font */
|
||||
|
@ -283,7 +283,7 @@
|
|||
stream->cursor += 8;
|
||||
}
|
||||
}
|
||||
FORGET_Frame();
|
||||
FT_FRAME_EXIT();
|
||||
|
||||
/* finally, try to load each font there */
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue