[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[freetype2] master 60bf264: [truetype] Make `IUP' gvar deltas do the sam
From: |
Werner LEMBERG |
Subject: |
[freetype2] master 60bf264: [truetype] Make `IUP' gvar deltas do the same as Apple (#50832). |
Date: |
Tue, 2 May 2017 08:40:58 -0400 (EDT) |
branch: master
commit 60bf264ee25dc08403dddb3e4cd2bf950cda9e90
Author: Behdad Esfahbod <address@hidden>
Commit: Werner Lemberg <address@hidden>
[truetype] Make `IUP' gvar deltas do the same as Apple (#50832).
When points are not touched by gvar interpolation deltas, FreeType
gave a slightly different result than Apple's CoreText.
The OpenType working group will update the specification to document
the following behaviour: If the two points with deltas to the `left'
and `right' of the untouched point have the same coordinate, then
the inferred delta for the untouched point should be zero.
* src/truetype/ttgxvar.c (tt_delta_interpolate): Implement new
behaviour.
---
ChangeLog | 15 +++++++++++++++
src/truetype/ttgxvar.c | 23 +++++------------------
2 files changed, 20 insertions(+), 18 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 8dd013e..05fd0aa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,18 @@
+2017-05-02 Behdad Esfahbod <address@hidden>
+
+ [truetype] Make `IUP' gvar deltas do the same as Apple (#50832).
+
+ When points are not touched by gvar interpolation deltas, FreeType
+ gave a slightly different result than Apple's CoreText.
+
+ The OpenType working group will update the specification to document
+ the following behaviour: If the two points with deltas to the `left'
+ and `right' of the untouched point have the same coordinate, then
+ the inferred delta for the untouched point should be zero.
+
+ * src/truetype/ttgxvar.c (tt_delta_interpolate): Implement new
+ behaviour.
+
2017-05-02 Werner Lemberg <address@hidden>
[autofit] Remove `slight' auto-hint mode again.
diff --git a/src/truetype/ttgxvar.c b/src/truetype/ttgxvar.c
index 6d4529b..0cedb6b 100644
--- a/src/truetype/ttgxvar.c
+++ b/src/truetype/ttgxvar.c
@@ -3081,25 +3081,12 @@
d1 = out1 - in1;
d2 = out2 - in2;
- if ( out1 == out2 || in1 == in2 )
+ /* If the reference points have the same coordinate but different */
+ /* delta, inferred delta is zero. Otherwise interpolate. */
+ if ( in1 != in2 || out1 == out2 )
{
- 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 );
+ FT_Fixed scale = in1 != in2 ? FT_DivFix( out2 - out1, in2 - in1 )
+ : 0;
for ( p = p1; p <= p2; p++ )
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [freetype2] master 60bf264: [truetype] Make `IUP' gvar deltas do the same as Apple (#50832).,
Werner LEMBERG <=