Generate slack emoji by command
Sometime one emoji is better than lines of chatting.
# 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 .
- 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 ...
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
# 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
- Use above command to check supporting fonts on your machine, then use
-z
option.- Example:
$ruby slack_emoji.rb -z AndaleMono "hura"
- Example: