Skip to content

Commit 60b19a4

Browse files
initial sticker draft
Closes #516
1 parent e987d7a commit 60b19a4

File tree

7 files changed

+59
-0
lines changed

7 files changed

+59
-0
lines changed

.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
^doc$
1818
^docs$
1919
^gitsum$
20+
^hextools
2021
^inst/WORDLIST$
2122
^inst/hooks/.*$
2223
^revdep$

README.Rmd

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,3 +68,8 @@ The following online docs are available:
6868
- [latest CRAN release](https://styler.r-lib.org).
6969

7070
- [GitHub development version](https://styler.r-lib.org/dev/).
71+
72+
## Acknowledgments
73+
74+
Hex sticker font is [Gayathri](https://fonts.google.com/specimen/Gayathri), and the image is taken from icon made by [Freepik](https://www.freepik.com) and available at
75+
[flaticon.com](https://www.flaticon.com/free-icon/suit_1355137).

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,10 @@ The following online docs are available:
5353
- [latest CRAN release](https://styler.r-lib.org).
5454

5555
- [GitHub development version](https://styler.r-lib.org/dev/).
56+
57+
## Acknowledgments
58+
59+
Hex sticker font is
60+
[Gayathri](https://fonts.google.com/specimen/Gayathri), and the image is
61+
taken from icon made by [Freepik](https://www.freepik.com) and available
62+
at [flaticon.com](https://www.flaticon.com/free-icon/suit_1355137).

hextools/hexsticker.R

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
library(hexSticker)
2+
library(magick)
3+
library(showtext)
4+
library(sysfonts)
5+
6+
# Loading Google fonts (http://www.google.com/fonts)
7+
google_font_name <- "Gayathri"
8+
font_add_google(google_font_name)
9+
10+
# Automatically use showtext to render text for future devices
11+
showtext_auto()
12+
13+
project_root <- here::here()
14+
15+
# https://www.flaticon.com/free-icon/suit_1355137
16+
image <- image_read(file.path(project_root, "hextools", "suit.png"))
17+
18+
sticker(
19+
# image
20+
subplot = image,
21+
s_x = 1.1,
22+
s_y = 1,
23+
s_width = 1,
24+
s_height = 1.2,
25+
# package name
26+
package = "styler",
27+
p_color = "#F6ECA9",
28+
p_family = google_font_name,
29+
p_size = 58,
30+
p_x = 0.35,
31+
p_y = 0.95,
32+
angle = 90,
33+
# image
34+
h_color = "white",
35+
h_fill = "#11235A",
36+
# package URL
37+
url = " https://styler.r-lib.org/",
38+
u_size = 10,
39+
u_color = "#F6ECA9",
40+
# saving sticker
41+
filename = file.path(project_root, "hextools", "logo.png"),
42+
dpi = 600,
43+
)
44+
45+
manual_logo_path <- file.path(project_root, "man", "figures", "logo.png")
46+
fs::file_move("logo.png", manual_logo_path)

hextools/logo.png

119 KB
Loading

hextools/suit.png

29.7 KB
Loading

man/figures/logo.png

119 KB
Loading

0 commit comments

Comments
 (0)