Skip to content

Commit

Permalink
compatibility with older rsvg-convert
Browse files Browse the repository at this point in the history
The `--page-width` paramater is only supported since rsvg-convert
version 2.52. For the time being, we avoid it and, instead, add copies
of the launcher icon SVG file with different viewports.
  • Loading branch information
mwageringel committed Jul 22, 2022
1 parent b527479 commit 8ec6eb4
Show file tree
Hide file tree
Showing 4 changed files with 190 additions and 6 deletions.
10 changes: 5 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ icons-android: android/app/src/main/res/mipmap-hdpi/ic_launcher.png
assets/launcher_icon.png: assets/launcher_icon.svg
rsvg-convert --width=1024 --height=1024 --keep-aspect-ratio assets/launcher_icon.svg > $@
assets/launcher_icon_adaptive.png: assets/launcher_icon_adaptive.svg
rsvg-convert --page-width=1024 --page-height=1024 --width=584 --height=584 --top=220 --left=220 --keep-aspect-ratio assets/launcher_icon_adaptive.svg > $@
rsvg-convert --width=1024 --height=1024 --keep-aspect-ratio assets/launcher_icon_adaptive.svg > $@
android/app/src/main/res/mipmap-hdpi/ic_launcher.png: assets/launcher_icon.png assets/launcher_icon_adaptive.png
$(FLUTTER) pub get
$(FLUTTER) pub run flutter_launcher_icons:main
Expand All @@ -46,12 +46,12 @@ web/icons/Icon-192.png: assets/launcher_icon.svg
web/icons/Icon-512.png: assets/launcher_icon.svg
mkdir -p web/icons/
rsvg-convert --width=512 --height=512 --keep-aspect-ratio assets/launcher_icon.svg > $@
web/icons/Icon-maskable-192.png: assets/launcher_icon_adaptive.svg
web/icons/Icon-maskable-192.png: assets/launcher_icon_maskable.svg
mkdir -p web/icons/
rsvg-convert --page-width=192 --page-height=192 --width=150 --height=150 --top=21 --left=21 --keep-aspect-ratio -b '#536dfeff' assets/launcher_icon_adaptive.svg > $@
web/icons/Icon-maskable-512.png: assets/launcher_icon_adaptive.svg
rsvg-convert --width=192 --height=192 --keep-aspect-ratio -b '#536dfeff' assets/launcher_icon_maskable.svg > $@
web/icons/Icon-maskable-512.png: assets/launcher_icon_maskable.svg
mkdir -p web/icons/
rsvg-convert --page-width=512 --page-height=512 --width=400 --height=400 --top=56 --left=56 --keep-aspect-ratio -b '#536dfeff' assets/launcher_icon_adaptive.svg > $@
rsvg-convert --width=512 --height=512 --keep-aspect-ratio -b '#536dfeff' assets/launcher_icon_maskable.svg > $@
icons-clean:
rm -f android/app/src/main/res/mipmap-*/ic_launcher.png
rm -f website/favicon.ico web/favicon.ico web/icons/*.png
Expand Down
2 changes: 1 addition & 1 deletion assets/launcher_icon_adaptive.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
92 changes: 92 additions & 0 deletions assets/launcher_icon_alt.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
92 changes: 92 additions & 0 deletions assets/launcher_icon_maskable.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8ec6eb4

Please sign in to comment.