def fix_attachlist(font):
    modified = False
    try:
        attach_points = font['GDEF'].table.AttachList.AttachPoint
    except (KeyError, AttributeError):
        attach_points = []

    for attach_point in attach_points:
        points = sorted(set(attach_point.PointIndex))
        if points != attach_point.PointIndex:
            attach_point.PointIndex = points
            attach_point.PointCount = len(points)
            modified = True

    if modified:
        print 'Fixed GDEF.AttachList'

    return modified
Fix duplicate attachment points in GDEF table.
dataset/ETHPy150Open googlei18n/nototools/nototools/autofix_for_release.py/fix_attachlist