Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def _get_glyph_width(glyph):
hash_pen = HashPointPen(glyph)
glyph.drawPoints(hash_pen)
return getattr(glyph, 'width', 0)
def recalcHashEntry(self, glyphName, glyph):
hashBefore, historyList = self.hashMap[glyphName]
hash_pen = HashPointPen(glyph)
glyph.drawPoints(hash_pen)
hashAfter = hash_pen.getHash()
if hashAfter != hashBefore:
self.hashMap[glyphName] = [hashAfter, historyList]
self.hashMapChanged = True