|
|
|
@ -178,7 +178,7 @@ |
|
|
|
|
/* create a memory-based stream */ |
|
|
|
|
FT_Stream_OpenMemory( stream, |
|
|
|
|
(const FT_Byte*)args->memory_base, |
|
|
|
|
args->memory_size ); |
|
|
|
|
(FT_ULong)args->memory_size ); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
#ifndef FT_CONFIG_OPTION_DISABLE_STREAM_SUPPORT |
|
|
|
@ -1487,7 +1487,7 @@ |
|
|
|
|
FT_Error error; |
|
|
|
|
FT_Memory memory = library->memory; |
|
|
|
|
FT_ULong offset, length; |
|
|
|
|
FT_Long pos; |
|
|
|
|
FT_ULong pos; |
|
|
|
|
FT_Bool is_sfnt_cid; |
|
|
|
|
FT_Byte* sfnt_ps = NULL; |
|
|
|
|
|
|
|
|
@ -1495,7 +1495,7 @@ |
|
|
|
|
FT_UNUSED( params ); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
pos = FT_Stream_Pos( stream ); |
|
|
|
|
pos = (FT_ULong)FT_Stream_Pos( stream ); |
|
|
|
|
|
|
|
|
|
error = ft_lookup_PS_in_sfnt_stream( stream, |
|
|
|
|
face_index, |
|
|
|
@ -1573,7 +1573,7 @@ |
|
|
|
|
pfb_len = 0; |
|
|
|
|
for ( i = 0; i < resource_cnt; ++i ) |
|
|
|
|
{ |
|
|
|
|
error = FT_Stream_Seek( stream, offsets[i] ); |
|
|
|
|
error = FT_Stream_Seek( stream, (FT_ULong)offsets[i] ); |
|
|
|
|
if ( error ) |
|
|
|
|
goto Exit; |
|
|
|
|
if ( FT_READ_ULONG( temp ) ) |
|
|
|
@ -1620,7 +1620,7 @@ |
|
|
|
|
type = 1; |
|
|
|
|
for ( i = 0; i < resource_cnt; ++i ) |
|
|
|
|
{ |
|
|
|
|
error = FT_Stream_Seek( stream, offsets[i] ); |
|
|
|
|
error = FT_Stream_Seek( stream, (FT_ULong)offsets[i] ); |
|
|
|
|
if ( error ) |
|
|
|
|
goto Exit2; |
|
|
|
|
if ( FT_READ_ULONG( rlen ) ) |
|
|
|
@ -1750,7 +1750,7 @@ |
|
|
|
|
FT_Memory memory = library->memory; |
|
|
|
|
FT_Byte* sfnt_data = NULL; |
|
|
|
|
FT_Error error; |
|
|
|
|
FT_Long flag_offset; |
|
|
|
|
FT_ULong flag_offset; |
|
|
|
|
FT_Long rlen; |
|
|
|
|
int is_cff; |
|
|
|
|
FT_Long face_index_in_resource = 0; |
|
|
|
@ -1761,7 +1761,7 @@ |
|
|
|
|
if ( face_index >= resource_cnt ) |
|
|
|
|
return FT_THROW( Cannot_Open_Resource ); |
|
|
|
|
|
|
|
|
|
flag_offset = offsets[face_index]; |
|
|
|
|
flag_offset = (FT_ULong)offsets[face_index]; |
|
|
|
|
error = FT_Stream_Seek( stream, flag_offset ); |
|
|
|
|
if ( error ) |
|
|
|
|
goto Exit; |
|
|
|
@ -1783,16 +1783,16 @@ |
|
|
|
|
if ( FT_Stream_Seek( stream, flag_offset + 4 ) ) |
|
|
|
|
goto Exit; |
|
|
|
|
|
|
|
|
|
if ( FT_ALLOC( sfnt_data, (FT_Long)rlen ) ) |
|
|
|
|
if ( FT_ALLOC( sfnt_data, rlen ) ) |
|
|
|
|
return error; |
|
|
|
|
error = FT_Stream_Read( stream, (FT_Byte *)sfnt_data, rlen ); |
|
|
|
|
error = FT_Stream_Read( stream, (FT_Byte *)sfnt_data, (FT_ULong)rlen ); |
|
|
|
|
if ( error ) |
|
|
|
|
goto Exit; |
|
|
|
|
|
|
|
|
|
is_cff = rlen > 4 && !ft_memcmp( sfnt_data, "OTTO", 4 ); |
|
|
|
|
error = open_face_from_buffer( library, |
|
|
|
|
sfnt_data, |
|
|
|
|
rlen, |
|
|
|
|
(FT_ULong)rlen, |
|
|
|
|
face_index_in_resource, |
|
|
|
|
is_cff ? "cff" : "truetype", |
|
|
|
|
aface ); |
|
|
|
@ -1930,7 +1930,7 @@ |
|
|
|
|
|
|
|
|
|
FT_Memory memory = library->memory; |
|
|
|
|
FT_Error error = FT_ERR( Unknown_File_Format ); |
|
|
|
|
int i; |
|
|
|
|
FT_UInt i; |
|
|
|
|
|
|
|
|
|
char * file_names[FT_RACCESS_N_RULES]; |
|
|
|
|
FT_Long offsets[FT_RACCESS_N_RULES]; |
|
|
|
@ -3014,14 +3014,14 @@ |
|
|
|
|
pixel_height = 1; |
|
|
|
|
|
|
|
|
|
/* use `>=' to avoid potential compiler warning on 16bit platforms */ |
|
|
|
|
if ( pixel_width >= 0xFFFFU ) |
|
|
|
|
pixel_width = 0xFFFFU; |
|
|
|
|
if ( pixel_width >= 0xFFFFU ) |
|
|
|
|
pixel_width = 0xFFFFU; |
|
|
|
|
if ( pixel_height >= 0xFFFFU ) |
|
|
|
|
pixel_height = 0xFFFFU; |
|
|
|
|
|
|
|
|
|
req.type = FT_SIZE_REQUEST_TYPE_NOMINAL; |
|
|
|
|
req.width = pixel_width << 6; |
|
|
|
|
req.height = pixel_height << 6; |
|
|
|
|
req.width = (FT_Long)( pixel_width << 6 ); |
|
|
|
|
req.height = (FT_Long)( pixel_height << 6 ); |
|
|
|
|
req.horiResolution = 0; |
|
|
|
|
req.vertResolution = 0; |
|
|
|
|
|
|
|
|
@ -4132,15 +4132,17 @@ |
|
|
|
|
MD5_CTX ctx; |
|
|
|
|
unsigned char md5[16]; |
|
|
|
|
int i; |
|
|
|
|
unsigned int rows = bitmap.rows; |
|
|
|
|
unsigned int pitch = (unsigned int)bitmap.pitch; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
MD5_Init( &ctx); |
|
|
|
|
MD5_Update( &ctx, bitmap.buffer, bitmap.rows * bitmap.pitch ); |
|
|
|
|
MD5_Init( &ctx ); |
|
|
|
|
MD5_Update( &ctx, bitmap.buffer, rows * pitch ); |
|
|
|
|
MD5_Final( md5, &ctx ); |
|
|
|
|
|
|
|
|
|
FT_TRACE3(( "MD5 checksum for %dx%d bitmap:\n" |
|
|
|
|
" ", |
|
|
|
|
bitmap.rows, bitmap.pitch )); |
|
|
|
|
rows, pitch )); |
|
|
|
|
for ( i = 0; i < 16; i++ ) |
|
|
|
|
FT_TRACE3(( "%02X", md5[i] )); |
|
|
|
|
FT_TRACE3(( "\n" )); |
|
|
|
|