Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ TEST_TARGET := $(if $(PROJECT),$(PROJECT),$(SLNF))

.PHONY: help restore build test mutate mutate-src format format-check codeql ci clean \
android-image android-image-rebuild apk aab emulator emulator-tablet install run-android \
logcat uninstall screenshots play-listing-check play-screenshots phone-screenshots
logcat uninstall screenshots play-listing-check play-screenshots phone-screenshots \
feature-graphic

help: ## Show this help
@awk 'BEGIN {FS = ":.*## "} \
Expand Down Expand Up @@ -289,5 +290,8 @@ play-screenshots: ## Regenerate docs/play/screenshots/*.png at 9:16 for the Play
$(DOTNET) test tests/FwAssist.Acceptance.Tests -c $(CONFIG) \
--filter FullyQualifiedName~DemoFlowRenderTests

feature-graphic: ## Regenerate docs/play/feature-graphic-1024x500.png (needs magick and rsvg-convert)
scripts/build-feature-graphic.sh

play-listing-check: ## Check the Play Store listing text against the Console's limits
scripts/check-play-listing.sh
Binary file added docs/play/feature-graphic-1024x500.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/releasing.md
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ reproducible instead of being retyped from memory each time:
|---|---|---|
| Text — name, short and full description, reviewer notes | [`docs/play/listing-de-DE.md`](play/listing-de-DE.md) | by hand; `make play-listing-check` |
| Icon, 512x512, 32-bit | `docs/play/icon-512.png` | yes |
| Feature graphic, 1024x500, no alpha | `docs/play/feature-graphic-1024x500.png` | not yet |
| Feature graphic, 1024x500, no alpha | `docs/play/feature-graphic-1024x500.png` | `make feature-graphic` |
| Phone screenshots, 9:16 | `docs/play/screenshots/*.png` | `make play-screenshots` |

`make play-listing-check` counts characters against the Console's limits — it
Expand Down
66 changes: 66 additions & 0 deletions scripts/build-feature-graphic.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
#!/usr/bin/env bash
# Renders docs/play/feature-graphic-1024x500.png, the Play listing's feature graphic.
#
# The same horizontal lockup as Lagebuch's (packaging/logo/build-logo-assets.sh there), so the
# two listings read as one family: the mark beside the wordmark, on the app background, set in
# the app's own fonts (Oswald for the wordmark, Barlow for the tagline).
#
# The mark is the launcher icon below API 26 (Resources/drawable/ic_launcher.xml): a signal disc
# with the white four-tile glyph. The glyph's path is read from ic_launcher_foreground.xml rather
# than copied here, so a new launcher glyph changes the banner on the next run.
#
# Play crops this asset to several ratios, so the lockup stays in the middle with nothing near an
# edge, and it rejects alpha outright, hence -alpha off and PNG24. -strip and the excluded
# date/time chunks keep a re-run byte-identical, so an unchanged graphic never shows up in a diff.
#
# Needs ImageMagick 7 (magick) and rsvg-convert.
set -euo pipefail

repo_root=$(cd "$(dirname "$0")/.." && pwd)
fonts="$repo_root/src/FwAssist.Ui/Assets/Fonts"
foreground="$repo_root/src/FwAssist.App.Android/Resources/drawable/ic_launcher_foreground.xml"
out="$repo_root/docs/play/feature-graphic-1024x500.png"

# Theme/Tokens.axaml: AppBgColor, SignalDeepColor (= @color/icon_signal), SignalColor, TextSecondaryColor.
app_bg="#0B0E13"
disc="#C71E12"
accent="#FF3D2E"
tagline_ink="#9AA7B8"

glyph=$(sed -n 's/.*android:pathData="\([^"]*\)".*/\1/p' "$foreground")
test -n "$glyph" || { echo "No pathData in $foreground" >&2; exit 1; }

t=$(mktemp -d)
trap 'rm -rf "$t"' EXIT

# The disc and the glyph at the proportions of ic_launcher.xml: a 24-unit disc, the glyph at 0.6.
cat > "$t/mark.svg" <<EOF
<svg xmlns="http://www.w3.org/2000/svg" width="300" height="300" viewBox="0 0 24 24">
<circle cx="12" cy="12" r="12" fill="$disc"/>
<g transform="translate(4.8 4.8) scale(0.6)">
<path fill="#FFFFFF" fill-rule="evenodd" d="$glyph"/>
</g>
</svg>
EOF
rsvg-convert -w 300 -h 300 "$t/mark.svg" -o "$t/mark.png"

magick -background none -fill "#FFFFFF" -font "$fonts/Oswald-SemiBold.ttf" \
-pointsize 112 -kerning 3 label:"FWASSIST" +repage "PNG32:$t/word.png"
magick -background none -fill "$tagline_ink" -font "$fonts/Barlow-Regular.ttf" \
-pointsize 30 label:"Kleine Helfer für die Feuerwehr" +repage "PNG32:$t/tag.png"
magick -size 110x6 "xc:$accent" +repage "PNG32:$t/rule.png"
magick -size 1x18 "xc:none" +repage "PNG32:$t/gap.png"

# Each piece is its own file and appended, as in Lagebuch: -append takes its width from the first
# image's canvas, so assembling it in one command can crop the wider line.
magick "$t/word.png" "$t/gap.png" "$t/rule.png" "$t/gap.png" "$t/tag.png" \
-background none -gravity west -append +repage "PNG32:$t/text.png"

magick -size 1024x500 "xc:$app_bg" \
\( "$t/mark.png" "$t/text.png" -background none -gravity center +smush 48 \) \
-gravity center -compose over -composite \
-alpha remove -alpha off \
-strip -define png:exclude-chunks=date,time \
"PNG24:$out"

magick identify -format '%f %wx%h %[channels] %B bytes\n' "$out"