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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154
diff --git a/ChangeLog b/ChangeLog
index b033211..9131a73 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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`.
diff --git a/docs/CHANGES b/docs/CHANGES
index 4ffdc0b..3cbc669 100644
--- a/docs/CHANGES
+++ b/docs/CHANGES
@@ -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).
+
======================================================================
diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h
index c157796..6c6b298 100644
--- a/include/freetype/freetype.h
+++ b/include/freetype/freetype.h
@@ -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
@@ -3225,6 +3227,35 @@ FT_BEGIN_HEADER
/**************************************************************************
*
+ * @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:
* FT_Render_Mode
*
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index 829f4ab..56e1360 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -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 );