From 8ec6eb46d2576c8071af1fbe524164644984565c Mon Sep 17 00:00:00 2001 From: Markus Wageringel Date: Fri, 22 Jul 2022 19:45:07 +0200 Subject: [PATCH] compatibility with older rsvg-convert 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. --- Makefile | 10 ++-- assets/launcher_icon_adaptive.svg | 2 +- assets/launcher_icon_alt.svg | 92 +++++++++++++++++++++++++++++++ assets/launcher_icon_maskable.svg | 92 +++++++++++++++++++++++++++++++ 4 files changed, 190 insertions(+), 6 deletions(-) create mode 100644 assets/launcher_icon_alt.svg create mode 100644 assets/launcher_icon_maskable.svg diff --git a/Makefile b/Makefile index d907b72..3b6517e 100644 --- a/Makefile +++ b/Makefile @@ -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 @@ -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 diff --git a/assets/launcher_icon_adaptive.svg b/assets/launcher_icon_adaptive.svg index fbe47db..5aa445b 100644 --- a/assets/launcher_icon_adaptive.svg +++ b/assets/launcher_icon_adaptive.svg @@ -4,7 +4,7 @@ + + + + + + + + + + + + + + + + + diff --git a/assets/launcher_icon_maskable.svg b/assets/launcher_icon_maskable.svg new file mode 100644 index 0000000..38d1cba --- /dev/null +++ b/assets/launcher_icon_maskable.svg @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + +