Changeset 124
- Timestamp:
- 12/19/07 11:03:40 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
packages/fontMath/trunk/Lib/fontMath/mathKerning.py
r123 r124 33 33 def updateGroups(self, groups): 34 34 self._groupMap = {} 35 self._groups = {} 35 36 groupDict = groups 36 37 groupMap = self._groupMap … … 38 39 if not groupName.startswith("@"): 39 40 continue 41 self._groups[groupName] = list(glyphList) 40 42 for glyphName in glyphList: 41 43 if not groupMap.has_key(glyphName): … … 54 56 55 57 def groups(self): 56 g = {} 57 for glyphName, groupList in self._groupMap.items(): 58 for groupName in groupList: 59 if not g.has_key(groupName): 60 g[groupName] = [] 61 if not glyphName in g[groupName]: 62 g[groupName].append(glyphName) 63 return g 58 return deepcopy(self._groups) 64 59 65 60 def getGroupsForGlyph(self, glyphName): … … 78 73 """ 79 74 return list(self._groupMap.get(glyphName, [])) 75 76 def getGroupContents(self, groupName): 77 """ 78 >>> groups = { 79 ... "@A1" : ["A", "B"] 80 ... } 81 >>> obj = MathKerning({}, groups) 82 >>> obj.getGroupContents("@A1") 83 ['A', 'B'] 84 """ 85 return list(self._groups[groupName]) 80 86 81 87 def __getitem__(self, pair):
