4 Commits

Author SHA1 Message Date
RobTheFiveNine
053ed9fcbc Add .gitignore 2023-09-05 21:49:27 +01:00
RobTheFiveNine
8a78f55a85 Update build script to output into dpi specific folders 2023-09-05 21:38:05 +01:00
RobTheFiveNine
abf499a986 Add sample 2023-09-05 16:14:36 +01:00
RobTheFiveNine
9bea3e09a0 Add keyboard icons 2023-09-05 15:52:06 +01:00
6 changed files with 2017 additions and 120 deletions

4
.gitignore vendored Normal file
View File

@@ -0,0 +1,4 @@
# Build fragments
build/
*.zip

11
LICENSE.dist.txt Normal file
View File

@@ -0,0 +1,11 @@
This asset pack is made available under the Creative Commons Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.
This means you are free to:
- Copy and redistribute the material in any medium or format and remix
- Transform and build upon the material for any purpose, even commercially
You can find more information about the license online at https://creativecommons.org/licenses/by-sa/4.0/
Attribution can be linked to the distribution page at https://robthefivenine.itch.io/flat-gamepad-icons or to my GitHub page at https://github.com/RobTheFiveNine
Additionally, if you do use it in any of your projects, I'd be interested to hear about it! If you'd like to let me know, please reach out via any of the methods listed on my GitHub profile.

View File

@@ -1,14 +1,26 @@
declare -a dpis=("50" "96" "150" "300")
ids=$(grep -oP 'id="(generic|xb|ps|switch)_.+?"' icons.svg | cut -d '"' -f 2)
ids=$(grep -oP 'id="(generic|xb|ps|switch|kb)_.+?"' icons.svg | cut -d '"' -f 2)
mkdir -p build
rm build/*
rm -rf build/*
for dpi in "${dpis[@]}"
do
mkdir -p "build/${dpi}dpi"
while read id; do
echo "Building $id @ $dpi dpi..."
inkscape --export-id="$id" --export-id-only -d "$dpi" --export-type=png -o "build/${id}.${dpi}dpi.png" icons.svg 2> /dev/null
inkscape --export-id="$id" --export-id-only -d "$dpi" --export-type=png -o "build/${dpi}dpi/${id}.png" icons.svg 2> /dev/null
done <<< "$ids"
done
cp LICENSE.dist.txt build/LICENSE.txt
echo "Compressing to flat-gamepad-icons.zip..."
rm -f flat-gamepad-icons.zip
cd build
zip -q -r -9 ../flat-gamepad-icons.zip *
cd ..
echo "Done."

2098
icons.svg

File diff suppressed because it is too large Load Diff

Before

Width:  |  Height:  |  Size: 83 KiB

After

Width:  |  Height:  |  Size: 167 KiB

BIN
sample.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 70 KiB

View File

@@ -2,11 +2,11 @@
echo -n "Checking file count... "
file_count=$(ls -A build/ | wc -l)
if [[ $file_count -eq 196 ]]; then
if [[ $file_count -eq 425 ]]; then
echo -e "\xE2\x9C\x94"
else
echo -e $"\u274c"
echo " - Expected 196 files but found $file_count"
echo " - Expected 425 files but found $file_count"
fi
@@ -17,7 +17,7 @@ for size in 132x132 132x70 264x139 264x264 44x23 44x44 84x45 84x84; do
done
sizes=$(identify build/* | grep -oP "PNG.+?\+" | cut -d " " -f 2 | sort -u)
sizes=$(identify build/*.png | grep -oP "PNG.+?\+" | cut -d " " -f 2 | sort -u)
echo -n "Checking icon resolutions... "
pass=1