diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2021-08-29 06:19:44 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2021-08-29 06:19:44 +0000 |
commit | 0de5be92a3a0fe27e8521fc4de67e19b1057842e (patch) | |
tree | e93a390fe965486cca19498840cb8d7904252fec /Build/source/libs/freetype2/freetype-src/src/psaux | |
parent | 27ce96eea3f1190bd744448cfa149e8d767af95a (diff) |
revert freetype to 2.10.4
git-svn-id: svn://tug.org/texlive/trunk@60360 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/freetype2/freetype-src/src/psaux')
24 files changed, 89 insertions, 218 deletions
diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/afmparse.c b/Build/source/libs/freetype2/freetype-src/src/psaux/afmparse.c index 0ad1760518e..2d6a0d9a121 100644 --- a/Build/source/libs/freetype2/freetype-src/src/psaux/afmparse.c +++ b/Build/source/libs/freetype2/freetype-src/src/psaux/afmparse.c @@ -4,7 +4,7 @@ * * AFM parser (body). * - * Copyright (C) 2006-2021 by + * Copyright (C) 2006-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -29,16 +29,6 @@ /************************************************************************** * - * The macro FT_COMPONENT is used in trace mode. It is an implicit - * parameter of the FT_TRACE() and FT_ERROR() macros, used to print/log - * messages during execution. - */ -#undef FT_COMPONENT -#define FT_COMPONENT afmparse - - - /************************************************************************** - * * AFM_Stream * * The use of AFM_Stream is largely inspired by parseAFM.[ch] from t1lib. @@ -596,39 +586,21 @@ static FT_Error afm_parse_track_kern( AFM_Parser parser ) { - AFM_FontInfo fi = parser->FontInfo; - AFM_Stream stream = parser->stream; + AFM_FontInfo fi = parser->FontInfo; AFM_TrackKern tk; - - char* key; - FT_Offset len; - int n = -1; - FT_Int tmp; + char* key; + FT_Offset len; + int n = -1; + FT_Int tmp; if ( afm_parser_read_int( parser, &tmp ) ) goto Fail; if ( tmp < 0 ) - { - FT_ERROR(( "afm_parse_track_kern: invalid number of track kerns\n" )); goto Fail; - } fi->NumTrackKern = (FT_UInt)tmp; - FT_TRACE3(( "afm_parse_track_kern: %u track kern%s expected\n", - fi->NumTrackKern, - fi->NumTrackKern == 1 ? "" : "s" )); - - /* Rough sanity check: The minimum line length of the `TrackKern` */ - /* command is 20 characters (including the EOL character). */ - if ( (FT_ULong)( stream->limit - stream->cursor ) / 20 < - fi->NumTrackKern ) - { - FT_ERROR(( "afm_parse_track_kern:" - " number of track kern entries exceeds stream size\n" )); - goto Fail; - } if ( fi->NumTrackKern ) { @@ -651,10 +623,7 @@ n++; if ( n >= (int)fi->NumTrackKern ) - { - FT_ERROR(( "afm_parse_track_kern: too many track kern data\n" )); - goto Fail; - } + goto Fail; tk = fi->TrackKerns + n; @@ -664,12 +633,7 @@ shared_vals[3].type = AFM_VALUE_TYPE_FIXED; shared_vals[4].type = AFM_VALUE_TYPE_FIXED; if ( afm_parser_read_vals( parser, shared_vals, 5 ) != 5 ) - { - FT_ERROR(( "afm_parse_track_kern:" - " insufficient number of parameters for entry %d\n", - n )); goto Fail; - } tk->degree = shared_vals[0].u.i; tk->min_ptsize = shared_vals[1].u.f; @@ -682,19 +646,7 @@ case AFM_TOKEN_ENDTRACKKERN: case AFM_TOKEN_ENDKERNDATA: case AFM_TOKEN_ENDFONTMETRICS: - tmp = n + 1; - if ( (FT_UInt)tmp != fi->NumTrackKern ) - { - FT_TRACE1(( "afm_parse_track_kern: %s%d track kern entr%s seen\n", - tmp == 0 ? "" : "only ", - tmp, - tmp == 1 ? "y" : "ies" )); - fi->NumTrackKern = (FT_UInt)tmp; - } - else - FT_TRACE3(( "afm_parse_track_kern: %d track kern entr%s seen\n", - tmp, - tmp == 1 ? "y" : "ies" )); + fi->NumTrackKern = (FT_UInt)( n + 1 ); return FT_Err_Ok; case AFM_TOKEN_UNKNOWN: @@ -715,7 +667,7 @@ /* compare two kerning pairs */ - FT_COMPARE_DEF( int ) + FT_CALLBACK_DEF( int ) afm_compare_kern_pairs( const void* a, const void* b ) { @@ -738,8 +690,7 @@ static FT_Error afm_parse_kern_pairs( AFM_Parser parser ) { - AFM_FontInfo fi = parser->FontInfo; - AFM_Stream stream = parser->stream; + AFM_FontInfo fi = parser->FontInfo; AFM_KernPair kp; char* key; FT_Offset len; @@ -751,26 +702,9 @@ goto Fail; if ( tmp < 0 ) - { - FT_ERROR(( "afm_parse_kern_pairs: invalid number of kern pairs\n" )); goto Fail; - } fi->NumKernPair = (FT_UInt)tmp; - FT_TRACE3(( "afm_parse_kern_pairs: %u kern pair%s expected\n", - fi->NumKernPair, - fi->NumKernPair == 1 ? "" : "s" )); - - /* Rough sanity check: The minimum line length of the `KP`, */ - /* `KPH`,`KPX`, and `KPY` commands is 10 characters (including */ - /* the EOL character). */ - if ( (FT_ULong)( stream->limit - stream->cursor ) / 10 < - fi->NumKernPair ) - { - FT_ERROR(( "afm_parse_kern_pairs:" - " number of kern pairs exceeds stream size\n" )); - goto Fail; - } if ( fi->NumKernPair ) { @@ -800,10 +734,7 @@ n++; if ( n >= (int)fi->NumKernPair ) - { - FT_ERROR(( "afm_parse_kern_pairs: too many kern pairs\n" )); goto Fail; - } kp = fi->KernPairs + n; @@ -813,12 +744,7 @@ shared_vals[3].type = AFM_VALUE_TYPE_INTEGER; r = afm_parser_read_vals( parser, shared_vals, 4 ); if ( r < 3 ) - { - FT_ERROR(( "afm_parse_kern_pairs:" - " insufficient number of parameters for entry %d\n", - n )); goto Fail; - } /* index values can't be negative */ kp->index1 = shared_vals[0].u.u; @@ -840,20 +766,7 @@ case AFM_TOKEN_ENDKERNPAIRS: case AFM_TOKEN_ENDKERNDATA: case AFM_TOKEN_ENDFONTMETRICS: - tmp = n + 1; - if ( (FT_UInt)tmp != fi->NumKernPair ) - { - FT_TRACE1(( "afm_parse_kern_pairs: %s%d kern pair%s seen\n", - tmp == 0 ? "" : "only ", - tmp, - tmp == 1 ? "" : "s" )); - fi->NumKernPair = (FT_UInt)tmp; - } - else - FT_TRACE3(( "afm_parse_kern_pairs: %d kern pair%s seen\n", - tmp, - tmp == 1 ? "" : "s" )); - + fi->NumKernPair = (FT_UInt)( n + 1 ); ft_qsort( fi->KernPairs, fi->NumKernPair, sizeof ( AFM_KernPairRec ), afm_compare_kern_pairs ); @@ -879,43 +792,22 @@ char* key; FT_Offset len; - int have_trackkern = 0; - int have_kernpairs = 0; - while ( ( key = afm_parser_next_key( parser, 1, &len ) ) != 0 ) { switch ( afm_tokenize( key, len ) ) { case AFM_TOKEN_STARTTRACKKERN: - if ( have_trackkern ) - { - FT_ERROR(( "afm_parse_kern_data:" - " invalid second horizontal track kern section\n" )); - goto Fail; - } - error = afm_parse_track_kern( parser ); if ( error ) return error; - - have_trackkern = 1; break; case AFM_TOKEN_STARTKERNPAIRS: case AFM_TOKEN_STARTKERNPAIRS0: - if ( have_kernpairs ) - { - FT_ERROR(( "afm_parse_kern_data:" - " invalid second horizontal kern pair section\n" )); - goto Fail; - } - error = afm_parse_kern_pairs( parser ); if ( error ) return error; - - have_kernpairs = 1; break; case AFM_TOKEN_ENDKERNDATA: diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/afmparse.h b/Build/source/libs/freetype2/freetype-src/src/psaux/afmparse.h index 44b05b2cacb..16a3a3e902d 100644 --- a/Build/source/libs/freetype2/freetype-src/src/psaux/afmparse.h +++ b/Build/source/libs/freetype2/freetype-src/src/psaux/afmparse.h @@ -4,7 +4,7 @@ * * AFM parser (specification). * - * Copyright (C) 2006-2021 by + * Copyright (C) 2006-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/cffdecode.c b/Build/source/libs/freetype2/freetype-src/src/psaux/cffdecode.c index 3498f670c79..3d2da1e03ca 100644 --- a/Build/source/libs/freetype2/freetype-src/src/psaux/cffdecode.c +++ b/Build/source/libs/freetype2/freetype-src/src/psaux/cffdecode.c @@ -4,7 +4,7 @@ * * PostScript CFF (Type 2) decoding routines (body). * - * Copyright (C) 2017-2021 by + * Copyright (C) 2017-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -2153,7 +2153,7 @@ decoder->locals_bias ); - FT_TRACE4(( " callsubr (idx %d, entering level %ld)\n", + FT_TRACE4(( " callsubr (idx %d, entering level %d)\n", idx, zone - decoder->zones + 1 )); @@ -2197,7 +2197,7 @@ decoder->globals_bias ); - FT_TRACE4(( " callgsubr (idx %d, entering level %ld)\n", + FT_TRACE4(( " callgsubr (idx %d, entering level %d)\n", idx, zone - decoder->zones + 1 )); @@ -2236,7 +2236,7 @@ break; case cff_op_return: - FT_TRACE4(( " return (leaving level %ld)\n", + FT_TRACE4(( " return (leaving level %d)\n", decoder->zone - decoder->zones )); if ( decoder->zone <= decoder->zones ) @@ -2271,8 +2271,7 @@ } /* while ip < limit */ - FT_TRACE4(( "..end..\n" )); - FT_TRACE4(( "\n" )); + FT_TRACE4(( "..end..\n\n" )); Fail: return error; diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/cffdecode.h b/Build/source/libs/freetype2/freetype-src/src/psaux/cffdecode.h index b1314ed1c1e..77a4962698b 100644 --- a/Build/source/libs/freetype2/freetype-src/src/psaux/cffdecode.h +++ b/Build/source/libs/freetype2/freetype-src/src/psaux/cffdecode.h @@ -4,7 +4,7 @@ * * PostScript CFF (Type 2) decoding routines (specification). * - * Copyright (C) 2017-2021 by + * Copyright (C) 2017-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/module.mk b/Build/source/libs/freetype2/freetype-src/src/psaux/module.mk index 06f7e72c1c9..651db014263 100644 --- a/Build/source/libs/freetype2/freetype-src/src/psaux/module.mk +++ b/Build/source/libs/freetype2/freetype-src/src/psaux/module.mk @@ -3,7 +3,7 @@ # -# Copyright (C) 1996-2021 by +# Copyright (C) 1996-2020 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/psarrst.c b/Build/source/libs/freetype2/freetype-src/src/psaux/psarrst.c index 70313d283a4..8751d275fb9 100644 --- a/Build/source/libs/freetype2/freetype-src/src/psaux/psarrst.c +++ b/Build/source/libs/freetype2/freetype-src/src/psaux/psarrst.c @@ -65,6 +65,7 @@ arrstack->error = error; arrstack->sizeItem = sizeItem; arrstack->allocated = 0; + arrstack->chunk = 10; /* chunks of 10 items */ arrstack->count = 0; arrstack->totalSize = 0; arrstack->ptr = NULL; @@ -109,7 +110,7 @@ FT_ASSERT( newSize > 0 ); /* avoid realloc with zero size */ - if ( !FT_QREALLOC( arrstack->ptr, arrstack->totalSize, newSize ) ) + if ( !FT_REALLOC( arrstack->ptr, arrstack->totalSize, newSize ) ) { arrstack->allocated = numElements; arrstack->totalSize = newSize; @@ -215,9 +216,9 @@ if ( arrstack->count == arrstack->allocated ) { - /* increase the buffer size */ + /* grow the buffer by one chunk */ if ( !cf2_arrstack_setNumElements( - arrstack, arrstack->allocated * 2 + 16 ) ) + arrstack, arrstack->allocated + arrstack->chunk ) ) { /* on error, ignore the push */ return; diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/psarrst.h b/Build/source/libs/freetype2/freetype-src/src/psaux/psarrst.h index 31e5330cc38..098617b2575 100644 --- a/Build/source/libs/freetype2/freetype-src/src/psaux/psarrst.h +++ b/Build/source/libs/freetype2/freetype-src/src/psaux/psarrst.h @@ -55,6 +55,7 @@ FT_BEGIN_HEADER size_t sizeItem; /* bytes per element */ size_t allocated; /* items allocated */ + size_t chunk; /* allocation increment in items */ size_t count; /* number of elements allocated */ size_t totalSize; /* total bytes allocated */ diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/psaux.c b/Build/source/libs/freetype2/freetype-src/src/psaux/psaux.c index 2960c8b696b..f4282222a68 100644 --- a/Build/source/libs/freetype2/freetype-src/src/psaux/psaux.c +++ b/Build/source/libs/freetype2/freetype-src/src/psaux/psaux.c @@ -4,7 +4,7 @@ * * FreeType auxiliary PostScript driver component (body only). * - * Copyright (C) 1996-2021 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/psauxerr.h b/Build/source/libs/freetype2/freetype-src/src/psaux/psauxerr.h index e8ee29166cf..8b9a958aec0 100644 --- a/Build/source/libs/freetype2/freetype-src/src/psaux/psauxerr.h +++ b/Build/source/libs/freetype2/freetype-src/src/psaux/psauxerr.h @@ -4,7 +4,7 @@ * * PS auxiliary module error codes (specification only). * - * Copyright (C) 2001-2021 by + * Copyright (C) 2001-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/psauxmod.c b/Build/source/libs/freetype2/freetype-src/src/psaux/psauxmod.c index 52da23365ed..e73ba224517 100644 --- a/Build/source/libs/freetype2/freetype-src/src/psaux/psauxmod.c +++ b/Build/source/libs/freetype2/freetype-src/src/psaux/psauxmod.c @@ -4,7 +4,7 @@ * * FreeType auxiliary PostScript module implementation (body). * - * Copyright (C) 2000-2021 by + * Copyright (C) 2000-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/psauxmod.h b/Build/source/libs/freetype2/freetype-src/src/psaux/psauxmod.h index e3e80632206..a6bebe4b945 100644 --- a/Build/source/libs/freetype2/freetype-src/src/psaux/psauxmod.h +++ b/Build/source/libs/freetype2/freetype-src/src/psaux/psauxmod.h @@ -4,7 +4,7 @@ * * FreeType auxiliary PostScript module implementation (specification). * - * Copyright (C) 2000-2021 by + * Copyright (C) 2000-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/psblues.c b/Build/source/libs/freetype2/freetype-src/src/psaux/psblues.c index f9c864fea9a..3878e9bde04 100644 --- a/Build/source/libs/freetype2/freetype-src/src/psaux/psblues.c +++ b/Build/source/libs/freetype2/freetype-src/src/psaux/psblues.c @@ -506,8 +506,7 @@ /* guarantee minimum of 1 pixel overshoot */ dsNew = FT_MIN( cf2_fixedRound( bottomHintEdge->dsCoord ), - SUB_INT32( blues->zone[i].dsFlatEdge, - cf2_intToFixed( 1 ) ) ); + blues->zone[i].dsFlatEdge - cf2_intToFixed( 1 ) ); } else diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/psconv.c b/Build/source/libs/freetype2/freetype-src/src/psaux/psconv.c index c28d65df297..4cf5cd5d881 100644 --- a/Build/source/libs/freetype2/freetype-src/src/psaux/psconv.c +++ b/Build/source/libs/freetype2/freetype-src/src/psaux/psconv.c @@ -4,7 +4,7 @@ * * Some convenience conversions (body). * - * Copyright (C) 2006-2021 by + * Copyright (C) 2006-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/psconv.h b/Build/source/libs/freetype2/freetype-src/src/psaux/psconv.h index cd91a7bb563..833e8273648 100644 --- a/Build/source/libs/freetype2/freetype-src/src/psaux/psconv.h +++ b/Build/source/libs/freetype2/freetype-src/src/psaux/psconv.h @@ -4,7 +4,7 @@ * * Some convenience conversions (specification). * - * Copyright (C) 2006-2021 by + * Copyright (C) 2006-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/pshints.c b/Build/source/libs/freetype2/freetype-src/src/psaux/pshints.c index ad472c98df5..ce8cfca7154 100644 --- a/Build/source/libs/freetype2/freetype-src/src/psaux/pshints.c +++ b/Build/source/libs/freetype2/freetype-src/src/psaux/pshints.c @@ -412,12 +412,6 @@ { FT_Bool isPair = cf2_hint_isPair( &hintmap->edge[i] ); - /* final amount to move edge or edge pair */ - CF2_Fixed move = 0; - - CF2_Fixed dsCoord_i; - CF2_Fixed dsCoord_j; - /* index of upper edge (same value for ghost hint) */ j = isPair ? i + 1 : i; @@ -428,14 +422,11 @@ FT_ASSERT( cf2_hint_isLocked( &hintmap->edge[i] ) == cf2_hint_isLocked( &hintmap->edge[j] ) ); - dsCoord_i = hintmap->edge[i].dsCoord; - dsCoord_j = hintmap->edge[j].dsCoord; - if ( !cf2_hint_isLocked( &hintmap->edge[i] ) ) { /* hint edge is not locked, we can adjust it */ - CF2_Fixed fracDown = cf2_fixedFraction( dsCoord_i ); - CF2_Fixed fracUp = cf2_fixedFraction( dsCoord_j ); + CF2_Fixed fracDown = cf2_fixedFraction( hintmap->edge[i].dsCoord ); + CF2_Fixed fracUp = cf2_fixedFraction( hintmap->edge[j].dsCoord ); /* calculate all four possibilities; moves down are negative */ CF2_Fixed downMoveDown = 0 - fracDown; @@ -452,6 +443,9 @@ /* smallest move down */ CF2_Fixed moveDown = FT_MAX( downMoveDown, upMoveDown ); + /* final amount to move edge or edge pair */ + CF2_Fixed move; + CF2_Fixed downMinCounter = CF2_MIN_COUNTER; CF2_Fixed upMinCounter = CF2_MIN_COUNTER; FT_Bool saveEdge = FALSE; @@ -473,14 +467,16 @@ /* is there room to move up? */ /* there is if we are at top of array or the next edge is at or */ /* beyond proposed move up? */ - if ( j >= hintmap->count - 1 || + if ( j >= hintmap->count - 1 || hintmap->edge[j + 1].dsCoord >= - ADD_INT32( dsCoord_j, moveUp + upMinCounter ) ) + ADD_INT32( hintmap->edge[j].dsCoord, + moveUp + upMinCounter ) ) { /* there is room to move up; is there also room to move down? */ - if ( i == 0 || + if ( i == 0 || hintmap->edge[i - 1].dsCoord <= - ADD_INT32( dsCoord_i, moveDown - downMinCounter ) ) + ADD_INT32( hintmap->edge[i].dsCoord, + moveDown - downMinCounter ) ) { /* move smaller absolute amount */ move = ( -moveDown < moveUp ) ? moveDown : moveUp; /* optimum */ @@ -491,9 +487,10 @@ else { /* is there room to move down? */ - if ( i == 0 || + if ( i == 0 || hintmap->edge[i - 1].dsCoord <= - ADD_INT32( dsCoord_i, moveDown - downMinCounter ) ) + ADD_INT32( hintmap->edge[i].dsCoord, + moveDown - downMinCounter ) ) { move = moveDown; /* true if non-optimum move */ @@ -527,21 +524,17 @@ } /* move the edge(s) */ - hintmap->edge[i].dsCoord = ADD_INT32( dsCoord_i, move ); + hintmap->edge[i].dsCoord = ADD_INT32( hintmap->edge[i].dsCoord, + move ); if ( isPair ) - hintmap->edge[j].dsCoord = ADD_INT32( dsCoord_j, move ); + hintmap->edge[j].dsCoord = ADD_INT32( hintmap->edge[j].dsCoord, + move ); } - /* assert there are no overlaps in device space; */ - /* ignore tests if there was overflow (that is, if */ - /* operands have the same sign but the sum does not) */ + /* assert there are no overlaps in device space */ FT_ASSERT( i == 0 || - ( ( dsCoord_i ^ move ) >= 0 && - ( dsCoord_i ^ hintmap->edge[i].dsCoord ) < 0 ) || hintmap->edge[i - 1].dsCoord <= hintmap->edge[i].dsCoord ); FT_ASSERT( i < j || - ( ( dsCoord_j ^ move ) >= 0 && - ( dsCoord_j ^ hintmap->edge[j].dsCoord ) < 0 ) || hintmap->edge[i].dsCoord <= hintmap->edge[j].dsCoord ); /* adjust the scales, avoiding divide by zero */ @@ -1029,17 +1022,10 @@ } } -#ifdef FT_DEBUG_LEVEL_TRACE - if ( initialMap ) - { - FT_TRACE6(( "flags: [p]air [g]host [t]op" - " [b]ottom [L]ocked [S]ynthetic\n" )); - FT_TRACE6(( "Initial hintmap" )); - } - else - FT_TRACE6(( "Hints:" )); -#endif - + FT_TRACE6(( "%s\n", initialMap ? "flags: [p]air [g]host [t]op" + " [b]ottom [L]ocked [S]ynthetic\n" + "Initial hintmap" + : "Hints:" )); cf2_hintmap_dump( hintmap ); /* diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/psintrp.c b/Build/source/libs/freetype2/freetype-src/src/psaux/psintrp.c index 40e92766389..519c6944475 100644 --- a/Build/source/libs/freetype2/freetype-src/src/psaux/psintrp.c +++ b/Build/source/libs/freetype2/freetype-src/src/psaux/psintrp.c @@ -1340,9 +1340,9 @@ if ( decoder->glyph_names == 0 ) #endif /* FT_CONFIG_OPTION_INCREMENTAL */ { - FT_ERROR(( "cf2_interpT2CharString:\n" )); - FT_ERROR(( " (Type 1 seac) glyph names table" - " not available in this font\n" )); + FT_ERROR(( + "cf2_interpT2CharString: (Type 1 seac)" + " glyph names table not available in this font\n" )); lastError = FT_THROW( Invalid_Glyph_Format ); goto exit; } @@ -1368,9 +1368,9 @@ if ( bchar_index < 0 || achar_index < 0 ) { - FT_ERROR(( "cf2_interpT2CharString:\n" )); - FT_ERROR(( " (Type 1 seac) invalid" - " seac character code arguments\n" )); + FT_ERROR(( + "cf2_interpT2CharString: (Type 1 seac)" + " invalid seac character code arguments\n" )); lastError = FT_THROW( Invalid_Glyph_Format ); goto exit; } @@ -1670,13 +1670,7 @@ */ count = cf2_stack_count( opStack ); - if ( (CF2_UInt)arg_cnt > count ) - { - FT_ERROR(( "cf2_interpT2CharString (Type 1 mode):" - " stack underflow\n" )); - lastError = FT_THROW( Invalid_Glyph_Format ); - goto exit; - } + FT_ASSERT( (CF2_UInt)arg_cnt <= count ); opIdx += count - (CF2_UInt)arg_cnt; diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/psobjs.c b/Build/source/libs/freetype2/freetype-src/src/psaux/psobjs.c index 30f501916a6..defc4d4fcee 100644 --- a/Build/source/libs/freetype2/freetype-src/src/psaux/psobjs.c +++ b/Build/source/libs/freetype2/freetype-src/src/psaux/psobjs.c @@ -4,7 +4,7 @@ * * Auxiliary functions for PostScript fonts (body). * - * Copyright (C) 1996-2021 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -251,7 +251,7 @@ if ( !old_base ) return; - if ( FT_QALLOC( table->block, table->cursor ) ) + if ( FT_ALLOC( table->block, table->cursor ) ) return; FT_MEM_COPY( table->block, old_base, table->cursor ); shift_elements( table, old_base ); @@ -595,10 +595,10 @@ if ( cur < limit && cur == parser->cursor ) { FT_ERROR(( "ps_parser_skip_PS_token:" - " current token is `%c' which is self-delimiting\n", + " current token is `%c' which is self-delimiting\n" + " " + " but invalid at this point\n", *cur )); - FT_ERROR(( " " - " but invalid at this point\n" )); error = FT_THROW( Invalid_File_Format ); } @@ -979,7 +979,7 @@ } len = (FT_UInt)( cur - *cursor ); - if ( cur >= limit || FT_QALLOC( result, len + 1 ) ) + if ( cur >= limit || FT_ALLOC( result, len + 1 ) ) return 0; /* now copy the string */ @@ -1175,8 +1175,8 @@ else { FT_ERROR(( "ps_parser_load_field:" - " expected a name or string\n" )); - FT_ERROR(( " " + " expected a name or string\n" + " " " but found token of type %d instead\n", token.type )); error = FT_THROW( Invalid_File_Format ); @@ -1193,7 +1193,7 @@ *(FT_String**)q = NULL; } - if ( FT_QALLOC( string, len + 1 ) ) + if ( FT_ALLOC( string, len + 1 ) ) goto Exit; FT_MEM_COPY( string, cur, len ); @@ -1248,7 +1248,7 @@ FT_UInt i; - if ( FT_QNEW_ARRAY( temp, max_objects * 4 ) ) + if ( FT_NEW_ARRAY( temp, max_objects * 4 ) ) goto Exit; for ( i = 0; i < 4; i++ ) @@ -1258,14 +1258,14 @@ if ( result < 0 || (FT_UInt)result < max_objects ) { FT_ERROR(( "ps_parser_load_field:" - " expected %d integer%s in the %s subarray\n", + " expected %d integer%s in the %s subarray\n" + " " + " of /FontBBox in the /Blend dictionary\n", max_objects, max_objects > 1 ? "s" : "", i == 0 ? "first" : ( i == 1 ? "second" : ( i == 2 ? "third" : "fourth" ) ) )); - FT_ERROR(( " " - " of /FontBBox in the /Blend dictionary\n" )); error = FT_THROW( Invalid_File_Format ); FT_FREE( temp ); diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/psobjs.h b/Build/source/libs/freetype2/freetype-src/src/psaux/psobjs.h index 99d16959a73..fdad672b6d2 100644 --- a/Build/source/libs/freetype2/freetype-src/src/psaux/psobjs.h +++ b/Build/source/libs/freetype2/freetype-src/src/psaux/psobjs.h @@ -4,7 +4,7 @@ * * Auxiliary functions for PostScript fonts (specification). * - * Copyright (C) 1996-2021 by + * Copyright (C) 1996-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/psstack.c b/Build/source/libs/freetype2/freetype-src/src/psaux/psstack.c index bc8888c3ab3..7ae5256ef19 100644 --- a/Build/source/libs/freetype2/freetype-src/src/psaux/psstack.c +++ b/Build/source/libs/freetype2/freetype-src/src/psaux/psstack.c @@ -59,14 +59,15 @@ CF2_Stack stack = NULL; - if ( FT_QNEW( stack ) ) + if ( FT_NEW( stack ) ) return NULL; + /* initialize the structure; FT_NEW zeroes it */ stack->memory = memory; stack->error = e; /* allocate the stack buffer */ - if ( FT_QNEW_ARRAY( stack->buffer, stackSize ) ) + if ( FT_NEW_ARRAY( stack->buffer, stackSize ) ) { FT_FREE( stack ); return NULL; diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/rules.mk b/Build/source/libs/freetype2/freetype-src/src/psaux/rules.mk index 05439120dd2..f49aecbc794 100644 --- a/Build/source/libs/freetype2/freetype-src/src/psaux/rules.mk +++ b/Build/source/libs/freetype2/freetype-src/src/psaux/rules.mk @@ -3,7 +3,7 @@ # -# Copyright (C) 1996-2021 by +# Copyright (C) 1996-2020 by # David Turner, Robert Wilhelm, and Werner Lemberg. # # This file is part of the FreeType project, and may only be used, modified, diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/t1cmap.c b/Build/source/libs/freetype2/freetype-src/src/psaux/t1cmap.c index 3e7c577a18c..e21e93ca268 100644 --- a/Build/source/libs/freetype2/freetype-src/src/psaux/t1cmap.c +++ b/Build/source/libs/freetype2/freetype-src/src/psaux/t1cmap.c @@ -4,7 +4,7 @@ * * Type 1 character map support (body). * - * Copyright (C) 2002-2021 by + * Copyright (C) 2002-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/t1cmap.h b/Build/source/libs/freetype2/freetype-src/src/psaux/t1cmap.h index 8f69600ca40..031796510f7 100644 --- a/Build/source/libs/freetype2/freetype-src/src/psaux/t1cmap.h +++ b/Build/source/libs/freetype2/freetype-src/src/psaux/t1cmap.h @@ -4,7 +4,7 @@ * * Type 1 character map support (specification). * - * Copyright (C) 2002-2021 by + * Copyright (C) 2002-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/t1decode.c b/Build/source/libs/freetype2/freetype-src/src/psaux/t1decode.c index ee1cb263449..2ed27ca19ef 100644 --- a/Build/source/libs/freetype2/freetype-src/src/psaux/t1decode.c +++ b/Build/source/libs/freetype2/freetype-src/src/psaux/t1decode.c @@ -4,7 +4,7 @@ * * PostScript Type 1 decoding routines (body). * - * Copyright (C) 2000-2021 by + * Copyright (C) 2000-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, @@ -517,7 +517,7 @@ #ifdef FT_DEBUG_LEVEL_TRACE if ( bol ) { - FT_TRACE5(( " (%ld)", decoder->top - decoder->stack )); + FT_TRACE5(( " (%d)", decoder->top - decoder->stack )); bol = FALSE; } #endif @@ -1162,9 +1162,9 @@ if ( top - decoder->stack != num_args ) FT_TRACE0(( "t1_decoder_parse_charstrings:" " too much operands on the stack" - " (seen %ld, expected %d)\n", + " (seen %d, expected %d)\n", top - decoder->stack, num_args )); - break; + break; } #endif /* FT_DEBUG_LEVEL_TRACE */ @@ -1209,7 +1209,7 @@ FT_TRACE4(( "BuildCharArray = [ " )); for ( i = 0; i < decoder->len_buildchar; i++ ) - FT_TRACE4(( "%ld ", decoder->buildchar[i] )); + FT_TRACE4(( "%d ", decoder->buildchar[i] )); FT_TRACE4(( "]\n" )); } @@ -1650,8 +1650,7 @@ } /* while ip < limit */ - FT_TRACE4(( "..end..\n" )); - FT_TRACE4(( "\n" )); + FT_TRACE4(( "..end..\n\n" )); Fail: return error; @@ -2071,8 +2070,7 @@ } /* while ip < limit */ - FT_TRACE4(( "..end..\n" )); - FT_TRACE4(( "\n" )); + FT_TRACE4(( "..end..\n\n" )); No_Width: FT_ERROR(( "t1_decoder_parse_metrics:" diff --git a/Build/source/libs/freetype2/freetype-src/src/psaux/t1decode.h b/Build/source/libs/freetype2/freetype-src/src/psaux/t1decode.h index eea9d34b042..b793504ac6a 100644 --- a/Build/source/libs/freetype2/freetype-src/src/psaux/t1decode.h +++ b/Build/source/libs/freetype2/freetype-src/src/psaux/t1decode.h @@ -4,7 +4,7 @@ * * PostScript Type 1 decoding routines (specification). * - * Copyright (C) 2000-2021 by + * Copyright (C) 2000-2020 by * David Turner, Robert Wilhelm, and Werner Lemberg. * * This file is part of the FreeType project, and may only be used, |