mirror of
https://github.com/godotengine/godot-design.git
synced 2026-01-04 14:09:55 +03:00
Small "optimize.py" fix, and add instructions for icon optimization in "README.md"
This commit is contained in:
@@ -20,6 +20,14 @@
|
||||
- **`wallpapers`**: Official or fan-made wallpapers.
|
||||
- **`websites`:** Everything related to Godot's Web presence or communities.
|
||||
|
||||
## Icon optimization
|
||||
|
||||
Editor icons must be first optimized before being added to the engine, to do so:
|
||||
- Add them to the "/engine/icons/svg" folder.
|
||||
- Run the "optimize.py" script (you must have `scour` installed).
|
||||
|
||||
The optimized icons will be generated in the "/engine/icons/optimized" folder.
|
||||
|
||||
## License
|
||||
|
||||
Unless otherwise specified, files contained in this repository are licensed
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
# this is a very quick-n-dirty script to optimize SVGS and generate
|
||||
# This is a very quick-n-dirty script to optimize SVGS and generate
|
||||
# darker variations for white themes.
|
||||
#
|
||||
|
||||
import os
|
||||
from os import listdir, mkdir
|
||||
@@ -95,7 +94,6 @@ scour_options = " ".join([
|
||||
"--indent=none",
|
||||
"--strip-xml-prolog",
|
||||
"--remove-descriptive-elements",
|
||||
"--enable-comment-stripping"
|
||||
])
|
||||
|
||||
|
||||
@@ -142,7 +140,7 @@ old_files = set(hashes.keys())
|
||||
new_files = set(new_hashes.keys())
|
||||
files_to_remove = old_files - new_files
|
||||
for rfile in files_to_remove:
|
||||
print("removing deprecated file: %s" % rfile)
|
||||
print("Removing deprecated file: %s" % rfile)
|
||||
# remove the actual files
|
||||
if isfile('%s/%s.svg' % (out_path, rfile)):
|
||||
os.remove('%s/%s.svg' % (out_path, rfile))
|
||||
@@ -151,5 +149,5 @@ for rfile in files_to_remove:
|
||||
|
||||
|
||||
with open("hashes", "w") as f:
|
||||
for (k,v) in new_hashes.items():
|
||||
for (k, v) in new_hashes.items():
|
||||
f.write("%s %s\n" % (k, v))
|
||||
|
||||
Reference in New Issue
Block a user