All Projects → github → Gemoji

github / Gemoji

Licence: mit
Emoji images and names.

Programming Languages

ruby
36898 projects - #4 most used programming language
HTML
75241 projects
shell
77523 projects

Projects that are alternatives of or similar to Gemoji

Twitter Text
Twitter Text Libraries. This code is used at Twitter to tokenize and parse text to meet the expectations for what can be used on the platform.
Stars: ✭ 2,627 (-32.47%)
Mutual labels:  unicode, emoji
unicode-emoji-json
Emoji data from unicode.org as easily consumable JSON files.
Stars: ✭ 149 (-96.17%)
Mutual labels:  emoji, unicode
V Emoji Picker
🌟 A Lightweight and customizable package of Emoji Picker in Vue using emojis natives (unicode).
Stars: ✭ 231 (-94.06%)
Mutual labels:  unicode, emoji
Smile
😄 Emoji in Swift
Stars: ✭ 359 (-90.77%)
Mutual labels:  unicode, emoji
umoji
😄 A lib convert emoji unicode to Surrogate pairs
Stars: ✭ 68 (-98.25%)
Mutual labels:  emoji, unicode
Emoji Regex
A regular expression to match all Emoji-only symbols as per the Unicode Standard.
Stars: ✭ 1,134 (-70.85%)
Mutual labels:  unicode, emoji
unicodemoticon
Trayicon with Unicode Emoticons using Python3 Qt5
Stars: ✭ 21 (-99.46%)
Mutual labels:  emoji, unicode
Awesome Typography
✏︎ Curated list about digital typography 🔥
Stars: ✭ 947 (-75.66%)
Mutual labels:  unicode, emoji
rm-emoji-picker
A modern, ES2015 emoji picker and editor.
Stars: ✭ 76 (-98.05%)
Mutual labels:  emoji, unicode
contour
Modern C++ Terminal Emulator
Stars: ✭ 761 (-80.44%)
Mutual labels:  emoji, unicode
Awesome Emoji Picker
Add-on/WebExtension that provides a modern emoji picker that you can use to find and copy/insert emoji into the active web page.
Stars: ✭ 54 (-98.61%)
Mutual labels:  unicode, emoji
no-facebook-emoji
Get rid of those ugly emojis now! [stopped working 😢]
Stars: ✭ 15 (-99.61%)
Mutual labels:  emoji, unicode
Weird Json
A collection of strange encoded JSONs. For connoisseurs.
Stars: ✭ 53 (-98.64%)
Mutual labels:  unicode, emoji
Box Cli Maker
Make Highly Customized Boxes for your CLI
Stars: ✭ 115 (-97.04%)
Mutual labels:  unicode, emoji
Unicode Tr51
Emoji data extracted from Unicode Technical Report #51.
Stars: ✭ 38 (-99.02%)
Mutual labels:  unicode, emoji
emoji-db
A database of Apple-supported emojis in JSON format. Used by my Alfred emoji workflow.
Stars: ✭ 32 (-99.18%)
Mutual labels:  emoji, unicode
Uni
Query the Unicode database from the commandline, with good support for emojis
Stars: ✭ 633 (-83.73%)
Mutual labels:  unicode, emoji
Ecoji
Encodes (and decodes) data as emojis
Stars: ✭ 671 (-82.75%)
Mutual labels:  unicode, emoji
Wordle2Townscaper
Wordle2Townscaper is meant to convert Wordle tweets into Townscaper houses using yellow and green building blocks.
Stars: ✭ 64 (-98.35%)
Mutual labels:  emoji, unicode
ngx-emoj
A simple, theme-able emoji mart/picker for angular 4+
Stars: ✭ 18 (-99.54%)
Mutual labels:  emoji, unicode

gemoji

This library contains character information about native emojis.

Installation

Add gemoji to your Gemfile.

gem 'gemoji'

Example Rails Helper

This would allow emojifying content such as: it's raining :cat:s and :dog:s!

See the Emoji cheat sheet for more examples.

module EmojiHelper
  def emojify(content)
    h(content).to_str.gsub(/:([\w+-]+):/) do |match|
      if emoji = Emoji.find_by_alias($1)
        %(<img alt="#$1" src="#{image_path("emoji/#{emoji.image_filename}")}" style="vertical-align:middle" width="20" height="20" />)
      else
        match
      end
    end.html_safe if content.present?
  end
end

Unicode mapping

Translate emoji names to unicode and vice versa.

>> Emoji.find_by_alias("cat").raw
=> "🐱"  # Don't see a cat? That's U+1F431.

>> Emoji.find_by_unicode("\u{1f431}").name
=> "cat"

Adding new emoji

You can add new emoji characters to the Emoji.all list:

emoji = Emoji.create("music") do |char|
  char.add_alias "song"
  char.add_unicode_alias "\u{266b}"
  char.add_tag "notes"
end

emoji.name #=> "music"
emoji.raw  #=> "♫"
emoji.image_filename #=> "unicode/266b.png"

# Creating custom emoji (no Unicode aliases):
emoji = Emoji.create("music") do |char|
  char.add_tag "notes"
end

emoji.custom? #=> true
emoji.image_filename #=> "music.png"

As you create new emoji, you must ensure that you also create and put the images they reference by their image_filename to your assets directory.

You can customize image_filename with:

emoji = Emoji.create("music") do |char|
  char.image_filename = "subdirectory/my_emoji.gif"
end

For existing emojis, you can edit the list of aliases or add new tags in an edit block:

emoji = Emoji.find_by_alias "musical_note"

Emoji.edit_emoji(emoji) do |char|
  char.add_alias "music"
  char.add_unicode_alias "\u{266b}"
  char.add_tag "notes"
end

Emoji.find_by_alias "music"       #=> emoji
Emoji.find_by_unicode "\u{266b}"  #=> emoji
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].