Add new function FT_Get_Transform.

See

  https://github.com/harfbuzz/harfbuzz/issues/2428

for some reasons to introduce this function.

* include/freetype/freetype.h, src/base/ftobjs.c (FT_Get_Transform):
Implement it.
This commit is contained in:
Werner Lemberg 2021-02-13 08:52:58 +01:00
parent d93a011933
commit d51452e3ec
4 changed files with 81 additions and 11 deletions

View File

@ -1,3 +1,16 @@
2021-02-13 Werner Lemberg <wl@gnu.org>
Add new function `FT_Get_Transform`.
See
https://github.com/harfbuzz/harfbuzz/issues/2428
for some reasons to introduce this function.
* include/freetype/freetype.h, src/base/ftobjs.c (FT_Get_Transform):
Implement it.
2021-02-12 Alexei Podtelezhnikov <apodtele@gmail.com>
Decorate `qsort` callbacks with `cdecl`.

View File

@ -50,16 +50,6 @@ CHANGES BETWEEN 2.10.4 and 2.11.0
II. MISCELLANEOUS
- `ttdebug` didn't show changed point coordinates (bug introduced in
version 2.10.3).
- A new configuration macro `FT_DEBUG_LOGGING` is available. It
provides extended debugging capabilities for FreeType, for example
showing a time stamp or displaying the component a tracing message
comes from. See file `docs/DEBUG` for more information.
This work was Priyesh Kumar's GSoC 2020 project.
- FreeType has moved its infrastructure to
https://gitlab.freedesktop.org/freetype
@ -72,6 +62,19 @@ CHANGES BETWEEN 2.10.4 and 2.11.0
FreeType's Savannah repositories will stay; they are now mirrors
of the 'freedesktop.org' repositories.
- A new function `FT_Get_Transform` returns the values set by
`FT_Set_Transform`.
- A new configuration macro `FT_DEBUG_LOGGING` is available. It
provides extended debugging capabilities for FreeType, for example
showing a time stamp or displaying the component a tracing message
comes from. See file `docs/DEBUG` for more information.
This work was Priyesh Kumar's GSoC 2020 project.
- `ttdebug` didn't show changed point coordinates (bug introduced in
version 2.10.3).
======================================================================

View File

@ -204,6 +204,7 @@ FT_BEGIN_HEADER
* FT_Size_RequestRec
* FT_Size_Request
* FT_Set_Transform
* FT_Get_Transform
* FT_Load_Glyph
* FT_Get_Char_Index
* FT_Get_First_Char
@ -3200,7 +3201,8 @@ FT_BEGIN_HEADER
* A pointer to the transformation's 2x2 matrix. Use `NULL` for the
* identity matrix.
* delta ::
* A pointer to the translation vector. Use `NULL` for the null vector.
* A pointer to the translation vector. Use `NULL` for the null
* vector.
*
* @note:
* This function is provided as a convenience, but keep in mind that
@ -3223,6 +3225,35 @@ FT_BEGIN_HEADER
FT_Vector* delta );
/**************************************************************************
*
* @function:
* FT_Get_Transform
*
* @description:
* Return the transformation that is applied to glyph images when they
* are loaded into a glyph slot through @FT_Load_Glyph. See
* @FT_Set_Transform for more details.
*
* @input:
* face ::
* A handle to the source face object.
*
* @output:
* matrix ::
* A pointer to a transformation's 2x2 matrix. Set this to NULL if you
* are not interested in the value.
*
* delta ::
* A pointer a translation vector. Set this to NULL if you are not
* interested in the value.
*/
FT_EXPORT( void )
FT_Get_Transform( FT_Face face,
FT_Matrix* matrix,
FT_Vector* delta );
/**************************************************************************
*
* @enum:

View File

@ -738,6 +738,29 @@
}
/* documentation is in freetype.h */
FT_EXPORT_DEF( void )
FT_Get_Transform( FT_Face face,
FT_Matrix* matrix,
FT_Vector* delta )
{
FT_Face_Internal internal;
if ( !face )
return;
internal = face->internal;
if ( matrix )
*matrix = internal->transform_matrix;
if ( delta )
*delta = internal->transform_delta;
}
static FT_Renderer
ft_lookup_glyph_renderer( FT_GlyphSlot slot );