Skip to content
This repository has been archived by the owner on Jul 17, 2024. It is now read-only.

Commit

Permalink
Merge pull request #170 from adobe-type-tools/advance-hashing
Browse files Browse the repository at this point in the history
Default advance width value to 0 not 1000
  • Loading branch information
khaledhosny authored Jun 2, 2019
2 parents 1d7465b + 038355f commit 9fa41cf
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
4 changes: 2 additions & 2 deletions python/psautohint/ufoFont.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ def get_glyph_bez(glyph, round_coords):
pen = BezPen(glyph.glyphSet, round_coords)
glyph.draw(pen)
if not hasattr(glyph, "width"):
glyph.width = 1000
glyph.width = 0
return pen.bez

def _get_or_skip_glyph(self, name, round_coords, doAll):
Expand Down Expand Up @@ -803,7 +803,7 @@ class HashPointPen(AbstractPointPen):

def __init__(self, glyph):
self.glyphset = getattr(glyph, "glyphSet", None)
self.width = norm_float(round(getattr(glyph, "width", 1000), 9))
self.width = norm_float(round(getattr(glyph, "width", 0), 9))
self.data = ["w%s" % self.width]

def getHash(self):
Expand Down
2 changes: 1 addition & 1 deletion tests/integration/data
Submodule data updated 682 files
10 changes: 10 additions & 0 deletions tests/integration/test_hint.py
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,16 @@ def test_hashmap_new_version(tmpdir, caplog):
hintFiles(options)


def test_hashmap_advance(tmpdir):
path = "%s/dummy/hashmap_advance.ufo" % DATA_DIR
out = str(tmpdir / basename(path)) + ".out"
options = Options(path, out)

hintFiles(options)

assert differ([path, out])


def test_hashmap_transform(tmpdir):
path = "%s/dummy/hashmap_transform.ufo" % DATA_DIR
out = str(tmpdir / basename(path)) + ".out"
Expand Down

0 comments on commit 9fa41cf

Please sign in to comment.