Browse Source

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:").
James Godfrey-Kittle 9 years ago
parent
commit
374cdb9618
1 changed files with 1 additions and 1 deletions
  1. 1 1
      scripts/lib/fontbuild/generateGlyph.py

+ 1 - 1
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)