shithub: freetype+ttf2subf

Download patch

ref: 96dcc8ad6ef67f8703efd239f081ed27c7f039a2
parent: 21658c31f705edd4c94798eee62ce5b5241814b9
author: Werner Lemberg <[email protected]>
date: Wed Sep 13 04:16:23 EDT 2017

[autofit] Really fix #41334 (#52000).

* src/autofit/aflatin.c (af_latin_hints_compute_segments): Set
`segment->delta' everywhere.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2017-09-13  Werner Lemberg  <[email protected]>
+
+	[autofit] Really fix #41334 (#52000).
+
+	* src/autofit/aflatin.c (af_latin_hints_compute_segments): Set
+	`segment->delta' everywhere.
+
 2017-09-12  suzuki toshiya  <[email protected]>
 
 	[autofit, sfnt] Fix for `make multi'.
--- 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 )