________ / \ / he \ \ xt / \________/ Hex stickersโฆ but text.
Bye, hex stickers. Inspired by artistry in Yihuiโs {litedown} and then Charlieโs {secretbase}.
The package is a GitHub exclusive for now.
install.packages("pak") # if not yet installed pak::pak("matt-dray/hext")Quality not guaranteed.
You can add text (text_*) and align it (align_*) for each of your hexโs four writable lines (*_1 to *_4). You cannot exceed the allotted character width inside the hex border.
Hereโs the simple logo for this package:
hext::hext( # You can adjust placement with spaces text_2 = "he ", text_3 = " xt" ) # ________ # / \ # / he \ # \ xt / # \________/Alignment defaults to centre, but you can change it:
# fmt: skip hext::hext( "hello", "this", "is", "hext", "left", "right", "centre", "left" ) # ________ # /hello \ # / this\ # \ is / # \hext____/Rendering is hard. Platforms and tools will vary in how they present the same logo.
In particular, your kilometreage may vary with Unicode characters, including emojis.
hext::hext( "๐", "โ๐๐ค", "๐", "๐๐" ) # ________ # / ๐ \ # / โ๐๐ค \ # \ ๐ / # \__๐๐__/hext() defaults to assessing the display width of text. In the spirit of fudging it, use count_type = "chars" to count characters instead.
ASCII art is encouraged. Here is a cat.
hext_cat <- hext::hext( r"{/\__/\}", # escape with raw strings "={ o x o}=", "l( u u )", "_b___b", print = FALSE # return char vector invisibly ) hext_cat |> cat() # ________ # / /\__/\ \ # /={ o x o}=\ # \l( u u ) / # \__b___b_/You may be aware of the the Stickers Standard.
For the purposes of {hext}, the standard is:
- 2 spaces, 8 underscores.
- 1 space, 1 slash, 8 spaces, 1 backslash.
- 1 slash, 10 spaces, 1 backslash.
- 1 backslash, 10 spaces, 1 slash.
- 1 space, 1 backslash, 8 underscores, 1 slash.
If youโre interested in jpegs or whatever, see:
- {hexSticker} by Guangchang Yu
- hexmake by Colin Fay
- {bunny} by Dmytro Perepolkin
- {gex} by Matt Dray (disclaimer: thatโs my name)