shithub: freetype+ttf2subf

Download patch

ref: 1e4496c54c010843c1bac56e5d344115d1a49620
parent: ba03310b5aa6a8b752f892c32f2354aff9a73f78
author: Alexei Podtelezhnikov <[email protected]>
date: Wed Oct 31 19:17:33 EDT 2018

[truetype] Speed up variation IUP.

* src/truetype/ttgxvar.c (tt_delta_interpolate): Separate trivial
snapping to the same position from true interpolation.

git/fs: mount .git/fs: mount/attach disallowed
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2018-10-31  Alexei Podtelezhnikov <[email protected]>
+
+	[truetype] Speed up variation IUP.
+
+	* src/truetype/ttgxvar.c (tt_delta_interpolate): Separate trivial
+	snapping to the same position from true interpolation.
+
 2018-10-31  Alexei Podtelezhnikov  <[email protected]>
 
 	* src/type1/t1load.c (t1_set_mm_blend): Optimized.
--- a/src/truetype/ttgxvar.c
+++ b/src/truetype/ttgxvar.c
@@ -3516,10 +3516,25 @@
 
       /* If the reference points have the same coordinate but different */
       /* delta, inferred delta is zero.  Otherwise interpolate.         */
-      if ( in1 != in2 || out1 == out2 )
+      if ( in1 == in2 || out1 == out2 )
       {
-        FT_Fixed  scale = in1 != in2 ? FT_DivFix( out2 - out1, in2 - in1 )
-                                     : 0;
+        for ( p = p1; p <= p2; p++ )
+        {
+          out = in_points[p].x;
+
+          if ( out <= in1 )
+            out += d1;
+          else if ( out >= in2 )
+            out += d2;
+          else
+            out = out1;
+
+          out_points[p].x = out;
+        }
+      }
+      else
+      {
+        FT_Fixed  scale = FT_DivFix( out2 - out1, in2 - in1 );
 
 
         for ( p = p1; p <= p2; p++ )