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

Commit 9fa41cf

Browse files
authored
Merge pull request #170 from adobe-type-tools/advance-hashing
Default advance width value to 0 not 1000
2 parents 1d7465b + 038355f commit 9fa41cf

3 files changed

Lines changed: 13 additions & 3 deletions

File tree

python/psautohint/ufoFont.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -558,7 +558,7 @@ def get_glyph_bez(glyph, round_coords):
558558
pen = BezPen(glyph.glyphSet, round_coords)
559559
glyph.draw(pen)
560560
if not hasattr(glyph, "width"):
561-
glyph.width = 1000
561+
glyph.width = 0
562562
return pen.bez
563563

564564
def _get_or_skip_glyph(self, name, round_coords, doAll):
@@ -803,7 +803,7 @@ class HashPointPen(AbstractPointPen):
803803

804804
def __init__(self, glyph):
805805
self.glyphset = getattr(glyph, "glyphSet", None)
806-
self.width = norm_float(round(getattr(glyph, "width", 1000), 9))
806+
self.width = norm_float(round(getattr(glyph, "width", 0), 9))
807807
self.data = ["w%s" % self.width]
808808

809809
def getHash(self):

tests/integration/data

Submodule data updated 682 files

tests/integration/test_hint.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,16 @@ def test_hashmap_new_version(tmpdir, caplog):
304304
hintFiles(options)
305305

306306

307+
def test_hashmap_advance(tmpdir):
308+
path = "%s/dummy/hashmap_advance.ufo" % DATA_DIR
309+
out = str(tmpdir / basename(path)) + ".out"
310+
options = Options(path, out)
311+
312+
hintFiles(options)
313+
314+
assert differ([path, out])
315+
316+
307317
def test_hashmap_transform(tmpdir):
308318
path = "%s/dummy/hashmap_transform.ufo" % DATA_DIR
309319
out = str(tmpdir / basename(path)) + ".out"

0 commit comments

Comments
 (0)