diff --git a/modules/freetype2/README.moz-patches b/modules/freetype2/README.moz-patches index 3088ae42154f..f98a9b9c83c6 100644 --- a/modules/freetype2/README.moz-patches +++ b/modules/freetype2/README.moz-patches @@ -1,6 +1,11 @@ This directory contains FreeType v2.9 downloaded from https://download.savannah.gnu.org/releases/freetype/ -There are currently no local changes applied to the FreeType tree, -except that the file docs/LICENSE.TXT has been copied to the top-level -directory of the FreeType tree as LICENSE.TXT. +The following post-2.9 commits have been cherry-picked from +the upstream FreeType repository (see bug 1434697, bug 1438522): + +http://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=994eb2b34934bc5face9f83b2d3b12cf7a9262ab +http://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=cc2f3cdecff5a351e7e8961b9f2e389ab740231a +http://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=4a03f17449ae45f0dacf4de4694ccd6e5e1b24d1 +http://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=68dddcdcbe18a08d778026efc01b1369e35cbf6a +http://git.savannah.gnu.org/cgit/freetype/freetype2.git/commit/?id=29c759284e305ec428703c9a5831d0b1fc3497ef diff --git a/modules/freetype2/src/psaux/psintrp.c b/modules/freetype2/src/psaux/psintrp.c index 5c0ee784924a..da5a8dad1dba 100644 --- a/modules/freetype2/src/psaux/psintrp.c +++ b/modules/freetype2/src/psaux/psintrp.c @@ -852,7 +852,8 @@ curY = ADD_INT32( curY, cf2_stack_popFixed( opStack ) ); - cf2_glyphpath_moveTo( &glyphPath, curX, curY ); + if ( !decoder->flex_state ) + cf2_glyphpath_moveTo( &glyphPath, curX, curY ); break; @@ -2674,7 +2675,8 @@ curX = ADD_INT32( curX, cf2_stack_popFixed( opStack ) ); - cf2_glyphpath_moveTo( &glyphPath, curX, curY ); + if ( !decoder->flex_state ) + cf2_glyphpath_moveTo( &glyphPath, curX, curY ); break; diff --git a/modules/freetype2/src/truetype/ttgxvar.c b/modules/freetype2/src/truetype/ttgxvar.c index 980086ce76a8..96a171ef4d49 100644 --- a/modules/freetype2/src/truetype/ttgxvar.c +++ b/modules/freetype2/src/truetype/ttgxvar.c @@ -2762,8 +2762,9 @@ } } - /* return value -1 indicates `no change' */ - if ( !have_diff ) + /* return value -1 indicates `no change'; */ + /* we can exit early if `normalizedcoords' is already computed */ + if ( blend->normalizedcoords && !have_diff ) return -1; if ( FT_NEW_ARRAY( normalized, mmvar->num_axis ) ) diff --git a/modules/freetype2/src/truetype/ttinterp.c b/modules/freetype2/src/truetype/ttinterp.c index d855aaaa9c64..5c8ff4f3dddf 100644 --- a/modules/freetype2/src/truetype/ttinterp.c +++ b/modules/freetype2/src/truetype/ttinterp.c @@ -5782,6 +5782,7 @@ FT_F26Dot6 distance; #ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY FT_F26Dot6 control_value_cutin = 0; + FT_F26Dot6 delta; if ( SUBPIXEL_HINTING_INFINALITY ) @@ -5817,11 +5818,15 @@ distance = PROJECT( exc->zp1.cur + point, exc->zp0.cur + exc->GS.rp0 ); #ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY + delta = SUB_LONG( distance, args[1] ); + if ( delta < 0 ) + delta = NEG_LONG( delta ); + /* subpixel hinting - make MSIRP respect CVT cut-in; */ - if ( SUBPIXEL_HINTING_INFINALITY && - exc->ignore_x_mode && - exc->GS.freeVector.x != 0 && - FT_ABS( SUB_LONG( distance, args[1] ) ) >= control_value_cutin ) + if ( SUBPIXEL_HINTING_INFINALITY && + exc->ignore_x_mode && + exc->GS.freeVector.x != 0 && + delta >= control_value_cutin ) distance = args[1]; #endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ @@ -5978,7 +5983,14 @@ if ( ( exc->opcode & 1 ) != 0 ) /* rounding and control cut-in flag */ { - if ( FT_ABS( distance - org_dist ) > control_value_cutin ) + FT_F26Dot6 delta; + + + delta = SUB_LONG( distance, org_dist ); + if ( delta < 0 ) + delta = NEG_LONG( delta ); + + if ( delta > control_value_cutin ) distance = org_dist; #ifdef TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY @@ -6259,6 +6271,9 @@ if ( exc->GS.gep0 == exc->GS.gep1 ) { + FT_F26Dot6 delta; + + /* XXX: According to Greg Hitchcock, the following wording is */ /* the right one: */ /* */ @@ -6271,7 +6286,11 @@ /* `ttinst2.doc', version 1.66, is thus incorrect since */ /* it implies `>=' instead of `>'. */ - if ( FT_ABS( cvt_dist - org_dist ) > control_value_cutin ) + delta = SUB_LONG( cvt_dist, org_dist ); + if ( delta < 0 ) + delta = NEG_LONG( delta ); + + if ( delta > control_value_cutin ) cvt_dist = org_dist; } @@ -6289,7 +6308,14 @@ exc->ignore_x_mode && exc->GS.gep0 == exc->GS.gep1 ) { - if ( FT_ABS( cvt_dist - org_dist ) > control_value_cutin ) + FT_F26Dot6 delta; + + + delta = SUB_LONG( cvt_dist, org_dist ); + if ( delta < 0 ) + delta = NEG_LONG( delta ); + + if ( delta > control_value_cutin ) cvt_dist = org_dist; } #endif /* TT_SUPPORT_SUBPIXEL_HINTING_INFINALITY */ @@ -7532,8 +7558,16 @@ return; } - for ( i = 0; i < num_axes; i++ ) - args[i] = coords[i] >> 2; /* convert 16.16 to 2.14 format */ + if ( coords ) + { + for ( i = 0; i < num_axes; i++ ) + args[i] = coords[i] >> 2; /* convert 16.16 to 2.14 format */ + } + else + { + for ( i = 0; i < num_axes; i++ ) + args[i] = 0; + } }