Changeset 260
- Timestamp:
- 07/20/11 04:41:26 (10 months ago)
- Files:
-
- trunk/Lib/robofab/pens/digestPen.py (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/Lib/robofab/pens/digestPen.py
r26 r260 41 41 return tuple(self._data) 42 42 43 def getDigestPointsOnly(self ):44 """ Return a tuple with all coordinates of all points,43 def getDigestPointsOnly(self, needSort=True): 44 """ Return a tuple with all coordinates of all points, 45 45 but without smooth info or drawing instructions. 46 46 For instance if you want to compare 2 glyphs in shape, … … 48 48 """ 49 49 points = [] 50 from types import TupleType 50 51 for item in self._data: 51 points.append(item[0]) 52 points.sort() 52 if type(item) == TupleType: 53 points.append(item[0]) 54 if needSort: 55 points.sort() 53 56 return tuple(points) 54 57 … … 67 70 self._data.append(baseGlyphName) 68 71 72 if __name__ == "__main__": 73 """ 74 75 beginPath 76 ((112, 651), 'line', False, None) 77 ((112, 55), 'line', False, None) 78 ((218, 55), 'line', False, None) 79 ((218, 651), 'line', False, None) 80 endPath 81 82 """ 83 # a test 84 85 from robofab.objects.objectsRF import RGlyph 86 87 g = RGlyph() 88 p = g.getPen() 89 p.moveTo((112, 651)) 90 p.lineTo((112, 55)) 91 p.lineTo((218, 55)) 92 p.lineTo((218, 651)) 93 p.closePath() 94 95 print g, len(g) 96 97 digestPen = DigestPointPen() 98 g.drawPoints(digestPen) 99 100 print 101 print "getDigest", digestPen.getDigest() 102 103 print 104 print "getDigestPointsOnly", digestPen.getDigestPointsOnly() 105 106
