Compare commits

...

69 Commits

Author SHA1 Message Date
Mislav Marohnić
58f2f068c1 gemoji 2.0.0 2014-07-04 17:41:23 +08:00
Mislav Marohnić
c5ee5ebb29 Assert that our PNG images are 64x64 px
`shipit.png` is 75 px for some reason, though.
2014-07-04 12:41:27 +08:00
Mislav Marohnić
2b26bb9b0d Fix MD5 checksumming in test that detect duplicates
`Digest::MD5.file` returns an Digest::MD5 instance, not a string
representing the checksum.
2014-07-04 12:09:49 +08:00
Mislav Marohnić
be4946fbbe Actually allow installing the gem on Ruby 2.x you know 2014-07-04 12:09:11 +08:00
Mislav Marohnić
3b65ee2f15 Merge pull request #49 from github/edit-emoji
Add API for adding new / editing existing emoji
2014-07-04 11:54:55 +08:00
Mislav Marohnić
0bea2df7ba Add ability to use Emoji.create without a block 2014-07-04 11:51:20 +08:00
Mislav Marohnić
e9480a983b Merge pull request #51 from phoet/patch-1
fix formatting
2014-07-04 11:43:31 +08:00
Mislav Marohnić
3935375ca8 Change emoji creation API to take name as 1st argument
It's more likely that someone will want to add a new emoji with a custom
image rather than a character that has a Unicode representation.

Also move the VARIATION_SELECTOR_16 logic outside of Emoji::Character
since it doesn't need to be concerned with it.
2014-07-03 18:13:55 +08:00
Peter Schröder
77ff183d85 fix formatting 2014-07-02 22:17:35 -04:00
Mislav Marohnić
06c5d0993b Fix some emoji images
/cc @charliesome because I only discovered these mismatches because of
his trains
2014-07-03 00:23:02 +08:00
Mislav Marohnić
f73921aacd Add test that images on disk don't have duplicates 2014-07-02 19:51:36 +08:00
Mislav Marohnić
e2ae300270 Merge pull request #50 from github/preview
HTML page to preview the emoji database
2014-06-28 09:13:41 +08:00
Mislav Marohnić
bbfae32663 HTML page to preview the emoji database 2014-06-28 07:50:16 +08:00
Mislav Marohnić
65031cfcd2 Add documentation note about images for added emoji
It comes down to: if you add new emoji, you must add images for them as
well. That's the whole point.
2014-06-28 07:19:58 +08:00
Mislav Marohnić
7477247802 Add API for adding new / editing existing emoji
- Emoji.create(raw) => yields to block
- Emoji.edit_emoji(emoji) => yields to block

The block forms are so that the list of aliases & unicode_aliases is
re-indexed after the update.
2014-06-28 07:19:58 +08:00
Mislav Marohnić
ef06de5305 Merge pull request #48 from github/fire-old-api
🔥 old gemoji API
2014-06-28 06:08:09 +08:00
Mislav Marohnić
097fbafcb7 🔥 old API 2014-06-27 19:09:59 +08:00
Mislav Marohnić
608ddd58fd Update gemspec to fix warnings
- Specifying `licenses` is recommended
- More helpful `summary` and `description`
2014-06-27 19:03:27 +08:00
Mislav Marohnić
72aecc9105 Actually give up on 1.8.7 compatbility
Gemoji implementation depends on `codepoints` and test depend on some
more Ruby 1.9-only features, so don't pretend that the library will be
1.8 compatible anytime soon. Probably never.

This reverts commit 6a781b6474.
2014-06-27 19:02:05 +08:00
Mislav Marohnić
6a781b6474 Add json gem for 1.8.7 test compatibility 2014-06-27 18:52:36 +08:00
Mislav Marohnić
cb55354db9 Set up minitest gem for 1.8.7 test compatibility 2014-06-27 18:43:58 +08:00
Mislav Marohnić
490b07b49e Disable spam 2014-06-27 18:43:09 +08:00
Mislav Marohnić
1a7a23fd46 Enable Travis CI 2014-06-27 18:36:36 +08:00
Mislav Marohnić
d7b020fd16 Merge pull request #47 from github/no-symlinks
Get emoji list & aliases from data file instead of symlinks
2014-06-27 18:33:17 +08:00
Mislav Marohnić
a9112090fa Tweak tags for some emoji
Ensure that tags accurately describe the original meaning of the emoji
(with respect to its definition from Unicode spec).
2014-06-27 18:25:56 +08:00
Mislav Marohnić
01394ed139 Have unicode_aliases include emoji's raw representation as well
This brings it up to par with `aliases`, which includes `name` as well.
2014-06-27 11:21:46 +08:00
Mislav Marohnić
2530b24121 Update usage examples in the README with the new API 2014-06-27 11:21:45 +08:00
Mislav Marohnić
5d2401222a Improve emoji lookup fallback behavior
Instead of an unfriendly LocalJumpError, raise the Emoji::NotFound
exception with a helpful message if the block was not given.

If a fallback block was given, yield the value for which the lookup failed.
2014-06-27 11:21:45 +08:00
Mislav Marohnić
70db910026 Add dump script to inspect Unicode descriptions & aliases
This script was used to construct the initial `emoji.json` file.

Example:

    rake db:dump | less -r
2014-06-27 11:21:45 +08:00
Mislav Marohnić
0845c3898a Add task to download Unicode 6.3 names list
This list contains textual descriptions for emoji characters.
2014-06-27 11:21:45 +08:00
Mislav Marohnić
07e15fde99 Remove duplicate image for shipit squirrel 2014-06-27 11:21:45 +08:00
Mislav Marohnić
2fad57ed49 Get emoji list & aliases from data file instead of symlinks
Previously, emoji name & unicode aliases were determined by following
symlinks among `images/emoji/*.png`. This led to nontrivial code for
resolving these aliases, made it tricky for contributors to add new
aliases and inspect existing ones, and didn't leave room for adding
metadata to emojis such as tags or descriptions from the Unicode spec.

Moreover, the aliases as symlinks led to duplication of image assets in
users' applications, with `hocho.png` and `knife.png` representing the
same emoji but being two separate images. Users were also unsure what to
do with `unicode/{HEX-NAME}.png` files, which would end up among their
images after running the `:emoji` task.

This change removes the symlinks support and creates the list of emojis
and their aliases in `emoji.json`. A single emoji is now represented with
an Emoji::Character instance, which has the `image_filename` method to
determine the path to the corresponding image instead of having to
construct it manually.
2014-06-27 11:21:45 +08:00
Mislav Marohnić
c8c9805bfc 🔥 image symlinks
Emoji aliases as symlinks didn't scale.
2014-06-03 02:25:14 +07:00
Mislav Marohnić
f1d0bfedaf Simplify db:generate task and have JSON be human-readable 2014-03-12 12:16:15 +01:00
Trevor Turk
204ace76da Merge pull request #40 from github/use-extant-emoji-in-readme-example
Use extant emoji in the example
2014-02-24 13:34:32 -06:00
Rob Rix
824a0ee189 Use extant emoji in the example 2014-02-24 13:50:01 -05:00
Javan Makhmali
4536894c48 Merge pull request #39 from TheRakken/patch-1
Fixed typo in README.md
2014-02-01 15:12:14 -08:00
TheRakken
28983a9ea9 Fixed typo in README.md 2014-02-02 02:06:43 +03:00
Javan Makhmali
11c08bdd2f Shell out to cp ourself.
The output from using FileUtil's `cp_r` with the previous options was `cp -rp --remove-destination`, which aren't even valid options.
2014-01-30 17:31:09 -05:00
Trevor Turk
c77cd152ba Use old hash syntax for Ruby 1.8 compatibility 2014-01-30 15:12:37 -06:00
Joshua Peek
73f48e4b57 Merge pull request #38 from github/knife-alias
Alias 🔪 to the same as 🔪
2014-01-30 09:48:00 -08:00
Coby Chapple
633bd4ff33 alias 🔪 to the same as 🔪 2014-01-30 17:10:31 +00:00
Javan Makhmali
8c96cb878f Document unicode mapping 2013-11-16 13:37:41 -05:00
Javan Makhmali
dc06bc9a6b Recursively copy the whole emoji dir, preserving symlinks 2013-11-16 13:10:04 -05:00
Javan Makhmali
7755a8a181 Gemoji 1.5.0 2013-11-10 21:45:17 -05:00
Javan Makhmali
69f625f36c Merge pull request #37 from github/unicode-mapping
Unicode mapping, codepoint fixes, and tests!
2013-11-10 18:43:45 -08:00
Javan Makhmali
13bcea9b4a Make mappings private pending better names 2013-11-10 11:09:48 -05:00
Javan Makhmali
19ddee2bdc Fix up incorrect/mising speaker emojis 2013-11-10 11:05:52 -05:00
Javan Makhmali
9cd56f6e3d Add missing train emoji 2013-11-10 10:49:01 -05:00
Javan Makhmali
56da9a86e3 Add support for the unicode variation selector (fe0f) added to 107 emojis in iOS 7 / OS X 10.9.
http://www.unicode.org/L2/L2011/11438-emoji-var.pdf
http://unicode.org/reports/tr28/tr28-3.html#13_7_variation_selectors
2013-11-10 10:04:11 -05:00
Javan Makhmali
c180447c5b Compare our emoji to emoji straight from the horse's mouth 2013-11-06 09:22:12 -05:00
Javan Makhmali
150c509735 Add missing 🌃 2013-11-05 22:26:25 -05:00
Javan Makhmali
8e098547ad Fix incorrect codepoint for 🌠 2013-11-05 20:50:02 -05:00
Javan Makhmali
968373beae Merge branch 'keycaps' of git://github.com/lautis/gemoji into unicode-mapping 2013-11-05 20:26:19 -05:00
Javan Makhmali
cb85b7b105 Tests to ensure the gem is in good shape. Leave the unicode tests intentionally failing. Fix to follow. 2013-11-05 20:07:56 -05:00
Javan Makhmali
bfbc8c5e98 Convert emoji names to unicode and vice versa. Add some *gasp* tests. h/t @mbillard 2013-11-05 20:00:37 -05:00
Ted Nyman
2d799338d9 Update LICENSE for the source code 2013-06-24 14:25:43 -06:00
Joshua Peek
8b45468c6e Merge pull request #28 from rick/master
A more proper take on this 🐬 -> 🐬 thing
2013-02-11 08:19:11 -08:00
Rick Bradley
d7f9549261 Ah -- do the 🐬 symlink thing 2013-02-11 10:15:56 -06:00
Rick Bradley
17946e381b Alias 🐬 -> 🐬
Is this how this works?
2013-02-10 23:45:28 -06:00
Ville Lautanala
f9f0527fbe Fix digit/keycap unicode code points
Emoji digits and # are normal ASCII digits followed by COMBINING ENCLOSING KEYCAP (0x20e3). http://www.unicode.org/~scherer/emoji4unicode/20091221/emojidata.html
2013-01-26 13:40:11 +02:00
Joshua Peek
a844c2c1f7 Gemoji 1.4.0 2013-01-14 22:07:39 -08:00
Joshua Peek
ece49a0f11 Merge pull request #24 from danthompson/non_rails_support
Add non rails support
2013-01-09 13:39:39 -08:00
Dan Thompson
27e6ef7bc0 Remove external dependencies 2013-01-09 16:25:21 -05:00
Jamie Dihiansan
b67f98a130 Merge branch 'master' of https://github.com/github/gemoji 2013-01-08 13:29:03 -06:00
Jamie Dihiansan
282ae85ea0 updated 🖕 to be more explicit 2013-01-08 13:28:49 -06:00
Dan Thompson
808cb099de Remove 'Rails' as rake task no longer requires it 2013-01-07 10:03:43 -05:00
Dan Thompson
8441803d17 Update target path to not rely on Rails constant 2013-01-07 09:57:37 -05:00
Dan Thompson
8781d47ddb add environment task
appends to or creates when not already present (no-op)
2013-01-07 09:41:40 -05:00
1005 changed files with 9111 additions and 903 deletions

2
.gitignore vendored Normal file
View File

@@ -0,0 +1,2 @@
.ruby-version
db/NamesList.txt

5
.travis.yml Normal file
View File

@@ -0,0 +1,5 @@
rvm:
- 1.9.3
- 2.1.2
notifications:
email: false

6
Gemfile Normal file
View File

@@ -0,0 +1,6 @@
source "https://rubygems.org"
gem "rake"
gem "minitest"
gemspec

18
Gemfile.lock Normal file
View File

@@ -0,0 +1,18 @@
PATH
remote: .
specs:
gemoji (1.5.0)
GEM
remote: https://rubygems.org/
specs:
minitest (5.3.5)
rake (10.3.2)
PLATFORMS
ruby
DEPENDENCIES
gemoji!
minitest
rake

25
LICENSE
View File

@@ -12,3 +12,28 @@ Copyright (c) 2013 whynne@deviantart. All rights reserved.
All other images
Copyright (c) 2013 Apple Inc. All rights reserved.
Source code:
Copyright (c) 2013 GitHub, Inc.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
files (the "Software"), to deal in the Software without
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the
Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

View File

@@ -7,7 +7,7 @@ Emoji images and names. See the LICENSE for copyright information.
Installation
------------
Add `gemoji` to you Gemfile.
Add `gemoji` to your Gemfile.
``` ruby
gem 'gemoji'
@@ -15,7 +15,7 @@ gem 'gemoji'
**Sync images**
Images can be copied to your public directory with `rake emoji` in your Rails app. This is the recommended approach since the images will be available at a consistent location. This works best with cached formatted user content generated by tools like [html-pipeline](https://github.com/jch/html-pipeline).
Images can be copied to your public directory with `rake emoji` in your app. This is the recommended approach since the images will be available at a consistent location. This works best with cached formatted user content generated by tools like [html-pipeline](https://github.com/jch/html-pipeline).
``` ruby
# Rakefile
@@ -39,7 +39,7 @@ Then have them compiled to public on deploy.
``` ruby
# config/application.rb
config.assets.precompile << "emoji/*.png"
config.assets.precompile << "emoji/**/*.png"
```
**WARNING** Since there are a ton of images, just adding the path may slow down other lookups if you aren't using it. Compiling all the emojis on deploy will add overhead to your deploy if even the images haven't changed. Theres just so many more superfluous files to iterate over. Also, the urls will be fingerprinted which may not be ideal for referencing from cached content.
@@ -48,16 +48,16 @@ config.assets.precompile << "emoji/*.png"
Example Rails Helper
--------------------
This would allow emojifying content such as: `it's raining :cats: and :dogs:!`
This would allow emojifying content such as: `it's raining :cat:s and :dog:s!`
See the [Emoji cheat sheet](http://www.emoji-cheat-sheet.com) for more examples.
```ruby
module EmojiHelper
def emojify(content)
h(content).to_str.gsub(/:([a-z0-9\+\-_]+):/) do |match|
if Emoji.names.include?($1)
'<img alt="' + $1 + '" height="20" src="' + asset_path("emoji/#{$1}.png") + '" style="vertical-align:middle" width="20" />'
def emojify(content)
h(content).to_str.gsub(/:([\w+-]+):/) do |match|
if emoji = Emoji.find_by_alias($1) { nil }
%(<img alt="#$1" src="#{asset_path("emoji/#{emoji.image_filename}")}" style="vertical-align:middle" width="20" height="20" />)
else
match
end
@@ -65,3 +65,59 @@ module EmojiHelper
end
end
```
Unicode mapping
---------------
Translate emoji names to unicode and vice versa.
```ruby
>> 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:
```ruby
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.
For existing emojis, you can edit the list of aliases or add new tags in an edit block:
```ruby
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
```

View File

@@ -1,7 +1,29 @@
desc "Checks for missing aliases to unicode sources"
task :unnamed do
unicodes = Dir["./images/emoji/unicode/*.png"].map { |fn| File.basename(fn) }
aliases = Dir["./images/emoji/*.png"].select { |fn| File.symlink?(fn) }.map { |fn| File.basename(fn) }
used_unicodes = aliases.map { |name| File.basename(File.readlink("./images/emoji/#{name}")) }.uniq
puts unicodes - used_unicodes
require 'rake/testtask'
task :default => :test
Rake::TestTask.new do |t|
t.libs << "test"
t.test_files = FileList["test/*_test.rb"]
end
namespace :db do
desc %(Generate Emoji data files needed for development)
task :generate => ['db/Category-Emoji.json', 'db/NamesList.txt']
desc %(Dump a list of supported Emoji with Unicode descriptions and aliases)
task :dump => :generate do
system 'ruby', '-Ilib', 'db/dump.rb'
end
end
emoji_plist = '/System/Library/Input Methods/CharacterPalette.app/Contents/Resources/Category-Emoji.plist'
nameslist_url = 'http://www.unicode.org/Public/6.3.0/ucd/NamesList.txt'
task 'db/Category-Emoji.json' do |t|
system "plutil -convert json -r '#{emoji_plist}' -o '#{t.name}'"
end
file 'db/NamesList.txt' do |t|
system "curl -fsSL '#{nameslist_url}' -o '#{t.name}'"
end

47
db/Category-Emoji.json Normal file
View File

@@ -0,0 +1,47 @@
{
"EmojiDataArray" : [
{
"CVDataTitle" : "EmojiCategory-People",
"CVCategoryImage" : "Emoji-HumanImage",
"CVCategoryData" : {
"CVSkipNullGlyphs" : true,
"Data" : "😄,😃,😀,😊,☺️,😉,😍,😘,😚,😗,😙,😜,😝,😛,😳,😁,😔,😌,😒,😞,😣,😢,😂,😭,😪,😥,😰,😅,😓,😩,😫,😨,😱,😠,😡,😤,😖,😆,😋,😷,😎,😴,😵,😲,😟,😦,😧,😈,👿,😮,😬,😐,😕,😯,😶,😇,😏,😑,👲,👳,👮,👷,💂,👶,👦,👧,👨,👩,👴,👵,👱,👼,👸,😺,😸,😻,😽,😼,🙀,😿,😹,😾,👹,👺,🙈,🙉,🙊,💀,👽,💩,🔥,✨,🌟,💫,💥,💢,💦,💧,💤,💨,👂,👀,👃,👅,👄,👍,👎,👌,👊,✊,✌️,👋,✋,👐,👆,👇,👉,👈,🙌,🙏,☝️,👏,💪,🚶,🏃,💃,👫,👪,👬,👭,💏,💑,👯,🙆,🙅,💁,🙋,💆,💇,💅,👰,🙎,🙍,🙇,🎩,👑,👒,👟,👞,👡,👠,👢,👕,👔,👚,👗,🎽,👖,👘,👙,💼,👜,👝,👛,👓,🎀,🌂,💄,💛,💙,💜,💚,❤️,💔,💗,💓,💕,💖,💞,💘,💌,💋,💍,💎,👤,👥,💬,👣,💭"
}
},
{
"CVDataTitle" : "EmojiCategory-Nature",
"CVCategoryImage" : "Emoji-NatureImage",
"CVCategoryData" : {
"CVSkipNullGlyphs" : true,
"Data" : "🐶,🐺,🐱,🐭,🐹,🐰,🐸,🐯,🐨,🐻,🐷,🐽,🐮,🐗,🐵,🐒,🐴,🐑,🐘,🐼,🐧,🐦,🐤,🐥,🐣,🐔,🐍,🐢,🐛,🐝,🐜,🐞,🐌,🐙,🐚,🐠,🐟,🐬,🐳,🐋,🐄,🐏,🐀,🐃,🐅,🐇,🐉,🐎,🐐,🐓,🐕,🐖,🐁,🐂,🐲,🐡,🐊,🐫,🐪,🐆,🐈,🐩,🐾,💐,🌸,🌷,🍀,🌹,🌻,🌺,🍁,🍃,🍂,🌿,🌾,🍄,🌵,🌴,🌲,🌳,🌰,🌱,🌼,🌐,🌞,🌝,🌚,🌑,🌒,🌓,🌔,🌕,🌖,🌗,🌘,🌜,🌛,🌙,🌍,🌎,🌏,🌋,🌌,🌠,⭐️,☀️,⛅️,☁️,⚡️,☔️,❄️,⛄️,🌀,🌁,🌈,🌊"
}
},
{
"CVDataTitle" : "EmojiCategory-Objects",
"CVCategoryImage" : "Emoji-ObjectsImage",
"CVCategoryData" : {
"CVSkipNullGlyphs" : true,
"Data" : "🎍,💝,🎎,🎒,🎓,🎏,🎆,🎇,🎐,🎑,🎃,👻,🎅,🎄,🎁,🎋,🎉,🎊,🎈,🎌,🔮,🎥,📷,📹,📼,💿,📀,💽,💾,💻,📱,☎️,📞,📟,📠,📡,📺,📻,🔊,🔉,🔈,🔇,🔔,🔕,📢,📣,⏳,⌛️,⏰,⌚️,🔓,🔒,🔏,🔐,🔑,🔎,💡,🔦,🔆,🔅,🔌,🔋,🔍,🛁,🛀,🚿,🚽,🔧,🔩,🔨,🚪,🚬,💣,🔫,🔪,💊,💉,💰,💴,💵,💷,💶,💳,💸,📲,📧,📥,📤,✉️,📩,📨,📯,📫,📪,📬,📭,📮,📦,📝,📄,📃,📑,📊,📈,📉,📜,📋,📅,📆,📇,📁,📂,✂️,📌,📎,✒️,✏️,📏,📐,📕,📗,📘,📙,📓,📔,📒,📚,📖,🔖,📛,🔬,🔭,📰,🎨,🎬,🎤,🎧,🎼,🎵,🎶,🎹,🎻,🎺,🎷,🎸,👾,🎮,🃏,🎴,🀄️,🎲,🎯,🏈,🏀,⚽️,⚾️,🎾,🎱,🏉,🎳,⛳️,🚵,🚴,🏁,🏇,🏆,🎿,🏂,🏊,🏄,🎣,☕️,🍵,🍶,🍼,🍺,🍻,🍸,🍹,🍷,🍴,🍕,🍔,🍟,🍗,🍖,🍝,🍛,🍤,🍱,🍣,🍥,🍙,🍘,🍚,🍜,🍲,🍢,🍡,🍳,🍞,🍩,🍮,🍦,🍨,🍧,🎂,🍰,🍪,🍫,🍬,🍭,🍯,🍎,🍏,🍊,🍋,🍒,🍇,🍉,🍓,🍑,🍈,🍌,🍐,🍍,🍠,🍆,🍅,🌽"
}
},
{
"CVDataTitle" : "EmojiCategory-Places",
"CVCategoryImage" : "Emoji-PlacesImage",
"CVCategoryData" : {
"CVSkipNullGlyphs" : true,
"Data" : "🏠,🏡,🏫,🏢,🏣,🏥,🏦,🏪,🏩,🏨,💒,⛪️,🏬,🏤,🌇,🌆,🏯,🏰,⛺️,🏭,🗼,🗾,🗻,🌄,🌅,🌃,🗽,🌉,🎠,🎡,⛲️,🎢,🚢,⛵️,🚤,🚣,⚓️,🚀,✈️,💺,🚁,🚂,🚊,🚉,🚞,🚆,🚄,🚅,🚈,🚇,🚝,🚋,🚃,🚎,🚌,🚍,🚙,🚘,🚗,🚕,🚖,🚛,🚚,🚨,🚓,🚔,🚒,🚑,🚐,🚲,🚡,🚟,🚠,🚜,💈,🚏,🎫,🚦,🚥,⚠️,🚧,🔰,⛽️,🏮,🎰,♨️,🗿,🎪,🎭,📍,🚩,🇯🇵,🇰🇷,🇩🇪,🇨🇳,🇺🇸,🇫🇷,🇪🇸,🇮🇹,🇷🇺,🇬🇧"
}
},
{
"CVDataTitle" : "EmojiCategory-Symbols",
"CVCategoryImage" : "Emoji-SymbolImage",
"CVCategoryData" : {
"CVSkipNullGlyphs" : true,
"Data" : "1⃣,2⃣,3⃣,4⃣,5⃣,6⃣,7⃣,8⃣,9⃣,0⃣,🔟,🔢,#️⃣,🔣,⬆️,⬇️,⬅️,➡️,🔠,🔡,🔤,↗️,↖️,↘️,↙️,↔️,↕️,🔄,◀️,▶️,🔼,🔽,↩️,↪️,,⏪,⏩,⏫,⏬,⤵️,⤴️,🆗,🔀,🔁,🔂,🆕,🆙,🆒,🆓,🆖,📶,🎦,🈁,🈯️,🈳,🈵,🈴,🈲,🉐,🈹,🈺,🈶,🈚️,🚻,🚹,🚺,🚼,🚾,🚰,🚮,🅿️,♿️,🚭,🈷,🈸,🈂,Ⓜ️,🛂,🛄,🛅,🛃,🉑,㊙️,㊗️,🆑,🆘,🆔,🚫,🔞,📵,🚯,🚱,🚳,🚷,🚸,⛔️,✳️,❇️,❎,✅,✴️,💟,🆚,📳,📴,🅰,🅱,🆎,🅾,💠,➿,♻️,♈️,♉️,♊️,♋️,♌️,♍️,♎️,♏️,♐️,♑️,♒️,♓️,⛎,🔯,🏧,💹,💲,💱,©,®,™,❌,‼️,⁉️,❗️,❓,❕,❔,⭕️,🔝,🔚,🔙,🔛,🔜,🔃,🕛,🕧,🕐,🕜,🕑,🕝,🕒,🕞,🕓,🕟,🕔,🕠,🕕,🕖,🕗,🕘,🕙,🕚,🕡,🕢,🕣,🕤,🕥,🕦,✖️,,,➗,♠️,♥️,♣️,♦️,💮,💯,✔️,☑️,🔘,🔗,➰,〰,〽️,🔱,◼️,◻️,◾️,◽️,▪️,▫️,🔺,🔲,🔳,⚫️,⚪️,🔴,🔵,🔻,⬜️,⬛️,🔶,🔷,🔸,🔹"
}
}
],
"CVViewFontList" : [
"AppleColorEmoji"
]
}

79
db/dump.rb Normal file
View File

@@ -0,0 +1,79 @@
require 'emoji'
require 'json'
names_list = File.expand_path('../NamesList.txt', __FILE__)
class UnicodeCharacter
attr_reader :code, :description, :aliases
@index = {}
class << self
attr_reader :index
def fetch(code, *args, &block)
code = code.to_s(16).rjust(4, '0') if code.is_a?(Integer)
index.fetch(code, *args, &block)
end
end
def initialize(code, description)
@code = code.downcase
@description = description.downcase
@aliases = []
@references = []
self.class.index[@code] = self
end
def add_alias(string)
@aliases.concat string.split(/\s*,\s*/)
end
def add_reference(code)
@references << code.downcase
end
end
char = nil
File.foreach(names_list) do |line|
case line
when /^[A-F0-9]{4,5}\t/
code, desc = line.chomp.split("\t", 2)
codepoint = code.hex
char = UnicodeCharacter.new(code, desc)
when /^\t= /
char.add_alias($')
when /^\tx .+ - ([A-F0-9]{4,5})\)$/
char.add_reference($1)
end
end
trap(:PIPE) { abort }
items = []
variation = Emoji::VARIATION_SELECTOR_16
for emoji in Emoji.all
unicodes = emoji.unicode_aliases.dup
item = {}
unless emoji.custom?
variation_codepoint = variation.codepoints[0]
chars = emoji.raw.codepoints.map { |code| UnicodeCharacter.fetch(code) unless code == variation_codepoint }.compact
unicodes.select { |u| u.index(variation) }.each { |u| unicodes.delete(u.sub(variation, '')) }
item[:emoji] = unicodes.shift
item[:unicodes] = unicodes if unicodes.any?
item[:description] = chars.map(&:description).join(' + ')
end
item[:aliases] = emoji.aliases
item[:tags] = emoji.tags
items << item
end
puts JSON.pretty_generate(items)
.gsub("\n\n", "\n")
.gsub(/,\n( +)/) { "\n%s, " % $1[2..-1] }

8275
db/emoji.json Normal file
View File

File diff suppressed because it is too large Load Diff

113
db/index.html Normal file
View File

@@ -0,0 +1,113 @@
<!doctype html>
<title>Emoji preview</title>
<style type="text/css">
body {
font: 14px/18px Verdana, Arial, sans-serif;
padding: 2em;
}
ol {
list-style: none;
padding-left: 0;
}
li {
margin-left: 0;
margin-top: 5px;
clear: left;
}
li:first-child { display: none; }
li > span {
display: block;
}
.emoji {
font-size: 50px;
line-height: 50px;
float: left;
margin-right: 20px;
}
.description {
font-style: italic;
color: gray;
}
.aliases span:before, .aliases span:after {
content: ":";
color: gray;
}
.tags {
font-size: 11px;
}
.tags span {
display: inline-block;
padding: 1px 5px 2px;
border-radius: 3px;
background: #dadada;
line-height: 11px;
}
</style>
<p><input type=search placeholder="Search..."></p>
<ol>
<li>
<span class="emoji"></span>
<span class="description"></span>
<span class="aliases"></span>
<span class="tags"></span>
</li>
</ol>
<script>
function renderEmoji(emojis) {
var item, els, template = document.querySelector('li')
for (var emoji, i=0; i < emojis.length; i++) {
emoji = emojis[i]
item = template.cloneNode(true)
els = item.querySelectorAll('span')
if (emoji.emoji) els[0].textContent = emoji.emoji
else {
var img = document.createElement('img')
img.src = "../images/emoji/" + emoji.aliases[0] + ".png"
els[0].appendChild(img)
}
els[1].textContent = emoji.description || ''
els[2].innerHTML = emoji.aliases.map(function(n){ return '<span>'+n+'</span>' }).join(' ')
els[3].innerHTML = emoji.tags.map(function(n){ return '<span>'+n+'</span>' }).join(' ')
template.parentNode.appendChild(item)
item._emojiText = (els[2].textContent + ' ' + els[3].textContent).replace(/_/g, '-')
}
}
xhr = new XMLHttpRequest
xhr.onreadystatechange = function() {
if (this.readyState == 4) {
json = JSON.parse(this.responseText)
renderEmoji(json)
}
}
xhr.open('GET', 'emoji.json', false)
xhr.send(null)
function searchEmoji(query) {
var el,
re = new RegExp('\\b' + query),
els = document.querySelectorAll('li')
for (var i=1; i < els.length; i++) {
el = els[i]
if ( !query || re.test(el._emojiText) ) {
el.style.display = 'list-item'
} else {
el.style.display = 'none'
}
}
}
var timeout, search = document.querySelector('input[type=search]')
search.addEventListener('input', function() {
var $this = this
if (timeout) clearTimeout(timeout)
timeout = setTimeout(function(){ searchEmoji($this.value) }, 200)
}, false)
search.focus()
</script>

View File

@@ -1,12 +1,21 @@
Gem::Specification.new do |s|
s.name = "gemoji"
s.version = "1.3.1"
s.summary = "Emoji Assets"
s.description = "Emoji assets"
s.version = "2.0.0"
s.summary = "Emoji conversion and image assets"
s.description = "Image assets and character information for emoji."
s.required_ruby_version = '> 1.9'
s.authors = ["GitHub"]
s.email = "support@github.com"
s.homepage = "https://github.com/github/gemoji"
s.licenses = ["MIT"]
s.files = Dir["README.md", "images/**/*.png", "lib/**/*.rb", "lib/tasks/*.rake"]
s.files = Dir[
"README.md",
"images/**/*.png",
"db/emoji.json",
"lib/**/*.rb",
"lib/tasks/*.rake"
]
end

View File

@@ -1 +0,0 @@
unicode/1f44d.png

View File

@@ -1 +0,0 @@
unicode/1f44e.png

View File

@@ -1 +0,0 @@
unicode/1f4af.png

View File

@@ -1 +0,0 @@
unicode/1f522.png

View File

@@ -1 +0,0 @@
unicode/1f3b1.png

View File

@@ -1 +0,0 @@
unicode/1f170.png

View File

@@ -1 +0,0 @@
unicode/1f18e.png

View File

@@ -1 +0,0 @@
unicode/1f524.png

View File

@@ -1 +0,0 @@
unicode/1f521.png

View File

@@ -1 +0,0 @@
unicode/1f251.png

View File

@@ -1 +0,0 @@
unicode/1f6a1.png

View File

@@ -1 +0,0 @@
unicode/2708.png

View File

@@ -1 +0,0 @@
unicode/23f0.png

View File

@@ -1 +0,0 @@
unicode/1f47d.png

View File

@@ -1 +0,0 @@
unicode/1f691.png

View File

@@ -1 +0,0 @@
unicode/2693.png

View File

@@ -1 +0,0 @@
unicode/1f47c.png

View File

@@ -1 +0,0 @@
unicode/1f4a2.png

View File

@@ -1 +0,0 @@
unicode/1f620.png

View File

@@ -1 +0,0 @@
unicode/1f627.png

View File

@@ -1 +0,0 @@
unicode/1f41c.png

View File

@@ -1 +0,0 @@
unicode/1f34e.png

View File

@@ -1 +0,0 @@
unicode/2652.png

View File

@@ -1 +0,0 @@
unicode/2648.png

View File

@@ -1 +0,0 @@
unicode/25c0.png

View File

@@ -1 +0,0 @@
unicode/23ec.png

View File

@@ -1 +0,0 @@
unicode/23eb.png

View File

@@ -1 +0,0 @@
unicode/2b07.png

View File

@@ -1 +0,0 @@
unicode/1f53d.png

View File

@@ -1 +0,0 @@
unicode/25b6.png

View File

@@ -1 +0,0 @@
unicode/2935.png

View File

@@ -1 +0,0 @@
unicode/2934.png

View File

@@ -1 +0,0 @@
unicode/2b05.png

View File

@@ -1 +0,0 @@
unicode/2199.png

View File

@@ -1 +0,0 @@
unicode/2198.png

View File

@@ -1 +0,0 @@
unicode/27a1.png

View File

@@ -1 +0,0 @@
unicode/21aa.png

View File

@@ -1 +0,0 @@
unicode/2b06.png

View File

@@ -1 +0,0 @@
unicode/2195.png

View File

@@ -1 +0,0 @@
unicode/1f53c.png

View File

@@ -1 +0,0 @@
unicode/2196.png

View File

@@ -1 +0,0 @@
unicode/2197.png

View File

@@ -1 +0,0 @@
unicode/1f503.png

View File

@@ -1 +0,0 @@
unicode/1f504.png

View File

@@ -1 +0,0 @@
unicode/1f3a8.png

View File

@@ -1 +0,0 @@
unicode/1f69b.png

View File

@@ -1 +0,0 @@
unicode/1f632.png

View File

@@ -1 +0,0 @@
unicode/1f45f.png

View File

@@ -1 +0,0 @@
unicode/1f3e7.png

View File

@@ -1 +0,0 @@
unicode/1f171.png

View File

@@ -1 +0,0 @@
unicode/1f476.png

View File

@@ -1 +0,0 @@
unicode/1f37c.png

View File

@@ -1 +0,0 @@
unicode/1f424.png

View File

@@ -1 +0,0 @@
unicode/1f6bc.png

View File

@@ -1 +0,0 @@
unicode/1f519.png

View File

@@ -1 +0,0 @@
unicode/1f6c4.png

View File

@@ -1 +0,0 @@
unicode/1f388.png

View File

@@ -1 +0,0 @@
unicode/2611.png

View File

@@ -1 +0,0 @@
unicode/1f38d.png

View File

@@ -1 +0,0 @@
unicode/1f34c.png

View File

@@ -1 +0,0 @@
unicode/203c.png

View File

@@ -1 +0,0 @@
unicode/1f3e6.png

View File

@@ -1 +0,0 @@
unicode/1f4ca.png

View File

@@ -1 +0,0 @@
unicode/1f488.png

View File

@@ -1 +0,0 @@
unicode/26be.png

View File

@@ -1 +0,0 @@
unicode/1f3c0.png

View File

@@ -1 +0,0 @@
unicode/1f6c0.png

View File

@@ -1 +0,0 @@
unicode/1f6c1.png

View File

@@ -1 +0,0 @@
unicode/1f50b.png

View File

@@ -1 +0,0 @@
unicode/1f43b.png

View File

@@ -1 +0,0 @@
unicode/1f41d.png

View File

@@ -1 +0,0 @@
unicode/1f37a.png

View File

@@ -1 +0,0 @@
unicode/1f37b.png

View File

@@ -1 +0,0 @@
unicode/1f41e.png

View File

@@ -1 +0,0 @@
unicode/1f530.png

View File

@@ -1 +0,0 @@
unicode/1f514.png

View File

@@ -1 +0,0 @@
unicode/1f371.png

View File

@@ -1 +0,0 @@
unicode/1f6b4.png

View File

@@ -1 +0,0 @@
unicode/1f6b2.png

View File

@@ -1 +0,0 @@
unicode/1f459.png

View File

@@ -1 +0,0 @@
unicode/1f426.png

View File

@@ -1 +0,0 @@
unicode/1f382.png

View File

@@ -1 +0,0 @@
unicode/26ab.png

View File

@@ -1 +0,0 @@
unicode/1f0cf.png

View File

@@ -1 +0,0 @@
unicode/2b1b.png

View File

@@ -1 +0,0 @@
unicode/25fe.png

View File

@@ -1 +0,0 @@
unicode/25fc.png

View File

@@ -1 +0,0 @@
unicode/2712.png

Some files were not shown because too many files have changed in this diff Show More