Changeset 548
- Timestamp:
- 01/30/12 09:19:05 (4 months ago)
- Files:
-
- branches/ufo3k/Lib/ufoLib/__init__.py (modified) (3 diffs)
- branches/ufo3k/Lib/ufoLib/converters.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/ufo3k/Lib/ufoLib/__init__.py
r515 r548 147 147 ) 148 148 # convert kerning and groups 149 kerning, groups = convertUFO1OrUFO2KerningToUFO3Kerning(149 kerning, groups, conversionMaps = convertUFO1OrUFO2KerningToUFO3Kerning( 150 150 self._upConvertedKerningData["originalKerning"], 151 151 deepcopy(self._upConvertedKerningData["originalGroups"]) … … 154 154 self._upConvertedKerningData["kerning"] = kerning 155 155 self._upConvertedKerningData["groups"] = groups 156 self._upConvertedKerningData["groupRenameMaps"] = conversionMaps 156 157 157 158 # support methods … … 269 270 raise UFOLibError(message) 270 271 return groups 272 273 def getKerningGroupConversionRenameMaps(self): 274 """ 275 Get maps defining the renaming that was done during any 276 needed kerning group conversion. This method returns a 277 dictionary of this form: 278 279 { 280 "side1" : {"old group name" : "new group name"}, 281 "side2" : {"old group name" : "new group name"} 282 } 283 284 When no conversion has been performed, the side1 and side2 285 dictionaries will be empty. 286 """ 287 if self._formatVersion >= 3: 288 return dict(side1={}, side2={}) 289 # use the public group reader to force the load and 290 # conversion of the data if it hasn't happened yet. 291 self.readGroups() 292 return self._upConvertedKerningData["groupRenameMaps"] 271 293 272 294 # fontinfo.plist branches/ufo3k/Lib/ufoLib/converters.py
r361 r548 55 55 groups[newName] = group 56 56 # Return the kerning and the groups. 57 return newKerning, groups 57 return newKerning, groups, dict(side1=firstRenamedGroups, side2=secondRenamedGroups) 58 58 59 59 def makeUniqueGroupName(name, groupNames, counter=0): … … 95 95 ... "DGroup" : ["D"], 96 96 ... } 97 >>> kerning, groups = convertUFO1OrUFO2KerningToUFO3Kerning(97 >>> kerning, groups, maps = convertUFO1OrUFO2KerningToUFO3Kerning( 98 98 ... testKerning, testGroups) 99 99 >>> expected = {
