summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Godfrey-Kittle <jamesgk@google.com>2015-06-19 14:33:37 -0700
committerJames Godfrey-Kittle <jamesgk@google.com>2015-06-19 14:33:37 -0700
commit43ffca40ed5d8030615a99f8ed6e0386487ea641 (patch)
tree78d1e4d9be39fd29a7142045ef5402905e62c16b
parent796196bf0d6c9241186da1e2d6937c6a08d84161 (diff)
Don't round interpolated component scaling values.
Basically a redo of 9292364c1a122498ada2616fdd20683c27c80e15, except more conservative.
-rw-r--r--scripts/lib/fontbuild/mix.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/scripts/lib/fontbuild/mix.py b/scripts/lib/fontbuild/mix.py
index 63f218f..58ef246 100644
--- a/scripts/lib/fontbuild/mix.py
+++ b/scripts/lib/fontbuild/mix.py
@@ -122,8 +122,8 @@ class FGlyph:
g.width = self._derefX(self.width)
if len(g.components) == len(self.components):
for i in range(len(self.components)):
- g.components[i].scale = (self._derefX(self.components[i][0] + 0),
- self._derefY(self.components[i][1] + 0))
+ g.components[i].scale = (self._derefX(self.components[i][0] + 0, asInt=False),
+ self._derefY(self.components[i][1] + 0, asInt=False))
g.components[i].offset = (self._derefX(self.components[i][0] + 1),
self._derefY(self.components[i][1] + 1))
if len(g.anchors) == len(self.anchors):
@@ -202,11 +202,13 @@ class FGlyph:
ng.name = self.name
return ng
- def _derefX(self,id):
- return int(round(self.dataX[id]))
+ def _derefX(self,id, asInt=True):
+ val = self.dataX[id]
+ return int(round(val)) if asInt else val
- def _derefY(self,id):
- return int(round(self.dataY[id]))
+ def _derefY(self,id, asInt=True):
+ val = self.dataY[id]
+ return int(round(val)) if asInt else val
def addDiff(self,gB,gC):
newGlyph = self + (gB - gC)