diff options
author | Behdad Esfahbod <behdad@behdad.org> | 2015-06-20 17:39:18 -0700 |
---|---|---|
committer | Behdad Esfahbod <behdad@behdad.org> | 2015-06-20 17:39:18 -0700 |
commit | 0efa603cda97c9920ebb377ac8883dbef671e1aa (patch) | |
tree | 78d1e4d9be39fd29a7142045ef5402905e62c16b | |
parent | 12671eac9ed0f6be5fff8202d115d56efca864ae (diff) | |
parent | 43ffca40ed5d8030615a99f8ed6e0386487ea641 (diff) |
Merge pull request #63 from google/contour-fix
Contour fix
-rw-r--r-- | scripts/lib/fontbuild/mix.py | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/scripts/lib/fontbuild/mix.py b/scripts/lib/fontbuild/mix.py index 2c741fb..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 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 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) |