freetype-commit
[Top][All Lists]
Advanced

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

[Git][freetype/freetype][master] [sfnt] PaintRotate/PaintRotateAroundCen


From: Werner Lemberg (@wl)
Subject: [Git][freetype/freetype][master] [sfnt] PaintRotate/PaintRotateAroundCenter spec updates
Date: Thu, 29 Jul 2021 06:00:36 +0000

Werner Lemberg pushed to branch master at FreeType / FreeType

Commits:

2 changed files:

Changes:

  • include/freetype/ftcolor.h
    ... ... @@ -1173,7 +1173,9 @@ FT_BEGIN_HEADER
    1173 1173
        *     rotated.
    
    1174 1174
        *
    
    1175 1175
        *   angle ::
    
    1176
    -   *     The rotation angle that is to be applied.
    
    1176
    +   *     The rotation angle that is to be applied in degrees divided by
    
    1177
    +   *     180.0 (as in the spec).  Multiply by 180.0f to receive degrees
    
    1178
    +   *     value.
    
    1177 1179
        *
    
    1178 1180
        *   center_x ::
    
    1179 1181
        *     The x~coordinate of the pivot point of the rotation (in font
    

  • src/sfnt/ttcolr.c
    ... ... @@ -619,15 +619,32 @@
    619 619
           return 1;
    
    620 620
         }
    
    621 621
     
    
    622
    -    else if ( apaint->format == FT_COLR_PAINTFORMAT_ROTATE )
    
    622
    +    else if ( apaint->format == FT_COLR_PAINTFORMAT_ROTATE  ||
    
    623
    +              (FT_PaintFormat_Internal)apaint->format ==
    
    624
    +                FT_COLR_PAINTFORMAT_INTERNAL_ROTATE_CENTER  )
    
    623 625
         {
    
    624 626
           apaint->u.rotate.paint.p                     = child_table_p;
    
    625 627
           apaint->u.rotate.paint.insert_root_transform = 0;
    
    626 628
     
    
    627
    -      apaint->u.rotate.angle = FT_NEXT_LONG( p );
    
    629
    +      /* The angle is specified as F2DOT14 and our output type is an FT_Fixed,
    
    630
    +       * shift by 2 positions. */
    
    631
    +      apaint->u.rotate.angle = FT_NEXT_SHORT( p ) << 2;
    
    632
    +
    
    633
    +      if ( (FT_PaintFormat_Internal)apaint->format ==
    
    634
    +           FT_COLR_PAINTFORMAT_INTERNAL_ROTATE_CENTER )
    
    635
    +      {
    
    636
    +        /* The center is specified as Int16 in font units, shift by 16 bits to
    
    637
    +         * convert to our FT_Fixed output type. */
    
    638
    +        apaint->u.rotate.center_x = FT_NEXT_SHORT( p ) << 16;
    
    639
    +        apaint->u.rotate.center_y = FT_NEXT_SHORT( p ) << 16;
    
    640
    +      }
    
    641
    +      else
    
    642
    +      {
    
    643
    +        apaint->u.rotate.center_x = 0;
    
    644
    +        apaint->u.rotate.center_y = 0;
    
    645
    +      }
    
    628 646
     
    
    629
    -      apaint->u.rotate.center_x = FT_NEXT_LONG( p );
    
    630
    -      apaint->u.rotate.center_y = FT_NEXT_LONG( p );
    
    647
    +      apaint->format = FT_COLR_PAINTFORMAT_ROTATE;
    
    631 648
     
    
    632 649
           return 1;
    
    633 650
         }
    


  • reply via email to

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