summaryrefslogtreecommitdiff
path: root/scripts/lib/fontbuild/features.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib/fontbuild/features.py')
-rwxr-xr-xscripts/lib/fontbuild/features.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/scripts/lib/fontbuild/features.py b/scripts/lib/fontbuild/features.py
new file mode 100755
index 0000000..0e89a57
--- /dev/null
+++ b/scripts/lib/fontbuild/features.py
@@ -0,0 +1,16 @@
+import string
+from FL import *
+
+def CreateFeaFile(font, path):
+ fea_text = font.ot_classes
+ for cls in font.classes:
+ text = "@" + cls + "];\n"
+ text = string.replace(text, ":", "= [")
+ text = string.replace(text, "\'", "")
+ fea_text += text
+ for fea in font.features:
+ fea_text += fea.value
+ fea_text = string.replace(fea_text, "\r\n", "\n")
+ fout = open(path, "w")
+ fout.write(fea_text)
+ fout.close() \ No newline at end of file