Skip to content
/ hext Public

⬡🔡 R package: make a text-based hex sticker

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md
Notifications You must be signed in to change notification settings

matt-dray/hext

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hext

Project Status: Concept – Minimal or no implementation has been done yet, or the repository is only intended to be a limited example, demo, or proof-of-concept. R-CMD-check format-check.yaml jarl-check

  ________
 /        \
/   he     \
\     xt   /
 \________/

About

Hex stickers… but text.

Bye, hex stickers. Inspired by artistry in Yihui’s {litedown} and then Charlie’s {secretbase}.

Install

The package is a GitHub exclusive for now.

install.packages("pak") # if not yet installed
pak::pak("matt-dray/hext")

Quality not guaranteed.

Use

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_/

The Text-Stickers Standard

You may be aware of the the Stickers Standard.

For the purposes of {hext}, the standard is:

  1. 2 spaces, 8 underscores.
  2. 1 space, 1 slash, 8 spaces, 1 backslash.
  3. 1 slash, 10 spaces, 1 backslash.
  4. 1 backslash, 10 spaces, 1 slash.
  5. 1 space, 1 backslash, 8 underscores, 1 slash.

A world beyond text?

If you’re interested in jpegs or whatever, see:

About

⬡🔡 R package: make a text-based hex sticker

Topics

Resources

License

Unknown, MIT licenses found

Licenses found

Unknown
LICENSE
MIT
LICENSE.md

Stars

Watchers

Forks

Languages