ttf-dejavu: remove emoji glyphs from dejavu fonts
[AGL/meta-agl-demo.git] / recipes-graphics / ttf-fonts / files / cleaner.py
diff --git a/recipes-graphics/ttf-fonts/files/cleaner.py b/recipes-graphics/ttf-fonts/files/cleaner.py
new file mode 100644 (file)
index 0000000..9b92613
--- /dev/null
@@ -0,0 +1,10 @@
+from json import load
+from sys import argv
+
+ttf = fontforge.open(argv[1])
+for emoji in load(open('../../emoji.json')):
+    try:
+        ttf.removeGlyph(int(emoji['unified'], 16))
+    except ValueError:
+        pass
+ttf.generate(argv[1])