* src/truetype/ttobjs.c (tt_size_run_prep): Correct scaling of CVT values.

This reverts the scaling behaviour introduced in commit 37580053.

Fixes issue #1005.
This commit is contained in:
Werner Lemberg 2024-07-18 09:31:19 +02:00
parent 37cefe33b2
commit 1452355de9
1 changed files with 4 additions and 4 deletions

View File

@ -994,16 +994,16 @@
FT_Error error;
FT_UInt i;
/* unscaled CVT values are already stored in 26.6 format */
FT_Fixed scale = size->ttmetrics.scale >> 6;
/* Scale the cvt values to the new ppem. */
/* By default, we use the y ppem value for scaling. */
FT_TRACE6(( "CVT values:\n" ));
for ( i = 0; i < size->cvt_size; i++ )
{
size->cvt[i] = FT_MulFix( face->cvt[i], scale );
/* Unscaled CVT values are already stored in 26.6 format. */
/* Note that this scaling operation is very sensitive to rounding; */
/* the integer division by 64 must be applied to the first argument. */
size->cvt[i] = FT_MulFix( face->cvt[i] / 64, size->ttmetrics.scale );
FT_TRACE6(( " %3d: %f (%f)\n",
i, (double)face->cvt[i] / 64, (double)size->cvt[i] / 64 ));
}