@@ -0,0 +1,1703 @@
+#! /usr/bin/env python%0A%0Afrom __future__ import print_function, division, absolute_import%0Afrom fontTools.misc.py23 import *%0Afrom fontTools.ttLib import TTFont%0Afrom fontTools.ttLib.tables import otTables%0Aimport sys%0A%0Aif len(sys.argv) != 2:%0A%09print(%22usage: layout-features.py fontfile.ttf%22)%0A%09sys.exit(1)%0Afontfile = sys.argv%5B1%5D%0Afont = TTFont(fontfile)%0A%0Afor tag in ('GSUB', 'GPOS'):%0A%09if not tag in font: continue%0A%09print(%22Table:%22, tag)%0A%09table = font%5Btag%5D.table%0A%09if not table.ScriptList or not table.FeatureList: continue%0A%09featureRecords = table.FeatureList.FeatureRecord%0A%09for script in table.ScriptList.ScriptRecord:%0A%09%09print(%22  Script:%22, script.ScriptTag)%0A%09%09if not script.Script:%0A%09%09%09print (%22    Null script.%22)%0A%09%09%09continue%0A%09%09languages = list(script.Script.LangSysRecord)%0A%09%09if script.Script.DefaultLangSys:%0A%09%09%09defaultlangsys = otTables.LangSysRecord()%0A%09%09%09defaultlangsys.LangSysTag = %22default%22%0A%09%09%09defaultlangsys.LangSys = script.Script.DefaultLangSys%0A%09%09%09languages.insert(0, defaultlangsys)%0A%09%09for langsys in languages:%0A%09%09%09print(%22    Language:%22, langsys.LangSysTag)%0A%09%09%09if not langsys.LangSys:%0A%09%09%09%09print (%22    Null language.%22)%0A%09%09%09%09continue%0A%09%09%09features = %5BfeatureRecords%5Bindex%5D for index in langsys.LangSys.FeatureIndex%5D%0A%09%09%09if langsys.LangSys.ReqFeatureIndex != 0xFFFF:%0A%09%09%09%09record = featureRecords%5Blangsys.LangSys.ReqFeatureIndex%5D%0A%09%09%09%09requiredfeature = otTables.FeatureRecord()%0A%09%09%09%09requiredfeature.FeatureTag = 'required(%25s)' %25 record.FeatureTag%0A%09%09%09%09requiredfeature.Feature = record.Feature%0A%09%09%09%09features.insert(0, requiredfeature)%0A%09%09%09for feature in features:%0A%09%09%09%09print(%22      Feature:%22, feature.FeatureTag)%0A%09%09%09%09lookups = feature.Feature.LookupListIndex%0A%09%09%09%09print(%22        Lookups:%22, ','.join(str(l) for l in lookups))%0A

Add layout-features.py that prints GSUB/GPOS features