mirror of
https://github.com/sudoxnym/brands.git
synced 2026-05-18 11:38:49 +00:00
Switch to rsvg-convert for mdi generation (#3734)
This commit is contained in:
parent
92c982435d
commit
fe301f5063
2 changed files with 21 additions and 22 deletions
|
|
@ -1,5 +1,9 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
if ! [ -x "$(command -v rsvg-convert)" ]; then
|
||||
apt install -y librsvg2-bin
|
||||
fi
|
||||
|
||||
# Copy folder, without symlinks, but use actual files instead
|
||||
mkdir -p build/_
|
||||
mkdir -p build/brands
|
||||
|
|
@ -21,30 +25,22 @@ find ./build -type f -name "icon.txt" | while read icon; do
|
|||
dir=$(dirname "${icon}")
|
||||
mdi=$(<${icon})
|
||||
mdi="${mdi##mdi:}"
|
||||
mogrify \
|
||||
-format png \
|
||||
-density 6400 \
|
||||
-background transparent \
|
||||
-fill "rgb(0,171,248,1.0)" \
|
||||
-opaque black \
|
||||
-trim \
|
||||
-resize 240x240 \
|
||||
-gravity center \
|
||||
-extent 256x256 \
|
||||
-write "${dir}/icon.png" \
|
||||
rsvg-convert \
|
||||
--stylesheet scripts/mdi.css \
|
||||
--keep-aspect-ratio \
|
||||
--height 256 \
|
||||
--width 256 \
|
||||
--background-color transparent \
|
||||
--output "${dir}/icon.png" \
|
||||
"mdi/svg/${mdi}.svg"
|
||||
|
||||
mogrify \
|
||||
-format png \
|
||||
-density 6400 \
|
||||
-background transparent \
|
||||
-fill "rgb(0,171,248,1.0)" \
|
||||
-opaque black \
|
||||
-trim \
|
||||
-resize 480x480 \
|
||||
-gravity center \
|
||||
-extent 512x512 \
|
||||
-write "${dir}/icon@2x.png" \
|
||||
rsvg-convert \
|
||||
--stylesheet scripts/mdi.css \
|
||||
--keep-aspect-ratio \
|
||||
--height 512 \
|
||||
--width 512 \
|
||||
--background-color transparent \
|
||||
--output "${dir}/icon@2x.png" \
|
||||
"mdi/svg/${mdi}.svg"
|
||||
|
||||
optipng -silent "${dir}/icon.png" "${dir}/icon@2x.png"
|
||||
|
|
|
|||
3
scripts/mdi.css
Normal file
3
scripts/mdi.css
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
svg {
|
||||
fill: rgb(0,171,248,1.0);
|
||||
}
|
||||
Loading…
Reference in a new issue