From ed6164a44f685a448d04d7822d6d73767eddcf3c Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Thu, 4 Mar 2021 13:01:09 -0700 Subject: [PATCH] [varLib.cff] Round deltas using bankers round as well See https://github.com/fonttools/fonttools/pull/2214#issuecomment-790742479 Good news: this reverted the one CFF test that needed its expectation to change when I started this patchset. Bad news: it introduced a couple other diffs to the same glyph of the same test, which is consistent with changing the rounding from otRound to round3. --- Lib/fontTools/varLib/cff.py | 2 +- Tests/varLib/data/test_results/TestSparseCFF2VF.ttx | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Lib/fontTools/varLib/cff.py b/Lib/fontTools/varLib/cff.py index 1a6bf14c3..db1889888 100644 --- a/Lib/fontTools/varLib/cff.py +++ b/Lib/fontTools/varLib/cff.py @@ -510,7 +510,7 @@ class CFF2CharStringMergePen(T2CharStringPen): self.prev_move_idx = 0 self.seen_moveto = False self.glyphName = glyphName - self.round = roundFunc(roundTolerance) + self.round = roundFunc(roundTolerance, round=round) def add_point(self, point_type, pt_coords): if self.m_index == 0: diff --git a/Tests/varLib/data/test_results/TestSparseCFF2VF.ttx b/Tests/varLib/data/test_results/TestSparseCFF2VF.ttx index a4fc03cd0..5bbd925c7 100644 --- a/Tests/varLib/data/test_results/TestSparseCFF2VF.ttx +++ b/Tests/varLib/data/test_results/TestSparseCFF2VF.ttx @@ -290,7 +290,7 @@ 2 vsindex - -60 30 203 30 -9 9 67 7 -7 14 -14 30 -20 20 80 30 59 30 121 30 18 93 -30 30 -30 108 -23 0 -26 67 2 76 -98 -2 -111 42 0 47 -13 0 -14 13 0 14 -33 0 -37 11 0 13 -11 0 -13 8 0 9 -7 -1 -8 53 0 60 -32 0 -36 32 0 36 -52 0 -59 57 1 65 -33 0 -38 53 0 60 -83 -1 -93 54 0 60 -6 -19 -24 33 19 55 -76 -1 -86 76 1 86 -76 -1 -86 59 1 67 26 blend + -60 30 203 30 -9 9 67 7 -7 14 -14 30 -20 20 80 30 59 30 121 30 18 93 -30 30 -30 108 -23 0 -26 67 2 76 -98 -2 -111 42 0 47 -13 0 -14 13 0 14 -33 0 -37 11 0 13 -11 0 -13 8 0 8 -8 0 -8 53 0 60 -32 0 -36 32 0 36 -52 0 -59 57 1 65 -33 0 -38 53 0 60 -83 -1 -93 54 0 60 -6 -19 -24 33 19 55 -76 -1 -86 76 1 86 -76 -1 -86 59 1 67 26 blend hstemhm 77 30 42 30 139 30 23 30 71 10 74 30 15 30 16 30 158 30 28 30 -4 29 -14 0 -16 88 1 99 -82 -1 -92 87 1 98 -130 -1 -146 102 1 114 -73 -1 -82 74 2 84 -112 -2 -126 27 0 30 13 0 15 90 1 101 -126 -1 -142 75 1 84 -68 -1 -76 102 1 115 -144 -1 -162 94 1 105 -79 -1 -88 95 1 106 -81 -1 -91 74 1 83 22 blend vstemhm