-
Notifications
You must be signed in to change notification settings - Fork 1
feat: Forge brand icon as the default scaffolded app icon #30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,92 @@ | ||
| Copyright (c) 2016 The Inter Project Authors (https://github.com/rsms/inter) | ||
|
|
||
| This Font Software is licensed under the SIL Open Font License, Version 1.1. | ||
| This license is copied below, and is also available with a FAQ at: | ||
| http://scripts.sil.org/OFL | ||
|
|
||
| ----------------------------------------------------------- | ||
| SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 | ||
| ----------------------------------------------------------- | ||
|
|
||
| PREAMBLE | ||
| The goals of the Open Font License (OFL) are to stimulate worldwide | ||
| development of collaborative font projects, to support the font creation | ||
| efforts of academic and linguistic communities, and to provide a free and | ||
| open framework in which fonts may be shared and improved in partnership | ||
| with others. | ||
|
|
||
| The OFL allows the licensed fonts to be used, studied, modified and | ||
| redistributed freely as long as they are not sold by themselves. The | ||
| fonts, including any derivative works, can be bundled, embedded, | ||
| redistributed and/or sold with any software provided that any reserved | ||
| names are not used by derivative works. The fonts and derivatives, | ||
| however, cannot be released under any other type of license. The | ||
| requirement for fonts to remain under this license does not apply | ||
| to any document created using the fonts or their derivatives. | ||
|
|
||
| DEFINITIONS | ||
| "Font Software" refers to the set of files released by the Copyright | ||
| Holder(s) under this license and clearly marked as such. This may | ||
| include source files, build scripts and documentation. | ||
|
|
||
| "Reserved Font Name" refers to any names specified as such after the | ||
| copyright statement(s). | ||
|
|
||
| "Original Version" refers to the collection of Font Software components as | ||
| distributed by the Copyright Holder(s). | ||
|
|
||
| "Modified Version" refers to any derivative made by adding to, deleting, | ||
| or substituting -- in part or in whole -- any of the components of the | ||
| Original Version, by changing formats or by porting the Font Software to a | ||
| new environment. | ||
|
|
||
| "Author" refers to any designer, engineer, programmer, technical | ||
| writer or other person who contributed to the Font Software. | ||
|
|
||
| PERMISSION AND CONDITIONS | ||
| Permission is hereby granted, free of charge, to any person obtaining | ||
| a copy of the Font Software, to use, study, copy, merge, embed, modify, | ||
| redistribute, and sell modified and unmodified copies of the Font | ||
| Software, subject to the following conditions: | ||
|
|
||
| 1) Neither the Font Software nor any of its individual components, | ||
| in Original or Modified Versions, may be sold by itself. | ||
|
|
||
| 2) Original or Modified Versions of the Font Software may be bundled, | ||
| redistributed and/or sold with any software, provided that each copy | ||
| contains the above copyright notice and this license. These can be | ||
| included either as stand-alone text files, human-readable headers or | ||
| in the appropriate machine-readable metadata fields within text or | ||
| binary files as long as those fields can be easily viewed by the user. | ||
|
|
||
| 3) No Modified Version of the Font Software may use the Reserved Font | ||
| Name(s) unless explicit written permission is granted by the corresponding | ||
| Copyright Holder. This restriction only applies to the primary font name as | ||
| presented to the users. | ||
|
|
||
| 4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font | ||
| Software shall not be used to promote, endorse or advertise any | ||
| Modified Version, except to acknowledge the contribution(s) of the | ||
| Copyright Holder(s) and the Author(s) or with their explicit written | ||
| permission. | ||
|
|
||
| 5) The Font Software, modified or unmodified, in part or in whole, | ||
| must be distributed entirely under this license, and must not be | ||
| distributed under any other license. The requirement for fonts to | ||
| remain under this license does not apply to any document created | ||
| using the Font Software. | ||
|
|
||
| TERMINATION | ||
| This license becomes null and void if any of the above conditions are | ||
| not met. | ||
|
|
||
| DISCLAIMER | ||
| THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, | ||
| EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF | ||
| MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT | ||
| OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE | ||
| COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
| INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL | ||
| DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
| FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM | ||
| OTHER DEALINGS IN THE FONT SOFTWARE. |
Binary file not shown.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,158 @@ | ||
| #!/usr/bin/env bash | ||
| # | ||
| # generate-brand-icon.sh — Build the Forge brand icon master + favicon set. | ||
| # | ||
| # Source of truth is assets/forge.png (the black crossed-hammers + anvil emblem | ||
| # on a transparent background). That art is non-square (392x310), too small for | ||
| # bundling, and invisible on dark docks. This script composites it onto an | ||
| # ember-gradient rounded-rect "app icon template" plate to produce a single | ||
| # 1024x1024 square master, then derives the web favicon variants from it. | ||
| # | ||
| # The 1024 master is the only input the rest of Forge's pipeline needs: forge's | ||
| # IconProcessor (crates/forge_cli/src/bundler/icons.rs) fans it out to .icns, | ||
| # MSIX tiles, and Linux hicolor sizes by resizing. | ||
| # | ||
| # Requires: ImageMagick (`magick`), and on macOS `iconutil` for the .icns. | ||
| set -euo pipefail | ||
|
|
||
| ROOT="$(cd "$(dirname "$0")/.." && pwd)" | ||
| SRC="$ROOT/assets/forge.png" | ||
| OUT="$ROOT/assets" | ||
|
|
||
| SIZE=1024 # master canvas (square) | ||
| MARGIN=44 # transparent inset around the plate (macOS-template style) | ||
| EMBLEM_W=430 # emblem width painted on the canvas (raised to make room for the wordmark) | ||
| EMBLEM_Y=232 # emblem top offset from the plate top (gravity north) | ||
|
|
||
| # "Forge" wordmark. InterDisplay is the optical-size cut meant for large/display | ||
| # use (logos, headlines); the plain Inter cut is for body text and reads loose here. | ||
| FONT="$ROOT/assets/fonts/InterDisplay-SemiBold.otf" | ||
| WORDMARK="Forge" | ||
| WORD_PT=176 # wordmark point size | ||
| WORD_Y=596 # wordmark top offset from the plate top (gravity north) | ||
| WORD_FILL="#000000" # black wordmark fill | ||
| WORD_STROKE="#ffffff" # white keyline around the wordmark | ||
| WORD_STROKE_W=2 # stroke thickness in px | ||
|
|
||
| PLATE_SIZE=$((SIZE - 2 * MARGIN)) | ||
| PLATE_X1=$((SIZE - MARGIN)) | ||
| PLATE_Y1=$((SIZE - MARGIN)) | ||
| # Apple's continuous-corner ratio (~0.2237 of the side length). | ||
| RADIUS=$(awk "BEGIN{printf \"%d\", 0.2237 * $PLATE_SIZE}") | ||
|
|
||
| [ -f "$SRC" ] || { echo "error: source emblem not found: $SRC" >&2; exit 1; } | ||
| command -v magick >/dev/null || { echo "error: ImageMagick 'magick' not found" >&2; exit 1; } | ||
|
|
||
| TMP="$(mktemp -d)" | ||
| trap 'rm -rf "$TMP"' EXIT | ||
|
|
||
| echo "==> Building ember plate (${SIZE}x${SIZE}, inset ${MARGIN}px, radius ${RADIUS}px)" | ||
|
|
||
| # 1. Ember linear gradient: bright forge-orange at top -> deep red at the base. | ||
| magick -size ${SIZE}x${SIZE} gradient:'#ffb15a-#5e0d05' "$TMP/base.png" | ||
|
|
||
| # 2. Soft warm radial highlight, composited over the gradient. This lifts the | ||
| # black emblem off the dark lower half of the gradient so the anvil reads. | ||
| magick -size ${SIZE}x${SIZE} radial-gradient:'#fff0d8a0-#fff0d800' "$TMP/glow.png" | ||
| magick "$TMP/base.png" "$TMP/glow.png" -compose over -composite "$TMP/bg.png" | ||
|
|
||
| # 3. Rounded-rect "app icon" mask, applied to the gradient via CopyOpacity so | ||
| # the corners (and inset margin) become transparent. | ||
| magick -size ${SIZE}x${SIZE} xc:none -fill white \ | ||
| -draw "roundrectangle ${MARGIN},${MARGIN},${PLATE_X1},${PLATE_Y1} ${RADIUS},${RADIUS}" \ | ||
| "$TMP/mask.png" | ||
| magick "$TMP/bg.png" "$TMP/mask.png" \ | ||
| -alpha off -compose CopyOpacity -composite "$TMP/plate.png" | ||
|
|
||
| [ -f "$FONT" ] || { echo "error: Inter font not found: $FONT" >&2; exit 1; } | ||
|
|
||
| # 4. A white silhouette of the emblem, blurred into a soft halo. Sits behind the | ||
| # black emblem to guarantee contrast on the darkest part of the plate. | ||
| magick "$SRC" -resize ${EMBLEM_W}x \ | ||
| -channel RGB -evaluate set 100% +channel \ | ||
| "$TMP/white.png" | ||
|
|
||
| # 5. Compose the lockup: plate <- halo <- raised emblem <- "Forge" wordmark. | ||
| # The emblem sits in the upper portion; the wordmark sits below it. | ||
| magick "$TMP/plate.png" \ | ||
| \( "$TMP/white.png" -blur 0x10 -channel A -evaluate multiply 0.5 +channel \) \ | ||
| -gravity north -geometry +0+${EMBLEM_Y} -composite \ | ||
| \( "$SRC" -resize ${EMBLEM_W}x \) \ | ||
| -gravity north -geometry +0+${EMBLEM_Y} -composite \ | ||
| -font "$FONT" -pointsize ${WORD_PT} -gravity north \ | ||
| -fill "${WORD_STROKE}" -stroke "${WORD_STROKE}" -strokewidth $((WORD_STROKE_W * 2)) \ | ||
| -annotate +0+${WORD_Y} "${WORDMARK}" \ | ||
| -fill "${WORD_FILL}" -stroke none \ | ||
| -annotate +0+${WORD_Y} "${WORDMARK}" \ | ||
| "$OUT/forge-icon-1024.png" | ||
|
|
||
| echo "==> Wrote $OUT/forge-icon-1024.png (emblem + \"${WORDMARK}\" wordmark, Inter Display SemiBold)" | ||
|
|
||
| # --------------------------------------------------------------------------- | ||
| # Brand MARK: the emblem on the same ember plate, WITHOUT the wordmark, with the | ||
| # emblem centered and a touch larger. Used for the docs navbar logo, where the | ||
| # adjacent "Forge" title text already supplies the word. Reuses the same plate | ||
| # so the mark and the full icon share background, corners, and glow exactly. | ||
| # --------------------------------------------------------------------------- | ||
| MARK_EMBLEM_W=600 | ||
| magick "$SRC" -resize ${MARK_EMBLEM_W}x -channel RGB -evaluate set 100% +channel "$TMP/markwhite.png" | ||
| magick "$TMP/plate.png" \ | ||
| \( "$TMP/markwhite.png" -blur 0x10 -channel A -evaluate multiply 0.5 +channel \) \ | ||
| -gravity center -composite \ | ||
| \( "$SRC" -resize ${MARK_EMBLEM_W}x \) \ | ||
| -gravity center -composite \ | ||
| "$OUT/forge-mark-1024.png" | ||
|
|
||
| # logo.svg: vector wrapper around a 128px raster of the mark (matches the favicon | ||
| # approach). The navbar renders it at ~32px (64px hi-dpi), so 128px stays crisp | ||
| # while keeping the file lightweight. | ||
| MARK_B64="$(magick "$OUT/forge-mark-1024.png" -resize 128x128 png:- | base64 | tr -d '\n')" | ||
| cat > "$OUT/logo.svg" <<SVG | ||
| <svg xmlns="http://www.w3.org/2000/svg" width="128" height="128" viewBox="0 0 128 128"> | ||
| <image width="128" height="128" href="data:image/png;base64,${MARK_B64}"/> | ||
| </svg> | ||
| SVG | ||
| echo "==> Wrote $OUT/forge-mark-1024.png + $OUT/logo.svg (emblem-only mark)" | ||
|
|
||
| # --------------------------------------------------------------------------- | ||
| # Favicon set, derived from the same master so the brand matches pixel-for-pixel. | ||
| # --------------------------------------------------------------------------- | ||
| MASTER="$OUT/forge-icon-1024.png" | ||
|
|
||
| echo "==> Building favicon set" | ||
| magick "$MASTER" -resize 16x16 "$OUT/favicon-16.png" | ||
| magick "$MASTER" -resize 32x32 "$OUT/favicon-32.png" | ||
| magick "$MASTER" -resize 48x48 "$OUT/favicon-48.png" | ||
| magick "$MASTER" -resize 180x180 "$OUT/apple-touch-icon.png" | ||
| # Multi-resolution .ico for legacy browsers. | ||
| magick "$OUT/favicon-16.png" "$OUT/favicon-32.png" "$OUT/favicon-48.png" "$OUT/favicon.ico" | ||
|
|
||
| # favicon.svg: a vector wrapper around a small (64px) raster of the master. Tab | ||
| # favicons render at ~16-32px, so 64px keeps the file lightweight while matching | ||
| # the brand exactly. The emblem art is raster (assets/forge.png embeds no clean | ||
| # vector), so a baked raster is the faithful choice over re-vectorizing. Larger | ||
| # raster needs (bookmarks, home-screen) are served by favicon.ico / apple-touch. | ||
| B64="$(magick "$MASTER" -resize 64x64 png:- | base64 | tr -d '\n')" | ||
| cat > "$OUT/favicon.svg" <<SVG | ||
| <svg xmlns="http://www.w3.org/2000/svg" width="64" height="64" viewBox="0 0 64 64"> | ||
| <image width="64" height="64" href="data:image/png;base64,${B64}"/> | ||
| </svg> | ||
| SVG | ||
| echo " favicon.svg ($(wc -c < "$OUT/favicon.svg" | tr -d ' ') bytes), favicon.ico, favicon-{16,32,48}.png, apple-touch-icon.png" | ||
|
|
||
| # --------------------------------------------------------------------------- | ||
| # macOS .icns (optional; needs iconutil). Brand-level artifact in assets/. | ||
| # --------------------------------------------------------------------------- | ||
| if command -v iconutil >/dev/null; then | ||
| echo "==> Building forge.icns (macOS)" | ||
| ICONSET="$TMP/forge.iconset" | ||
| mkdir -p "$ICONSET" | ||
| for s in 16 32 128 256 512; do | ||
| magick "$MASTER" -resize ${s}x${s} "$ICONSET/icon_${s}x${s}.png" | ||
| magick "$MASTER" -resize $((s*2))x$((s*2)) "$ICONSET/icon_${s}x${s}@2x.png" | ||
| done | ||
| iconutil -c icns -o "$OUT/forge.icns" "$ICONSET" | ||
| echo " $OUT/forge.icns" | ||
| fi | ||
|
|
||
| echo "==> Done. Master: $MASTER" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.