diff --git a/Makefile b/Makefile index bc9dd7a144db..e1cbfbf6f740 100644 --- a/Makefile +++ b/Makefile @@ -1238,6 +1238,7 @@ endif '$(NODE)' tools/license2rtf.mjs < LICENSE > \ $(MACOSOUTDIR)/installer/productbuild/Resources/license.rtf cp doc/osx_installer_logo.png $(MACOSOUTDIR)/installer/productbuild/Resources + cp doc/osx_installer_logo_dark.png $(MACOSOUTDIR)/installer/productbuild/Resources pkgbuild --version $(FULLVERSION) \ --identifier org.nodejs.node.pkg \ --root $(MACOSOUTDIR)/dist/node $(MACOSOUTDIR)/pkgs/node-$(FULLVERSION).pkg diff --git a/doc/full-white-stripe.jpg b/doc/full-white-stripe.jpg index 798473392fb6..8c05b9bdb497 100644 Binary files a/doc/full-white-stripe.jpg and b/doc/full-white-stripe.jpg differ diff --git a/doc/osx_installer_logo.png b/doc/osx_installer_logo.png index 765a2193d26f..4b0470b46e2a 100644 Binary files a/doc/osx_installer_logo.png and b/doc/osx_installer_logo.png differ diff --git a/doc/osx_installer_logo_dark.png b/doc/osx_installer_logo_dark.png new file mode 100644 index 000000000000..e434e19d7f20 Binary files /dev/null and b/doc/osx_installer_logo_dark.png differ diff --git a/doc/thin-white-stripe.jpg b/doc/thin-white-stripe.jpg index 5342304e79da..3c644e5afd74 100644 Binary files a/doc/thin-white-stripe.jpg and b/doc/thin-white-stripe.jpg differ diff --git a/tools/generate-installer-assets.sh b/tools/generate-installer-assets.sh new file mode 100755 index 000000000000..1a660b14cafc --- /dev/null +++ b/tools/generate-installer-assets.sh @@ -0,0 +1,69 @@ +#!/bin/sh +# Regenerates the installer logo assets in doc/ from the standardized +# Node.js logo artwork (https://github.com/openjs-foundation/artwork). +# +# The generated images are consumed by: +# - tools/msvs/msi/nodemsi/product.wxs (Windows MSI banner/dialog) +# - tools/macos-installer/productbuild/distribution.xml.tmpl +# (macOS installer background) +# +# The WiX UI bitmap slots are fixed-size (493x58 banner, 493x312 dialog) and +# the macOS background is placed unscaled (180x361), so the output dimensions +# must not change. Logo widths and offsets below were measured from the +# previous assets so the layout stays identical. +# +# Prerequisites: rsvg-convert (librsvg), magick (ImageMagick 7), curl +# +# Usage: tools/generate-installer-assets.sh + +set -e + +# Pinned artwork revision so the output is reproducible. +ARTWORK_REF=3816245ebbf4707bdafde748350ac8476b6b5b62 +ARTWORK_URL="https://raw.githubusercontent.com/openjs-foundation/artwork/$ARTWORK_REF/projects/nodejs" + +# Node.js brand green, matching the solid fill used in the standardized logo +# (see https://nodejs.org/en/about/branding). +GREEN='#5FA04E' + +DOC_DIR="$(dirname "$0")/../doc" +TMP_DIR="$(mktemp -d)" +trap 'rm -rf "$TMP_DIR"' EXIT + +curl -sSfL "$ARTWORK_URL/nodejs-logo-stacked-color.svg" \ + -o "$TMP_DIR/logo-light.svg" +curl -sSfL "$ARTWORK_URL/nodejs-logo-stacked-color-dark_background.svg" \ + -o "$TMP_DIR/logo-dark.svg" + +# out canvas stripe logo_w x y background logo +MANIFEST=' +thin-white-stripe.jpg 493x58 6 80 380 7 white light +full-white-stripe.jpg 493x312 6 116 37 89 white light +osx_installer_logo.png 180x361 0 142 19 254 none light +osx_installer_logo_dark.png 180x361 0 142 19 254 none dark +' + +echo "$MANIFEST" | while read -r out canvas stripe logo_w x y bg logo; do + [ -z "$out" ] && continue + + rsvg-convert -w "$logo_w" "$TMP_DIR/logo-$logo.svg" -o "$TMP_DIR/logo.png" + + width="${canvas%x*}" + if [ "$stripe" -gt 0 ]; then + draw="rectangle 0,0 $width,$((stripe - 1))" + else + draw='' + fi + + magick -size "$canvas" "canvas:$bg" \ + -fill "$GREEN" ${draw:+-draw "$draw"} \ + "$TMP_DIR/logo.png" -geometry "+$x+$y" -composite \ + -strip -quality 95 "$DOC_DIR/$out" + + got="$(magick identify -format '%wx%h' "$DOC_DIR/$out")" + if [ "$got" != "$canvas" ]; then + echo "error: $out is $got, expected $canvas" >&2 + exit 1 + fi + echo "generated doc/$out ($got)" +done diff --git a/tools/macos-installer/productbuild/distribution.xml.tmpl b/tools/macos-installer/productbuild/distribution.xml.tmpl index d9b9d00f26c0..44c4ab98ab4a 100644 --- a/tools/macos-installer/productbuild/distribution.xml.tmpl +++ b/tools/macos-installer/productbuild/distribution.xml.tmpl @@ -4,6 +4,7 @@ +