summaryrefslogtreecommitdiffstats
path: root/recipes-graphics/ttf-fonts/files/cleaner.py
diff options
context:
space:
mode:
authorMatt Ranostay <matt.ranostay@konsulko.com>2020-05-28 03:19:28 +0300
committerMatt Ranostay <matt.ranostay@konsulko.com>2020-05-28 05:03:13 +0300
commit9a452f28730b8f560d47b33a8a2d19fdd399bf2c (patch)
tree52862d9a5c0f8cf86f4c07a104befa373b79c8a4 /recipes-graphics/ttf-fonts/files/cleaner.py
parentb83de510d5e50285805b557866b94c5be3dd2a3f (diff)
ttf-dejavu: clean up emoji removal
Remove emoji.json and just add integer index to check for the actual emojis unicode indexes. Bug-AGL: SPEC-2701 Change-Id: I5d2c0a4049770ed17a873646ae9986b3ee72199d Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Diffstat (limited to 'recipes-graphics/ttf-fonts/files/cleaner.py')
-rw-r--r--recipes-graphics/ttf-fonts/files/cleaner.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/recipes-graphics/ttf-fonts/files/cleaner.py b/recipes-graphics/ttf-fonts/files/cleaner.py
index 9b9261339..e19ed1d9c 100644
--- a/recipes-graphics/ttf-fonts/files/cleaner.py
+++ b/recipes-graphics/ttf-fonts/files/cleaner.py
@@ -1,10 +1,11 @@
-from json import load
from sys import argv
+emoji_list = [ 9725, 9726, 9748, 9749, 9800, 9801, 9802, 9803, 9804, 9805, 9806, 9807, 9808, 9809, 9810, 9811, 9855, 9875, 9889, 9898, 9899, 10175, 127183, 127761, 127762, 127763, 127764, 127765, 127766, 127767, 127768, 128045, 128046, 128049, 128053, 128512, 128513, 128514, 128515, 128516, 128517, 128518, 128519, 128520, 128521, 128522, 128523, 128524, 128525, 128526, 128527, 128528, 128529, 128530, 128531, 128532, 128533, 128534, 128535, 128536, 128537, 128538, 128539, 128540, 128541, 128542, 128543, 128544, 128545, 128546, 128547, 128549, 128550, 128551, 128552, 128553, 128554, 128555, 128557, 128558, 128559, 128560, 128561, 128562, 128563, 128564, 128565, 128566, 128567, 128568, 128569, 128570, 128571, 128572, 128573, 128574, 128575, 128576, 128579 ]
+
ttf = fontforge.open(argv[1])
-for emoji in load(open('../../emoji.json')):
+for emoji in emoji_list:
try:
- ttf.removeGlyph(int(emoji['unified'], 16))
+ ttf.removeGlyph(emoji)
except ValueError:
pass
ttf.generate(argv[1])