freetype-commit
[Top][All Lists]
Advanced

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

[Git][freetype/freetype][master] [sfnt] 'COLR' v1 PaintSkew related spec


From: Werner Lemberg (@wl)
Subject: [Git][freetype/freetype][master] [sfnt] 'COLR' v1 PaintSkew related spec updates
Date: Thu, 29 Jul 2021 06:02:41 +0000

Werner Lemberg pushed to branch master at FreeType / FreeType

Commits:

2 changed files:

Changes:

  • include/freetype/ftcolor.h
    ... ... @@ -1219,10 +1219,12 @@ FT_BEGIN_HEADER
    1219 1219
        *     skewed.
    
    1220 1220
        *
    
    1221 1221
        *   x_skew_angle ::
    
    1222
    -   *     The skewing angle in x~direction.
    
    1222
    +   *     The skewing angle in x~direction in degrees divided by 180.0
    
    1223
    +   *     (as in the spec).  Multiply by 180.0f to receive degrees.
    
    1223 1224
        *
    
    1224 1225
        *   y_skew_angle ::
    
    1225
    -   *     The skewing angle in y~direction.
    
    1226
    +   *     The skewing angle in y~direction in degrees divided by 180.0
    
    1227
    +   *     (as in the spec).  Multiply by 180.0f to receive degrees.
    
    1226 1228
        *
    
    1227 1229
        *   center_x ::
    
    1228 1230
        *     The x~coordinate of the pivot point of the skew (in font units).
    

  • src/sfnt/ttcolr.c
    ... ... @@ -649,16 +649,29 @@
    649 649
           return 1;
    
    650 650
         }
    
    651 651
     
    
    652
    -    else if ( apaint->format == FT_COLR_PAINTFORMAT_SKEW )
    
    652
    +    else if ( apaint->format == FT_COLR_PAINTFORMAT_SKEW  ||
    
    653
    +              (FT_PaintFormat_Internal)apaint->format ==
    
    654
    +                FT_COLR_PAINTFORMAT_INTERNAL_SKEW_CENTER  )
    
    653 655
         {
    
    654 656
           apaint->u.skew.paint.p                     = child_table_p;
    
    655 657
           apaint->u.skew.paint.insert_root_transform = 0;
    
    656 658
     
    
    657
    -      apaint->u.skew.x_skew_angle = FT_NEXT_LONG( p );
    
    658
    -      apaint->u.skew.y_skew_angle = FT_NEXT_LONG( p );
    
    659
    +      apaint->u.skew.x_skew_angle = FT_NEXT_SHORT( p ) << 2;
    
    660
    +      apaint->u.skew.y_skew_angle = FT_NEXT_SHORT( p ) << 2;
    
    661
    +
    
    662
    +      if ( (FT_PaintFormat_Internal)apaint->format ==
    
    663
    +           FT_COLR_PAINTFORMAT_INTERNAL_SKEW_CENTER )
    
    664
    +      {
    
    665
    +        apaint->u.skew.center_x = FT_NEXT_SHORT( p ) << 16;
    
    666
    +        apaint->u.skew.center_y = FT_NEXT_SHORT( p ) << 16;
    
    667
    +      }
    
    668
    +      else
    
    669
    +      {
    
    670
    +        apaint->u.skew.center_x = 0;
    
    671
    +        apaint->u.skew.center_y = 0;
    
    672
    +      }
    
    659 673
     
    
    660
    -      apaint->u.skew.center_x = FT_NEXT_LONG( p );
    
    661
    -      apaint->u.skew.center_y = FT_NEXT_LONG( p );
    
    674
    +      apaint->format = FT_COLR_PAINTFORMAT_SKEW;
    
    662 675
     
    
    663 676
           return 1;
    
    664 677
         }
    


  • reply via email to

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