diff options
author | David Benson <david@draw.io> | 2021-11-29 18:54:42 +0300 |
---|---|---|
committer | David Benson <david@draw.io> | 2021-11-29 18:54:42 +0300 |
commit | a936af897fdfad553e056e95eaeba755cf3c189a (patch) | |
tree | eec977e25c522a5aea00e08d4d28086207e0eb54 | |
parent | 5f33ab84dedfb372036bdcaa0e7635b9e5f4dfd7 (diff) | |
parent | 08b30afd787a32b4ec0db7f28bbc57c4aba37bd3 (diff) |
Merge commit '08b30afd787a32b4ec0db7f28bbc57c4aba37bd3' into devv15.8.7
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | build/README.md | 1 | ||||
-rwxr-xr-x | build/create_macos_icon.sh | 81 | ||||
-rw-r--r-- | build/icon.icns | bin | 37027 -> 176780 bytes |
4 files changed, 82 insertions, 2 deletions
@@ -1,7 +1,7 @@ About ----- -**drawio-desktop** is a **diagrams.net** desktop app based on [Electron](https://electronjs.org/). draw.io is the old name for diagrams.net, we just don't want the hassle of changing all the binary's names. +**drawio-desktop** is a diagramming and whiteboarding desktop app based on [Electron](https://electronjs.org/) that wraps the [core draw.io editor](https://github.com/jgraph/drawio). Download built binaries from the [releases section](https://github.com/jgraph/drawio-desktop/releases). diff --git a/build/README.md b/build/README.md deleted file mode 100644 index a641074..0000000 --- a/build/README.md +++ /dev/null @@ -1 +0,0 @@ -icns created using iConvert Icons (Mac app, not the online site). The option used is "Mac OS icns file". diff --git a/build/create_macos_icon.sh b/build/create_macos_icon.sh new file mode 100755 index 0000000..ebd711c --- /dev/null +++ b/build/create_macos_icon.sh @@ -0,0 +1,81 @@ +#!/bin/bash + +set -eo pipefail + +# Config +SOURCE_FILE_PATH='./1024x1024.png' # has to be of size 1024x1024 px +OUT_ICON_NAME='icon' + + +# The "design" and magic numbers below are derived from Apple's macOS app icon +# guidelines and design templates: +# https://developer.apple.com/design/human-interface-guidelines/macos/icons-and-images/app-icon/ +# https://developer.apple.com/design/resources/#macos-apps +# +# Specifically, for an icon of 1024x: +# - outer bounding box: 1024x1024 px +# - border radius: ~22,85% (= 234 px) +# - icon grid size: 824x824 px +# - icon grid shadow size: x: 0px, y: 10px, blur: 10px, 30% black + + +# Make sure ImageMagick's convert and iconutil are available. +if ! hash convert 2>/dev/null || ! hash iconutil 2>/dev/null; then + echo "ERROR: This script requires ImageMagick and iconutil." + exit 1 +fi + + +# Prepare an iconset folder +mkdir "./${OUT_ICON_NAME}.iconset" + + +# Add rounded corners to the 1024px image. +# +# This works by: +# 1. Generating a black square (1024 px) with rounded corners (radius 234 px) +# on transparent background, via `-size [...] xc:none -draw [...]` +# 2. Applying the square as a mask to the the source image, via `-matte [...]` +convert "${SOURCE_FILE_PATH}" \ + -matte \( \ + -size 1024x1024 xc:none -draw "roundrectangle 0,0,1024,1024,234,234" \ + \) \ + -compose DstIn -composite \ + "./${OUT_ICON_NAME}.iconset/temp_1024_rounded.png" + + +# Apply sizing and add shadow to the 1024px image. +# +# This works by: +# 1. Resizing to 'icon grid size' (824px), via `-resize` +# 2. Adding padding (100px) to get 'outer bounding box' size, +# via `-bordercolor none -border [...]` +# 3. Adding shadow, via `+clone -background black -shadow [...]` +convert "./${OUT_ICON_NAME}.iconset/temp_1024_rounded.png" \ + -resize 824x824 \ + -bordercolor none -border 100x100 \ + \( +clone -background black -shadow 30x10+0+10 -background none \) \ + -compose DstOver -flatten \ + "./${OUT_ICON_NAME}.iconset/icon_512x512@2x.png" + +# Remove temporary file +rm "./${OUT_ICON_NAME}.iconset/temp_1024_rounded.png" + +# Generate all sizes. +# 16/32/128/256/512, each single & double resolution +cd "./${OUT_ICON_NAME}.iconset/" +convert './icon_512x512@2x.png' \ + \( +clone -resize x16 -write './icon_16x16.png' +delete \) \ + \( +clone -resize x32 -write './icon_16x16@2x.png' +delete \) \ + \( +clone -resize x32 -write './icon_32x32.png' +delete \) \ + \( +clone -resize x64 -write './icon_32x32@2x.png' +delete \) \ + \( +clone -resize x128 -write './icon_128x128.png' +delete \) \ + \( +clone -resize x256 -write './icon_128x128@2x.png' +delete \) \ + \( +clone -resize x256 -write './icon_256x256.png' +delete \) \ + \( +clone -resize x512 -write './icon_256x256@2x.png' +delete \) \ + -resize x512 './icon_512x512.png' +cd '..' + +# Convert to .icns format and remove iconset +iconutil -c icns "./${OUT_ICON_NAME}.iconset" +rm -r "./${OUT_ICON_NAME}.iconset" diff --git a/build/icon.icns b/build/icon.icns Binary files differindex bc27d1e..c7b644d 100644 --- a/build/icon.icns +++ b/build/icon.icns |