Skip to contents

Creates a logo automatically with hexSticker's hexSticker::sticker(). Optionally, create favicons with pkgdown's pkgdown::build_favicons().

Usage

rog_logo(
  pkgname,
  filename = "man/figures/logo.png",
  p_x = 1,
  p_y = 1,
  p_size = 202.6 * nchar(pkgname)^-1.008,
  overwrite = FALSE,
  favicons = TRUE
)

Arguments

pkgname

Name of the package. If not supplied, the name is detected from DESCRIPTION.

filename

filename to save sticker

p_x

x position for package name

p_y

y position for package name

p_size

font size for package name

overwrite

Should the current logo be overwritten? When TRUE it runs usethis's usethis::use_logo().

favicons

Should favicons be created with pkgdown's pkgdown::build_favicons()?

Value

The function is called for its side effects and returns NULL invisibly.

Examples

tmp <- tempfile(fileext = ".png")
rog_logo("test a package", tmp, overwrite = FALSE, favicons = FALSE)
#> B612 Mono font loaded.
#> Logo created at /tmp/Rtmp2X26pm/file1cb1b9e88c5.png.

# Display the logo.
logo <- magick::image_read(tmp)

logo
#> # A tibble: 1 × 7
#>   format width height colorspace matte filesize density
#>   <chr>  <int>  <int> <chr>      <lgl>    <int> <chr>  
#> 1 PNG      518    600 sRGB       TRUE     32133 118x118

plot(logo)