[truetype] Actually scale varied CVT values. Up to now, only the unscaled CVT values were varied; in other words, the `CVAR' data was never used for bytecode hinting. * src/truetype/ttgxvar.c (tt_cvt_ready_iterator): New auxiliary function. (tt_face_vary_cvt): Use it to trigger rescaling of CVT values.
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
diff --git a/ChangeLog b/ChangeLog
index 52ceba8..8797510 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
2019-05-16 Werner Lemberg <wl@gnu.org>
+ [truetype] Actually scale varied CVT values.
+
+ Up to now, only the unscaled CVT values were varied; in other words,
+ the `CVAR' data was never used for bytecode hinting.
+
+ * src/truetype/ttgxvar.c (tt_cvt_ready_iterator): New auxiliary
+ function.
+ (tt_face_vary_cvt): Use it to trigger rescaling of CVT values.
+
+2019-05-16 Werner Lemberg <wl@gnu.org>
+
[truetype] Use 26.6 format for storing unscaled CVT values.
If `CVAR' data is applied to variation fonts, fractional values are
diff --git a/docs/CHANGES b/docs/CHANGES
index 9f001a9..7d91448 100644
--- a/docs/CHANGES
+++ b/docs/CHANGES
@@ -3,6 +3,9 @@ CHANGES BETWEEN 2.10.0 and 2.10.1
I. IMPORTANT BUG FIXES
+ - The bytecode hinting of OpenType variation fonts was flawed, since
+ the data in the `CVAR' table wasn't correctly applied.
+
II. MISCELLANEOUS
@@ -19,6 +22,9 @@ CHANGES BETWEEN 2.10.0 and 2.10.1
twice in a row, the function returned an incorrect error code the
second time.
+ - Increased precision while computing OpenType font variation
+ instances.
+
======================================================================
diff --git a/src/truetype/ttgxvar.c b/src/truetype/ttgxvar.c
index 00b91f6..1c24bc2 100644
--- a/src/truetype/ttgxvar.c
+++ b/src/truetype/ttgxvar.c
@@ -3113,6 +3113,21 @@
/*************************************************************************/
+ static FT_Error
+ tt_cvt_ready_iterator( FT_ListNode node,
+ void* user )
+ {
+ TT_Size size = (TT_Size)node->data;
+
+ FT_UNUSED( user );
+
+
+ size->cvt_ready = -1;
+
+ return FT_Err_Ok;
+ }
+
+
/**************************************************************************
*
* @Function:
@@ -3143,6 +3158,8 @@
FT_Error error;
FT_Memory memory = stream->memory;
+ FT_Face root = &face->root;
+
FT_ULong table_start;
FT_ULong table_len;
@@ -3451,6 +3468,12 @@
FT_FREE( im_end_coords );
FT_FREE( cvt_deltas );
+ /* iterate over all FT_Size objects and set `cvt_ready' to -1 */
+ /* to trigger rescaling of all CVT values */
+ FT_List_Iterate( &root->sizes_list,
+ tt_cvt_ready_iterator,
+ NULL );
+
return error;
}