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
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,5 @@
^CODE_OF_CONDUCT\.md$
^LICENSE\.md$
^README\.Rmd$

^tools$
7 changes: 6 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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

Expand Down
5 changes: 4 additions & 1 deletion inst/WORDLIST
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
AAAS
Atlassian
BMJ
Bioinformatics
CMD
Expand All @@ -22,6 +23,7 @@ Morty
NEJM
NPG
ORCID
Pettiross
Pruim
RStudio
SSL
Expand All @@ -41,4 +43,5 @@ js
pandoc
pngquant
ragg
viridis
roxygen
staticimports
15 changes: 0 additions & 15 deletions inst/logo/logo.R

This file was deleted.

Binary file modified man/figures/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pkgdown/favicon/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pkgdown/favicon/favicon-96x96.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pkgdown/favicon/favicon.ico
Binary file not shown.
2 changes: 1 addition & 1 deletion pkgdown/favicon/favicon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pkgdown/favicon/web-app-manifest-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified pkgdown/favicon/web-app-manifest-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions tools/README.md
Original file line number Diff line number Diff line change
@@ -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`.
9 changes: 9 additions & 0 deletions tools/logo-text.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
55 changes: 55 additions & 0 deletions tools/logo.sh
Original file line number Diff line number Diff line change
@@ -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
Loading