diff options
Diffstat (limited to 'Build/source/libs/freetype2/freetype-src/src/pcf/pcfread.c')
-rw-r--r-- | Build/source/libs/freetype2/freetype-src/src/pcf/pcfread.c | 82 |
1 files changed, 39 insertions, 43 deletions
diff --git a/Build/source/libs/freetype2/freetype-src/src/pcf/pcfread.c b/Build/source/libs/freetype2/freetype-src/src/pcf/pcfread.c index 8817682cdfb..060554ae46a 100644 --- a/Build/source/libs/freetype2/freetype-src/src/pcf/pcfread.c +++ b/Build/source/libs/freetype2/freetype-src/src/pcf/pcfread.c @@ -127,7 +127,7 @@ THE SOFTWARE. toc->count = FT_MIN( stream->size >> 4, 9 ); } - if ( FT_NEW_ARRAY( face->toc.tables, toc->count ) ) + if ( FT_QNEW_ARRAY( face->toc.tables, toc->count ) ) return error; tables = face->toc.tables; @@ -501,8 +501,8 @@ THE SOFTWARE. if ( FT_READ_ULONG_LE( format ) ) goto Bail; - FT_TRACE4(( "pcf_get_properties:\n" - " format: 0x%lX (%s)\n", + FT_TRACE4(( "pcf_get_properties:\n" )); + FT_TRACE4(( " format: 0x%lX (%s)\n", format, PCF_BYTE_ORDER( format ) == MSBFirst ? "MSB" : "LSB" )); @@ -540,7 +540,7 @@ THE SOFTWARE. face->nprops = (int)nprops; - if ( FT_NEW_ARRAY( props, nprops ) ) + if ( FT_QNEW_ARRAY( props, nprops ) ) goto Bail; for ( i = 0; i < nprops; i++ ) @@ -607,14 +607,13 @@ THE SOFTWARE. } /* allocate one more byte so that we have a final null byte */ - if ( FT_NEW_ARRAY( strings, string_size + 1 ) ) + if ( FT_QALLOC( strings, string_size + 1 ) || + FT_STREAM_READ( strings, string_size ) ) goto Bail; - error = FT_Stream_Read( stream, (FT_Byte*)strings, string_size ); - if ( error ) - goto Bail; + strings[string_size] = '\0'; - if ( FT_NEW_ARRAY( properties, nprops ) ) + if ( FT_QNEW_ARRAY( properties, nprops ) ) goto Bail; face->properties = properties; @@ -697,8 +696,8 @@ THE SOFTWARE. if ( FT_READ_ULONG_LE( format ) ) goto Bail; - FT_TRACE4(( "pcf_get_metrics:\n" - " format: 0x%lX (%s, %s)\n", + FT_TRACE4(( "pcf_get_metrics:\n" )); + FT_TRACE4(( " format: 0x%lX (%s, %s)\n", format, PCF_BYTE_ORDER( format ) == MSBFirst ? "MSB" : "LSB", PCF_FORMAT_MATCH( format, PCF_COMPRESSED_METRICS ) ? @@ -767,7 +766,7 @@ THE SOFTWARE. face->nmetrics = nmetrics + 1; - if ( FT_NEW_ARRAY( face->metrics, face->nmetrics ) ) + if ( FT_QNEW_ARRAY( face->metrics, face->nmetrics ) ) return error; /* we handle glyph index 0 later on */ @@ -840,17 +839,16 @@ THE SOFTWARE. FT_Stream_ExitFrame( stream ); - FT_TRACE4(( "pcf_get_bitmaps:\n" - " format: 0x%lX\n" - " (%s, %s,\n" - " padding=%d bit%s, scanning=%d bit%s)\n", - format, + FT_TRACE4(( "pcf_get_bitmaps:\n" )); + FT_TRACE4(( " format: 0x%lX\n", format )); + FT_TRACE4(( " (%s, %s,\n", PCF_BYTE_ORDER( format ) == MSBFirst ? "most significant byte first" : "least significant byte first", PCF_BIT_ORDER( format ) == MSBFirst ? "most significant bit first" - : "least significant bit first", + : "least significant bit first" )); + FT_TRACE4(( " padding=%d bit%s, scanning=%d bit%s)\n", 8 << PCF_GLYPH_PAD_INDEX( format ), ( 8 << PCF_GLYPH_PAD_INDEX( format ) ) == 1 ? "" : "s", 8 << PCF_SCAN_UNIT_INDEX( format ), @@ -1001,8 +999,8 @@ THE SOFTWARE. if ( FT_READ_ULONG_LE( format ) ) goto Bail; - FT_TRACE4(( "pcf_get_encodings:\n" - " format: 0x%lX (%s)\n", + FT_TRACE4(( "pcf_get_encodings:\n" )); + FT_TRACE4(( " format: 0x%lX (%s)\n", format, PCF_BYTE_ORDER( format ) == MSBFirst ? "MSB" : "LSB" )); @@ -1021,11 +1019,11 @@ THE SOFTWARE. goto Bail; } - FT_TRACE4(( " firstCol 0x%X, lastCol 0x%X\n" - " firstRow 0x%X, lastRow 0x%X\n" - " defaultChar 0x%X\n", - enc->firstCol, enc->lastCol, - enc->firstRow, enc->lastRow, + FT_TRACE4(( " firstCol 0x%X, lastCol 0x%X\n", + enc->firstCol, enc->lastCol )); + FT_TRACE4(( " firstRow 0x%X, lastRow 0x%X\n", + enc->firstRow, enc->lastRow )); + FT_TRACE4(( " defaultChar 0x%X\n", enc->defaultChar )); /* sanity checks; we limit numbers of rows and columns to 256 */ @@ -1088,8 +1086,8 @@ THE SOFTWARE. if ( defaultCharEncodingOffset == 0xFFFF ) { FT_TRACE0(( "pcf_get_encodings:" - " No glyph for default character,\n" - " " + " No glyph for default character,\n" )); + FT_TRACE0(( " " " setting it to the first glyph of the font\n" )); defaultCharEncodingOffset = 1; } @@ -1100,8 +1098,8 @@ THE SOFTWARE. if ( defaultCharEncodingOffset >= face->nmetrics ) { FT_TRACE0(( "pcf_get_encodings:" - " Invalid glyph index for default character,\n" - " " + " Invalid glyph index for default character,\n" )); + FT_TRACE0(( " " " setting it to the first glyph of the font\n" )); defaultCharEncodingOffset = 1; } @@ -1208,10 +1206,10 @@ THE SOFTWARE. if ( FT_READ_ULONG_LE( format ) ) goto Bail; - FT_TRACE4(( "pcf_get_accel%s:\n" - " format: 0x%lX (%s, %s)\n", + FT_TRACE4(( "pcf_get_accel%s:\n", type == PCF_BDF_ACCELERATORS ? " (getting BDF accelerators)" - : "", + : "" )); + FT_TRACE4(( " format: 0x%lX (%s, %s)\n", format, PCF_BYTE_ORDER( format ) == MSBFirst ? "MSB" : "LSB", PCF_FORMAT_MATCH( format, PCF_ACCEL_W_INKBOUNDS ) ? @@ -1233,16 +1231,16 @@ THE SOFTWARE. } FT_TRACE5(( " noOverlap=%s, constantMetrics=%s," - " terminalFont=%s, constantWidth=%s\n" - " inkInside=%s, inkMetrics=%s, drawDirection=%s\n" - " fontAscent=%ld, fontDescent=%ld, maxOverlap=%ld\n", + " terminalFont=%s, constantWidth=%s\n", accel->noOverlap ? "yes" : "no", accel->constantMetrics ? "yes" : "no", accel->terminalFont ? "yes" : "no", - accel->constantWidth ? "yes" : "no", + accel->constantWidth ? "yes" : "no" )); + FT_TRACE5(( " inkInside=%s, inkMetrics=%s, drawDirection=%s\n", accel->inkInside ? "yes" : "no", accel->inkMetrics ? "yes" : "no", - accel->drawDirection ? "RTL" : "LTR", + accel->drawDirection ? "RTL" : "LTR" )); + FT_TRACE5(( " fontAscent=%ld, fontDescent=%ld, maxOverlap=%ld\n", accel->fontAscent, accel->fontDescent, accel->maxOverlap )); @@ -1369,7 +1367,7 @@ THE SOFTWARE. char* s; - if ( FT_ALLOC( face->style_name, len ) ) + if ( FT_QALLOC( face->style_name, len ) ) return error; s = face->style_name; @@ -1533,7 +1531,7 @@ THE SOFTWARE. { l += ft_strlen( foundry_prop->value.atom ) + 1; - if ( FT_NEW_ARRAY( root->family_name, l ) ) + if ( FT_QALLOC( root->family_name, l ) ) goto Exit; ft_strcpy( root->family_name, foundry_prop->value.atom ); @@ -1542,7 +1540,7 @@ THE SOFTWARE. } else { - if ( FT_NEW_ARRAY( root->family_name, l ) ) + if ( FT_QALLOC( root->family_name, l ) ) goto Exit; ft_strcpy( root->family_name, prop->value.atom ); @@ -1566,7 +1564,7 @@ THE SOFTWARE. root->num_glyphs = (FT_Long)face->nmetrics; root->num_fixed_sizes = 1; - if ( FT_NEW_ARRAY( root->available_sizes, 1 ) ) + if ( FT_NEW( root->available_sizes ) ) goto Exit; { @@ -1574,8 +1572,6 @@ THE SOFTWARE. FT_Short resolution_x = 0, resolution_y = 0; - FT_ZERO( bsize ); - /* for simplicity, we take absolute values of integer properties */ #if 0 |