freetype-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Git][freetype/freetype][master] * src/truetype/ttobjs.c (tt_size_run_pr


From: Werner Lemberg (@wl)
Subject: [Git][freetype/freetype][master] * src/truetype/ttobjs.c (tt_size_run_prep): Correct scaling of CVT values.
Date: Tue, 23 Jul 2024 04:55:46 +0000

Werner Lemberg pushed to branch master at FreeType / FreeType

Commits:

  • 1452355d
    by Werner Lemberg at 2024-07-19T22:35:37+02:00
    * 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.
    

1 changed file:

Changes:

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


  • reply via email to

    [Prev in Thread] Current Thread [Next in Thread]