diff --git a/.Rbuildignore b/.Rbuildignore
index 292a130..27b73f0 100644
--- a/.Rbuildignore
+++ b/.Rbuildignore
@@ -10,3 +10,5 @@
^CODE_OF_CONDUCT\.md$
^LICENSE\.md$
^README\.Rmd$
+
+^tools$
diff --git a/NEWS.md b/NEWS.md
index 3473e45..256ff96 100644
--- a/NEWS.md
+++ b/NEWS.md
@@ -15,6 +15,11 @@
Also improves graphical appearance of the examples by using a minimalist
theme with alternative data subsets (#61).
+## Maintenance
+
+- Refactor the logo generation script from an R script to a shell script
+ and move it into `tools/` (#66).
+
# ggsci 3.2.0
## New features
@@ -71,7 +76,7 @@
[customizing color selection and ordering in a palette](https://nanx.me/ggsci/articles/ggsci-faq.html#customize-color-ordering-in-a-palette)
with self-defined color scale functions (#23).
- Fix "lost braces" check notes on r-devel by using Unicode characters
- ([a91faf1](https://github.com/nanxstats/ggsci/commit/a91faf183ae44fe43355283c173a1e2de70de6d2)).
+ (nanxstats/ggsci@a91faf1).
# ggsci 3.0.0
diff --git a/inst/WORDLIST b/inst/WORDLIST
index ad94f45..2edbf0a 100644
--- a/inst/WORDLIST
+++ b/inst/WORDLIST
@@ -1,4 +1,5 @@
AAAS
+Atlassian
BMJ
Bioinformatics
CMD
@@ -22,6 +23,7 @@ Morty
NEJM
NPG
ORCID
+Pettiross
Pruim
RStudio
SSL
@@ -41,4 +43,5 @@ js
pandoc
pngquant
ragg
-viridis
+roxygen
+staticimports
diff --git a/inst/logo/logo.R b/inst/logo/logo.R
deleted file mode 100644
index 5cd06dc..0000000
--- a/inst/logo/logo.R
+++ /dev/null
@@ -1,15 +0,0 @@
-library("magick")
-library("showtext")
-
-font_add_google("Zilla Slab", "pf", regular.wt = 500)
-
-hexSticker::sticker(
- subplot = ~ plot.new(), s_x = 1, s_y = 1, s_width = 0.1, s_height = 0.1,
- package = "ggsci", p_x = 1, p_y = 1, p_size = 12, h_size = 1.2, p_family = "pf",
- p_color = "#F06060", h_fill = "#FFF9F2", h_color = "#F06060",
- dpi = 320, filename = "man/figures/logo.png"
-)
-
-image_read("man/figures/logo.png")
-
-rstudioapi::restartSession()
diff --git a/man/figures/logo.png b/man/figures/logo.png
index 3fdc1ec..36bf9d1 100644
Binary files a/man/figures/logo.png and b/man/figures/logo.png differ
diff --git a/pkgdown/favicon/apple-touch-icon.png b/pkgdown/favicon/apple-touch-icon.png
index 9fd3f71..eb2a514 100644
Binary files a/pkgdown/favicon/apple-touch-icon.png and b/pkgdown/favicon/apple-touch-icon.png differ
diff --git a/pkgdown/favicon/favicon-96x96.png b/pkgdown/favicon/favicon-96x96.png
index 4017d86..02f843d 100644
Binary files a/pkgdown/favicon/favicon-96x96.png and b/pkgdown/favicon/favicon-96x96.png differ
diff --git a/pkgdown/favicon/favicon.ico b/pkgdown/favicon/favicon.ico
index d5e4fbe..dd69b96 100644
Binary files a/pkgdown/favicon/favicon.ico and b/pkgdown/favicon/favicon.ico differ
diff --git a/pkgdown/favicon/favicon.svg b/pkgdown/favicon/favicon.svg
index aedeeea..238e951 100644
--- a/pkgdown/favicon/favicon.svg
+++ b/pkgdown/favicon/favicon.svg
@@ -1,3 +1,3 @@
-
\ No newline at end of file
diff --git a/pkgdown/favicon/web-app-manifest-192x192.png b/pkgdown/favicon/web-app-manifest-192x192.png
index b427592..aa7dc12 100644
Binary files a/pkgdown/favicon/web-app-manifest-192x192.png and b/pkgdown/favicon/web-app-manifest-192x192.png differ
diff --git a/pkgdown/favicon/web-app-manifest-512x512.png b/pkgdown/favicon/web-app-manifest-512x512.png
index ca74b16..bf3725e 100644
Binary files a/pkgdown/favicon/web-app-manifest-512x512.png and b/pkgdown/favicon/web-app-manifest-512x512.png differ
diff --git a/tools/README.md b/tools/README.md
new file mode 100644
index 0000000..7d39f7c
--- /dev/null
+++ b/tools/README.md
@@ -0,0 +1,6 @@
+# Developer maintenance scripts
+
+This directory contains the [inline R scripts for developer maintenance
+tasks](https://r-pkgs.org/misc.html#sec-misc-tools).
+
+This directory is listed in `.Rbuildignore`.
diff --git a/tools/logo-text.svg b/tools/logo-text.svg
new file mode 100644
index 0000000..c6212e7
--- /dev/null
+++ b/tools/logo-text.svg
@@ -0,0 +1,9 @@
+
\ No newline at end of file
diff --git a/tools/logo.sh b/tools/logo.sh
new file mode 100644
index 0000000..9d1358a
--- /dev/null
+++ b/tools/logo.sh
@@ -0,0 +1,55 @@
+#!/bin/bash
+
+# Generate logo background
+magick -size 553x640 xc:none \
+ -fill "#FFF9F2" \
+ -stroke "#F06060" -strokewidth 11 \
+ -draw "polygon 276.5,7 547,163 547,477 276.5,633 6,477 6,163" \
+ man/figures/logo.png
+
+# Generate text image and compose with background due to
+# limited ligatures support in hexSticker and ImageMagick.
+if [[ "$OSTYPE" == "darwin"* ]]; then
+ CHROME_BIN="/Applications/Google Chrome.app/Contents/MacOS/Google Chrome"
+elif [[ "$OSTYPE" == "msys" || "$OSTYPE" == "cygwin" ]]; then
+ CHROME_BIN="/c/Program Files/Google/Chrome/Application/chrome.exe"
+else
+ CHROME_BIN="/usr/bin/google-chrome"
+fi
+
+if [ ! -f "$CHROME_BIN" ]; then
+ echo "Chrome/Chromium not found at $CHROME_BIN"
+ exit 1
+fi
+
+alias chrome="\"$CHROME_BIN\""
+
+chrome --headless \
+ --disable-gpu \
+ --no-margins \
+ --no-pdf-header-footer \
+ --print-to-pdf-no-header \
+ --print-to-pdf=tools/logo-text.pdf \
+ tools/logo-text.svg
+
+pdfcrop --quiet \
+ tools/logo-text.pdf tools/logo-text.pdf
+
+magick -density 2000 tools/logo-text.pdf \
+ -resize 25% \
+ -alpha set -background none -channel A \
+ -evaluate multiply 1.3 +channel \
+ -transparent white \
+ tools/logo-text.png
+
+magick man/figures/logo.png tools/logo-text.png \
+ -gravity center \
+ -geometry +0-0 \
+ -composite man/figures/logo.png
+
+rm tools/logo-text.pdf tools/logo-text.png
+
+# Optimize PNG
+pngquant man/figures/logo.png \
+ --force \
+ --output man/figures/logo.png