diff options
author | codecalm <codecalm@gmail.com> | 2021-01-20 22:32:36 +0100 |
---|---|---|
committer | codecalm <codecalm@gmail.com> | 2021-01-20 22:32:36 +0100 |
commit | 87982f9917024d1db40d0d266a5f19c7aa7c5b64 (patch) | |
tree | 59d2faf5cdfd31c580eaea80b741e057615904bd /generate.py | |
parent | import cleanup (diff) | |
download | tabler-icons-87982f9917024d1db40d0d266a5f19c7aa7c5b64.tar.xz |
build process improvement
Diffstat (limited to 'generate.py')
-rw-r--r-- | generate.py | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/generate.py b/generate.py deleted file mode 100644 index d763ed16..00000000 --- a/generate.py +++ /dev/null @@ -1,28 +0,0 @@ -import os -import fontforge - -# svg2ttf library does not support fill-rule="evenodd" so after converting icons to outlineStroke we fix path directions to work with "nonzero" -# more: https://github.com/tabler/tabler-icons/issues/13 - thanks for awesome suggestions in the issue - - -print ("Running fontforge to fix svg outline directions!") - -def files(path): - for file in os.listdir(path): - if os.path.isfile(os.path.join(path, file)): - yield file - -# refer to https://fontforge.org/docs/scripting/python/fontforge.html for documentation -# inspiration from https://github.com/FontCustom/fontcustom/blob/master/lib/fontcustom/scripts/generate.py - -font = fontforge.font() -for file in files("./icons-outlined"): - print (f"Correcting outline for {file}") - glyph = font.createChar(123, file) - glyph.importOutlines("./icons-outlined/" + file) - glyph.correctDirection() - glyph.export("./icons-outlined/" + file) - glyph.clear() - - -print ("Finished fixing svg outline directions!") |