Commit 96dcc8ad6ef67f8703efd239f081ed27c7f039a2

Werner Lemberg 2017-09-13T08:16:23

[autofit] Really fix #41334 (#52000). * src/autofit/aflatin.c (af_latin_hints_compute_segments): Set `segment->delta' everywhere.

diff --git a/ChangeLog b/ChangeLog
index b9d69c0..b25a822 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2017-09-13  Werner Lemberg  <wl@gnu.org>
+
+	[autofit] Really fix #41334 (#52000).
+
+	* src/autofit/aflatin.c (af_latin_hints_compute_segments): Set
+	`segment->delta' everywhere.
+
 2017-09-12  suzuki toshiya  <mpsuzuki@hiroshima-u.ac.jp>
 
 	[autofit, sfnt] Fix for `make multi'.
diff --git a/src/autofit/aflatin.c b/src/autofit/aflatin.c
index cdbc1b7..02b3b8b 100644
--- a/src/autofit/aflatin.c
+++ b/src/autofit/aflatin.c
@@ -1690,9 +1690,11 @@
                 if ( prev_max_on_coord > max_on_coord )
                   max_on_coord = prev_max_on_coord;
 
-                prev_segment->last = point;
-                prev_segment->pos  = (FT_Short)( ( min_pos +
-                                                   max_pos ) >> 1 );
+                prev_segment->last  = point;
+                prev_segment->pos   = (FT_Short)( ( min_pos +
+                                                    max_pos ) >> 1 );
+                prev_segment->delta = (FT_Short)( ( max_pos -
+                                                    min_pos ) >> 1 );
 
                 if ( ( min_flags | max_flags ) & AF_FLAG_CONTROL      &&
                      ( max_on_coord - min_on_coord ) < flat_threshold )
@@ -1720,9 +1722,11 @@
                   if ( max_pos > prev_max_pos )
                     prev_max_pos = max_pos;
 
-                  prev_segment->last = point;
-                  prev_segment->pos  = (FT_Short)( ( prev_min_pos +
-                                                     prev_max_pos ) >> 1 );
+                  prev_segment->last  = point;
+                  prev_segment->pos   = (FT_Short)( ( prev_min_pos +
+                                                      prev_max_pos ) >> 1 );
+                  prev_segment->delta = (FT_Short)( ( prev_max_pos -
+                                                      prev_min_pos ) >> 1 );
                 }
                 else
                 {
@@ -1733,8 +1737,9 @@
                   if ( prev_max_pos > max_pos )
                     max_pos = prev_max_pos;
 
-                  segment->last = point;
-                  segment->pos  = (FT_Short)( ( min_pos + max_pos ) >> 1 );
+                  segment->last  = point;
+                  segment->pos   = (FT_Short)( ( min_pos + max_pos ) >> 1 );
+                  segment->delta = (FT_Short)( ( max_pos - min_pos ) >> 1 );
 
                   if ( ( min_flags | max_flags ) & AF_FLAG_CONTROL      &&
                        ( max_on_coord - min_on_coord ) < flat_threshold )