#FLM: Export kerning naar tagged text OT from robofab.world import CurrentFont from robofab.interface.all.dialogs import GetFolder, ProgressBar myFont = CurrentFont() myKerning = myFont.kerning myFontfam = myFont.info.familyName myFontstyle = myFont.info.styleName myPath = GetFolder() if myPath: myPath += ":" + myFontfam + "-" + myFontstyle + "_kern.txt" myFile = open(myPath, "w") myFile.write("" + chr(10)) myFile.write(">" + chr(10)) myBar = ProgressBar('Exporting kerning...', len(myKerning)) for myPair in myKerning: myComb = str(myPair).split() myLeft=myComb[0][2:-2] myRight=myComb[1][1:-2] myLeftid = myFont[myLeft].index myRightid = myFont[myRight].index myLine = "<0xFFFD><0xFFFD> " + str(myKerning[myPair]) + chr(10) + "" myFile.write(myLine) myBar.tick() myFile.close() myBar.close() print "Generated kerning file for", myFontfam, myFontstyle print "Done"