Skip to content

manhdaovan/slack_emoji_generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

slack_emoji_generator

Generate slack emoji by command

slack emoji generator demo

Why this tool?

Sometime one emoji is better than lines of chatting.

one emoji is better than lines of chatting

Install

With Docker

  # clone this repo
  git clone git@github.com:manhdaovan/slack_emoji_generator.git /path/to/slack_emoji_generator
  cd /path/to/slack_emoji_generator

  # build the image
  docker build -t slack_emoji:latest .

Without Docker

  • Install ImageMagick
  • Check supporting font by:
    • $convert -list font or
    • $magick convert -list font
    • The result of command is something like:
    Path: /usr/local/Cellar/imagemagick/7.0.8-7/etc/ImageMagick-7/type-apple.xml
    Font: AndaleMono
      family: Andale Mono
      style: Undefined
      stretch: Undefined
      weight: 0
      glyphs: /Library/Fonts//Andale Mono.ttf
    Font: AppleChancery
      family: Apple Chancery
      style: Undefined
      stretch: Undefined
      weight: 0
      glyphs: /Library/Fonts//Apple Chancery.ttf
    
      ...
    

Usage

With Docker

docker run --env GENERATE_ON_DOCKER=true -it -v ./outputs:/app/outputs slack_emoji ruby slack_emoji.rb -z IPAGothic -t black -b white "私も私も"

Then open the emoji file(s) under ./outputs

Without Docker

# Clone source code for first time
$git clone https://github.com/manhdaovan/slack_emoji_generator.git
$cd /path/to/slack_emoji_generator
$ruby slack_emoji.rb [-bfostzh] "text"

Options:
  -b: Emoji background color. Default: transparent
  -f: Emoji font size. Default: 15
  -o: Emoji output file. Default: input_text.png
  -s: Emoji size (horizontal x vertical) in px. Default: 60x60
  -t: Emoji text color. Default: pink
  -z: Emoji text font. Default: ArialUnicode
  -h: Print help message

Example:
$ruby slack_emoji.rb -b white -f 20 -s 100x100 -t black "this is text in emoji" -o slack_emoji_output.png

See $ruby slack_emoji.rb -h for more details

Troubleshooting

1. My generated image is all of question mark (?) characters

  • Use above command to check supporting fonts on your machine, then use -z option.
    • Example: $ruby slack_emoji.rb -z AndaleMono "hura"

About

Generate slack emoji by command

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published