[sfnt] s/PaintTransformed/PaintTransform/, s/transformed/transform/.

* include/freetype/ftcolor.h (FT_PaintTransformed, FT_PaintFormat,
FT_COLR_Paint): Do it to make it harmonize with other names such as
'PaintTranslate'.

* src/sfnt/ttcolr.c (read_paint, tt_face_get_paint): Ditto.
This commit is contained in:
Dominik Röttsches 2021-06-22 20:50:48 +02:00 committed by Werner Lemberg
parent 284eec1e18
commit 4cb21b9a92
3 changed files with 39 additions and 29 deletions

View File

@ -1,3 +1,13 @@
2021-07-22 Dominik Röttsches <drott@chromium.org>
[sfnt] s/PaintTransformed/PaintTransform/, s/transformed/transform/.
* include/freetype/ftcolor.h (FT_PaintTransformed, FT_PaintFormat,
FT_COLR_Paint): Do it to make it harmonize with other names such as
'PaintTranslate'.
* src/sfnt/ttcolr.c (read_paint, tt_face_get_paint): Ditto.
2021-07-22 Dominik Röttsches <drott@chromium.org>
Move 'COLR' API to `ftcolor.h`.

View File

@ -496,7 +496,7 @@ FT_BEGIN_HEADER
FT_COLR_PAINTFORMAT_SWEEP_GRADIENT = 8,
FT_COLR_PAINTFORMAT_GLYPH = 10,
FT_COLR_PAINTFORMAT_COLR_GLYPH = 11,
FT_COLR_PAINTFORMAT_TRANSFORMED = 12,
FT_COLR_PAINTFORMAT_TRANSFORM = 12,
FT_COLR_PAINTFORMAT_TRANSLATE = 14,
FT_COLR_PAINTFORMAT_ROTATE = 16,
FT_COLR_PAINTFORMAT_SKEW = 18,
@ -762,7 +762,7 @@ FT_BEGIN_HEADER
* A structure representing an offset to a `Paint` value stored in any
* of the paint tables of a 'COLR' v1 font. Compare Offset<24> there.
* When 'COLR' v1 paint tables represented by FreeType objects such as
* @FT_PaintColrLayers, @FT_PaintComposite, or @FT_PaintTransformed
* @FT_PaintColrLayers, @FT_PaintComposite, or @FT_PaintTransform
* reference downstream nested paint tables, we do not immediately
* retrieve them but encapsulate their location in this type. Use
* @FT_Get_Paint to retrieve the actual @FT_COLR_Paint object that
@ -1041,10 +1041,10 @@ FT_BEGIN_HEADER
/**************************************************************************
*
* @struct:
* FT_PaintTransformed
* FT_PaintTransform
*
* @description:
* A structure representing a 'COLR' v1 `PaintTransformed` paint table.
* A structure representing a 'COLR' v1 `PaintTransform` paint table.
*
* @fields:
* paint ::
@ -1058,12 +1058,12 @@ FT_BEGIN_HEADER
* without retaining backward-compatibility of both the API and ABI.
*
*/
typedef struct FT_PaintTransformed_
typedef struct FT_PaintTransform_
{
FT_OpaquePaint paint;
FT_Affine23 affine;
} FT_PaintTransformed;
} FT_PaintTransform;
/**************************************************************************
@ -1251,7 +1251,7 @@ FT_BEGIN_HEADER
* * @FT_PaintLinearGradient
* * @FT_PaintRadialGradient
* * @FT_PaintSweepGradient
* * @FT_PaintTransformed
* * @FT_PaintTransform
* * @FT_PaintTranslate
* * @FT_PaintRotate
* * @FT_PaintSkew
@ -1275,7 +1275,7 @@ FT_BEGIN_HEADER
FT_PaintLinearGradient linear_gradient;
FT_PaintRadialGradient radial_gradient;
FT_PaintSweepGradient sweep_gradient;
FT_PaintTransformed transformed;
FT_PaintTransform transform;
FT_PaintTranslate translate;
FT_PaintRotate rotate;
FT_PaintSkew skew;
@ -1367,7 +1367,7 @@ FT_BEGIN_HEADER
*
* root_transform ::
* Specifies whether an initially computed root is returned by the
* @FT_PaintTransformed operation to account for the activated size
* @FT_PaintTransform operation to account for the activated size
* (see @FT_Activate_Size) and the configured transform and translate
* (see @FT_Set_Transform).
*

View File

@ -507,17 +507,17 @@
return 1;
}
else if ( apaint->format == FT_COLR_PAINTFORMAT_TRANSFORMED )
else if ( apaint->format == FT_COLR_PAINTFORMAT_TRANSFORM )
{
apaint->u.transformed.paint.p = child_table_p;
apaint->u.transformed.paint.insert_root_transform = 0;
apaint->u.transform.paint.p = child_table_p;
apaint->u.transform.paint.insert_root_transform = 0;
apaint->u.transformed.affine.xx = FT_NEXT_LONG( p );
apaint->u.transformed.affine.yx = FT_NEXT_LONG( p );
apaint->u.transformed.affine.xy = FT_NEXT_LONG( p );
apaint->u.transformed.affine.yy = FT_NEXT_LONG( p );
apaint->u.transformed.affine.dx = FT_NEXT_LONG( p );
apaint->u.transformed.affine.dy = FT_NEXT_LONG( p );
apaint->u.transform.affine.xx = FT_NEXT_LONG( p );
apaint->u.transform.affine.yx = FT_NEXT_LONG( p );
apaint->u.transform.affine.xy = FT_NEXT_LONG( p );
apaint->u.transform.affine.yy = FT_NEXT_LONG( p );
apaint->u.transform.affine.dx = FT_NEXT_LONG( p );
apaint->u.transform.affine.dy = FT_NEXT_LONG( p );
return 1;
}
@ -809,11 +809,11 @@
* drawing operations for subsequenct paints. Prepare this initial
* transform here.
*/
paint->format = FT_COLR_PAINTFORMAT_TRANSFORMED;
paint->format = FT_COLR_PAINTFORMAT_TRANSFORM;
next_paint.p = opaque_paint.p;
next_paint.insert_root_transform = 0;
paint->u.transformed.paint = next_paint;
paint->u.transform.paint = next_paint;
/* `x_scale` and `y_scale` are in 26.6 format, representing the scale
* factor to get from font units to requested size. However, expected
@ -828,28 +828,28 @@
FT_Matrix_Multiply( &face->root.internal->transform_matrix,
&ft_root_scale );
paint->u.transformed.affine.xx = ft_root_scale.xx;
paint->u.transformed.affine.xy = ft_root_scale.xy;
paint->u.transformed.affine.yx = ft_root_scale.yx;
paint->u.transformed.affine.yy = ft_root_scale.yy;
paint->u.transform.affine.xx = ft_root_scale.xx;
paint->u.transform.affine.xy = ft_root_scale.xy;
paint->u.transform.affine.yx = ft_root_scale.yx;
paint->u.transform.affine.yy = ft_root_scale.yy;
/* The translation is specified in 26.6 format and, according to the
* documentation of `FT_Set_Translate`, is performed on the character
* size given in the last call to `FT_Set_Char_Size`. The
* 'PaintTransformed' paint table's `FT_Affine23` format expects
* 'PaintTransform' paint table's `FT_Affine23` format expects
* values in 16.16 format, thus we need to shift by 10 bits.
*/
if ( face->root.internal->transform_flags & 2 )
{
paint->u.transformed.affine.dx =
paint->u.transform.affine.dx =
face->root.internal->transform_delta.x << 10;
paint->u.transformed.affine.dy =
paint->u.transform.affine.dy =
face->root.internal->transform_delta.y << 10;
}
else
{
paint->u.transformed.affine.dx = 0;
paint->u.transformed.affine.dy = 0;
paint->u.transform.affine.dx = 0;
paint->u.transform.affine.dy = 0;
}
return 1;