From 374cdb9618876e78418956be3688ce635d03083c Mon Sep 17 00:00:00 2001 From: James Godfrey-Kittle Date: Fri, 17 Jul 2015 14:00:15 -0700 Subject: Explicitly check anchor objects against None. This is necessary because of some implementation details in RoboFab; RAnchor objects always evaluate to False in a boolean context. Fixes a bug in which "top" anchors were not being added to composite glyphs, since they are added only when the "parenttop" anchor is present (which was checked for with a statement like "if anchor:"). --- scripts/lib/fontbuild/generateGlyph.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts/lib/fontbuild/generateGlyph.py') diff --git a/scripts/lib/fontbuild/generateGlyph.py b/scripts/lib/fontbuild/generateGlyph.py index d7e49d8..5f60683 100644 --- a/scripts/lib/fontbuild/generateGlyph.py +++ b/scripts/lib/fontbuild/generateGlyph.py @@ -91,7 +91,7 @@ def copyMarkAnchors(f, g, srcname, width): anchor_parent_top = anchor break - if anchor_parent_top: + if anchor_parent_top is not None: g.appendAnchor("top", anchor_parent_top.position) -- cgit v1.2.3