Compare commits
4 Commits
v3.0.1
..
2.0-stable
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6a39782a46 | ||
|
|
c6a9db29bd | ||
|
|
3ec375d299 | ||
|
|
34cd8356bb |
9
.gitignore
vendored
@@ -1,9 +1,2 @@
|
||||
/bin/*
|
||||
!/bin/gemoji
|
||||
.bundle
|
||||
.ruby-version
|
||||
Gemfile.lock
|
||||
db/emoji-test.txt
|
||||
db/ucd.nounihan.grouped.xml
|
||||
images/unicode/*.png
|
||||
vendor/
|
||||
db/NamesList.txt
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
sudo: false
|
||||
script: script/test
|
||||
rvm:
|
||||
- 1.9.3
|
||||
- '2.1'
|
||||
- '2.2'
|
||||
- 2.3.0
|
||||
- 2.1.2
|
||||
notifications:
|
||||
email: false
|
||||
|
||||
@@ -1,54 +0,0 @@
|
||||
Contributions to this project are [released](https://help.github.com/articles/github-terms-of-service/#6-contributions-under-repository-license) to the public under the [project's open source license](LICENSE).
|
||||
|
||||
This project adheres to the [Open Code of Conduct][code-of-conduct]. By participating, you are expected to uphold this code.
|
||||
[code-of-conduct]: http://todogroup.org/opencodeofconduct/#gemoji/opensource@github.com
|
||||
|
||||
Our emoji set is based off Apple's emoji character palette, plus some custom
|
||||
emoji such as :octocat: :shipit: :metal:.
|
||||
|
||||
Some useful tools in development are:
|
||||
|
||||
```
|
||||
script/bootstrap
|
||||
```
|
||||
|
||||
Sets up the development environment. The prerequisites are:
|
||||
|
||||
* Ruby 1.9+
|
||||
* Bundler
|
||||
|
||||
```
|
||||
rake db:generate
|
||||
```
|
||||
|
||||
On OS X, this will rebuild the `db/Category-Emoji.json` file from the system
|
||||
one, pulling in any new emoji that Apple may have added in the meantime.
|
||||
|
||||
```
|
||||
script/test
|
||||
```
|
||||
|
||||
Runs the test suite, including the integrity test where we assert that we have
|
||||
covered each of Apple's emoji.
|
||||
|
||||
```
|
||||
script/regenerate
|
||||
```
|
||||
|
||||
Rebuilds the `db/emoji.json` file which is our main list of emoji: their
|
||||
canonical representations, descriptions, aliases, and tags. This requires OS X
|
||||
because Safari is used in the process to verify which character render as emoji
|
||||
and which render as ordinary Unicode glyphs from the current font.
|
||||
|
||||
```
|
||||
script/console
|
||||
```
|
||||
|
||||
Opens `irb` console with gemoji library preloded for experimentation.
|
||||
|
||||
```
|
||||
script/release
|
||||
```
|
||||
|
||||
For maintainers only: after the gemspec has been edited, this commits the
|
||||
change, tags a release, and pushes it to both GitHub and RubyGems.org.
|
||||
4
Gemfile
@@ -1,6 +1,6 @@
|
||||
source "https://rubygems.org"
|
||||
|
||||
gem "rake", "~> 10.3.2"
|
||||
gem "minitest", "~> 5.3.5"
|
||||
gem "rake"
|
||||
gem "minitest"
|
||||
|
||||
gemspec
|
||||
|
||||
18
Gemfile.lock
Normal file
@@ -0,0 +1,18 @@
|
||||
PATH
|
||||
remote: .
|
||||
specs:
|
||||
gemoji (2.0.1)
|
||||
|
||||
GEM
|
||||
remote: https://rubygems.org/
|
||||
specs:
|
||||
minitest (5.3.5)
|
||||
rake (10.3.2)
|
||||
|
||||
PLATFORMS
|
||||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
gemoji!
|
||||
minitest
|
||||
rake
|
||||
3
LICENSE
@@ -10,6 +10,9 @@ Copyright (c) 2013 id Software. All rights reserved.
|
||||
trollface
|
||||
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.
|
||||
|
||||
27
MAINTAINING.md
Normal file
@@ -0,0 +1,27 @@
|
||||
# Maintainers
|
||||
|
||||
## Releasing a new gem
|
||||
|
||||
If you are just adding new emoji or making a small fix, only increment the patch level "1.0.x". If you need to rename a ton of emojis or making any other radical (but still mostly backwards compatible changes), bump the minor version "1.x.x".
|
||||
|
||||
### Make a release commit
|
||||
|
||||
To prepare the release commit, edit the [gemoji.gemspec](https://github.com/github/gemoji/blob/master/gemoji.gemspec) `version` value. Then make a single commit with the description as "Gemoji 1.x.x". Finally, tag the commit with `v1.x.x`.
|
||||
|
||||
Example commit https://github.com/github/gemoji/commit/v1.0.0
|
||||
|
||||
```
|
||||
$ git ci -m "Gemoji 1.0.0"
|
||||
$ git tag v1.0.0
|
||||
$ git push
|
||||
$ git push --tags
|
||||
```
|
||||
|
||||
### Publish the gem
|
||||
|
||||
Build and push the new gem with
|
||||
|
||||
```
|
||||
$ gem build gemoji.gemspec
|
||||
$ gem push gemoji-1.0.0.gem
|
||||
```
|
||||
48
README.md
@@ -1,8 +1,7 @@
|
||||
gemoji
|
||||
======
|
||||
|
||||
This library contains character information about native emoji, as well as image
|
||||
files for a few custom emoji.
|
||||
Emoji images and names. See the LICENSE for copyright information.
|
||||
|
||||
|
||||
Installation
|
||||
@@ -14,19 +13,36 @@ Add `gemoji` to your Gemfile.
|
||||
gem 'gemoji'
|
||||
```
|
||||
|
||||
### Extract images
|
||||
**Sync images**
|
||||
|
||||
To obtain image files as fallbacks for browsers and OS's that don't support
|
||||
emoji, run the `gemoji extract` command **on macOS Sierra or later**:
|
||||
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).
|
||||
|
||||
``` sh
|
||||
bundle exec gemoji extract public/images/emoji
|
||||
``` ruby
|
||||
# Rakefile
|
||||
load 'tasks/emoji.rake'
|
||||
```
|
||||
|
||||
This will extract images into filenames such as:
|
||||
```
|
||||
$ rake emoji
|
||||
```
|
||||
|
||||
* `public/images/emoji/octocat.png`
|
||||
* `public/images/emoji/unicode/1f9c0.png` (the `:cheese:` emoji)
|
||||
**Assets Precompiling**
|
||||
|
||||
If you must, you can manually add all the images to your asset load path.
|
||||
|
||||
``` ruby
|
||||
# config/application.rb
|
||||
config.assets.paths << Emoji.images_path
|
||||
```
|
||||
|
||||
Then have them compiled to public on deploy.
|
||||
|
||||
``` ruby
|
||||
# config/application.rb
|
||||
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.
|
||||
|
||||
|
||||
Example Rails Helper
|
||||
@@ -40,8 +56,8 @@ See the [Emoji cheat sheet](http://www.emoji-cheat-sheet.com) 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" />)
|
||||
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
|
||||
@@ -91,14 +107,6 @@ 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:
|
||||
|
||||
```ruby
|
||||
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:
|
||||
|
||||
```ruby
|
||||
|
||||
30
Rakefile
@@ -9,11 +9,7 @@ end
|
||||
|
||||
namespace :db do
|
||||
desc %(Generate Emoji data files needed for development)
|
||||
task :generate => [
|
||||
'db/Category-Emoji.json',
|
||||
'db/ucd.nounihan.grouped.xml',
|
||||
'db/emoji-test.txt',
|
||||
]
|
||||
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
|
||||
@@ -21,25 +17,13 @@ namespace :db do
|
||||
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',
|
||||
'/System/Library/Input Methods/CharacterPalette.app/Contents/Resources/Category-Emoji.plist',
|
||||
'-o', t.name
|
||||
system "plutil -convert json -r '#{emoji_plist}' -o '#{t.name}'"
|
||||
end
|
||||
|
||||
file 'db/ucd.nounihan.grouped.xml' do
|
||||
Dir.chdir('db') do
|
||||
system 'curl', '-fsSLO', 'http://www.unicode.org/Public/9.0.0/ucdxml/ucd.nounihan.grouped.zip'
|
||||
system 'unzip', '-q', 'ucd.nounihan.grouped.zip'
|
||||
rm 'ucd.nounihan.grouped.zip'
|
||||
end
|
||||
end
|
||||
|
||||
file 'db/emoji-test.txt' do |t|
|
||||
system 'curl', '-fsSL', 'http://unicode.org/Public/emoji/4.0/emoji-test.txt', '-o', t.name
|
||||
end
|
||||
|
||||
directory 'images/unicode' do
|
||||
require 'emoji/extractor'
|
||||
Emoji::Extractor.new(64, Emoji.images_path).extract!
|
||||
file 'db/NamesList.txt' do |t|
|
||||
system "curl -fsSL '#{nameslist_url}' -o '#{t.name}'"
|
||||
end
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
#!/usr/bin/env ruby
|
||||
require 'emoji/cli'
|
||||
|
||||
exit_code = Emoji::CLI.dispatch(ARGV)
|
||||
exit exit_code
|
||||
@@ -4,64 +4,40 @@
|
||||
"CVDataTitle" : "EmojiCategory-People",
|
||||
"CVCategoryImage" : "Emoji-HumanImage",
|
||||
"CVCategoryData" : {
|
||||
"CVSkipNullGlyphs" : false,
|
||||
"Data" : "😀,😃,😄,😁,😆,😅,😂,🤣,☺️,😊,😇,🙂,🙃,😉,😌,😍,😘,😗,😙,😚,😋,😜,😝,😛,🤑,🤗,🤓,😎,🤡,🤠,😏,😒,😞,😔,😟,😕,🙁,☹️,😣,😖,😫,😩,😤,😠,😡,😶,😐,😑,😯,😦,😧,😮,😲,😵,😳,😱,😨,😰,😢,😥,🤤,😭,😓,😪,😴,🙄,🤔,🤥,😬,🤐,🤢,🤧,😷,🤒,🤕,😈,👿,👹,👺,💩,👻,💀,☠️,👽,👾,🤖,🎃,😺,😸,😹,😻,😼,😽,🙀,😿,😾,👐,🙌,👏,🙏,🤝,👍,👎,👊,✊,🤛,🤜,🤞,✌️,🤘,👌,👈,👉,👆,👇,☝️,✋,🤚,🖐,🖖,👋,🤙,💪,🖕,✍️,🤳,💅,💍,💄,💋,👄,👅,👂,👃,👣,👁,👀,🗣,👤,👥,👶,👦,👧,👨,👩,👱♀️,👱,👴,👵,👲,👳♀️,👳,👮♀️,👮,👷♀️,👷,💂♀️,💂,🕵️♀️,🕵️,👩⚕️,👨⚕️,👩🌾,👨🌾,👩🍳,👨🍳,👩🎓,👨🎓,👩🎤,👨🎤,👩🏫,👨🏫,👩🏭,👨🏭,👩💻,👨💻,👩💼,👨💼,👩🔧,👨🔧,👩🔬,👨🔬,👩🎨,👨🎨,👩🚒,👨🚒,👩✈️,👨✈️,👩🚀,👨🚀,👩⚖️,👨⚖️,🤶,🎅,👸,🤴,👰,🤵,👼,🤰,🙇♀️,🙇,💁,💁♂️,🙅,🙅♂️,🙆,🙆♂️,🙋,🙋♂️,🤦♀️,🤦♂️,🤷♀️,🤷♂️,🙎,🙎♂️,🙍,🙍♂️,💇,💇♂️,💆,💆♂️,🕴,💃,🕺,👯,👯♂️,🚶♀️,🚶,🏃♀️,🏃,👫,👭,👬,💑,👩❤️👩,👨❤️👨,💏,👩❤️💋👩,👨❤️💋👨,👪,👨👩👧,👨👩👧👦,👨👩👦👦,👨👩👧👧,👩👩👦,👩👩👧,👩👩👧👦,👩👩👦👦,👩👩👧👧,👨👨👦,👨👨👧,👨👨👧👦,👨👨👦👦,👨👨👧👧,👩👦,👩👧,👩👧👦,👩👦👦,👩👧👧,👨👦,👨👧,👨👧👦,👨👦👦,👨👧👧,👚,👕,👖,👔,👗,👙,👘,👠,👡,👢,👞,👟,👒,🎩,🎓,👑,⛑,🎒,👝,👛,👜,💼,👓,🕶,🌂,☂️"
|
||||
"CVSkipNullGlyphs" : true,
|
||||
"Data" : "😄,😃,😀,😊,☺️,😉,😍,😘,😚,😗,😙,😜,😝,😛,😳,😁,😔,😌,😒,😞,😣,😢,😂,😭,😪,😥,😰,😅,😓,😩,😫,😨,😱,😠,😡,😤,😖,😆,😋,😷,😎,😴,😵,😲,😟,😦,😧,😈,👿,😮,😬,😐,😕,😯,😶,😇,😏,😑,👲,👳,👮,👷,💂,👶,👦,👧,👨,👩,👴,👵,👱,👼,👸,😺,😸,😻,😽,😼,🙀,😿,😹,😾,👹,👺,🙈,🙉,🙊,💀,👽,💩,🔥,✨,🌟,💫,💥,💢,💦,💧,💤,💨,👂,👀,👃,👅,👄,👍,👎,👌,👊,✊,✌️,👋,✋,👐,👆,👇,👉,👈,🙌,🙏,☝️,👏,💪,🚶,🏃,💃,👫,👪,👬,👭,💏,💑,👯,🙆,🙅,💁,🙋,💆,💇,💅,👰,🙎,🙍,🙇,🎩,👑,👒,👟,👞,👡,👠,👢,👕,👔,👚,👗,🎽,👖,👘,👙,💼,👜,👝,👛,👓,🎀,🌂,💄,💛,💙,💜,💚,❤️,💔,💗,💓,💕,💖,💞,💘,💌,💋,💍,💎,👤,👥,💬,👣,💭"
|
||||
}
|
||||
},
|
||||
{
|
||||
"CVDataTitle" : "EmojiCategory-Nature",
|
||||
"CVCategoryImage" : "Emoji-NatureImage",
|
||||
"CVCategoryData" : {
|
||||
"CVSkipNullGlyphs" : false,
|
||||
"Data" : "🐶,🐱,🐭,🐹,🐰,🦊,🐻,🐼,🐨,🐯,🦁,🐮,🐷,🐽,🐸,🐵,🙈,🙉,🙊,🐒,🐔,🐧,🐦,🐤,🐣,🐥,🦆,🦅,🦉,🦇,🐺,🐗,🐴,🦄,🐝,🐛,🦋,🐌,🐚,🐞,🐜,🕷,🕸,🐢,🐍,🦎,🦂,🦀,🦑,🐙,🦐,🐠,🐟,🐡,🐬,🦈,🐳,🐋,🐊,🐆,🐅,🐃,🐂,🐄,🦌,🐪,🐫,🐘,🦏,🦍,🐎,🐖,🐐,🐏,🐑,🐕,🐩,🐈,🐓,🦃,🕊,🐇,🐁,🐀,🐿,🐾,🐉,🐲,🌵,🎄,🌲,🌳,🌴,🌱,🌿,☘️,🍀,🎍,🎋,🍃,🍂,🍁,🍄,🌾,💐,🌷,🌹,🥀,🌻,🌼,🌸,🌺,🌎,🌍,🌏,🌕,🌖,🌗,🌘,🌑,🌒,🌓,🌔,🌚,🌝,🌞,🌛,🌜,🌙,💫,⭐️,🌟,✨,⚡️,🔥,💥,☄️,☀️,🌤,⛅️,🌥,🌦,🌈,☁️,🌧,⛈,🌩,🌨,☃️,⛄️,❄️,🌬,💨,🌪,🌫,🌊,💧,💦,☔️"
|
||||
}
|
||||
},
|
||||
{
|
||||
"CVDataTitle" : "EmojiCategory-Foods",
|
||||
"CVCategoryImage" : "Emoji-FoodsImage",
|
||||
"CVCategoryData" : {
|
||||
"CVSkipNullGlyphs" : false,
|
||||
"Data" : "🍏,🍎,🍐,🍊,🍋,🍌,🍉,🍇,🍓,🍈,🍒,🍑,🍍,🥝,🥑,🍅,🍆,🥒,🥕,🌽,🌶,🥔,🍠,🌰,🥜,🍯,🥐,🍞,🥖,🧀,🥚,🍳,🥓,🥞,🍤,🍗,🍖,🍕,🌭,🍔,🍟,🥙,🌮,🌯,🥗,🥘,🍝,🍜,🍲,🍥,🍣,🍱,🍛,🍚,🍙,🍘,🍢,🍡,🍧,🍨,🍦,🍰,🎂,🍮,🍭,🍬,🍫,🍿,🍩,🍪,🥛,🍼,☕️,🍵,🍶,🍺,🍻,🥂,🍷,🥃,🍸,🍹,🍾,🥄,🍴,🍽"
|
||||
}
|
||||
},
|
||||
{
|
||||
"CVDataTitle" : "EmojiCategory-Activity",
|
||||
"CVCategoryImage" : "Emoji-ActivityImage",
|
||||
"CVCategoryData" : {
|
||||
"CVSkipNullGlyphs" : false,
|
||||
"Data" : "⚽️,🏀,🏈,⚾️,🎾,🏐,🏉,🎱,🏓,🏸,🥅,🏒,🏑,🏏,⛳️,🏹,🎣,🥊,🥋,⛸,🎿,⛷,🏂,🏋️♀️,🏋️,🤺,🤼♀️,🤼♂️,🤸♀️,🤸♂️,⛹️♀️,⛹️,🤾♀️,🤾♂️,🏌️♀️,🏌️,🏄♀️,🏄,🏊♀️,🏊,🤽♀️,🤽♂️,🚣♀️,🚣,🏇,🚴♀️,🚴,🚵♀️,🚵,🎽,🏅,🎖,🥇,🥈,🥉,🏆,🏵,🎗,🎫,🎟,🎪,🤹♀️,🤹♂️,🎭,🎨,🎬,🎤,🎧,🎼,🎹,🥁,🎷,🎺,🎸,🎻,🎲,🎯,🎳,🎮,🎰"
|
||||
}
|
||||
},
|
||||
{
|
||||
"CVDataTitle" : "EmojiCategory-Places",
|
||||
"CVCategoryImage" : "Emoji-PlacesImage",
|
||||
"CVCategoryData" : {
|
||||
"CVSkipNullGlyphs" : false,
|
||||
"Data" : "🚗,🚕,🚙,🚌,🚎,🏎,🚓,🚑,🚒,🚐,🚚,🚛,🚜,🛴,🚲,🛵,🏍,🚨,🚔,🚍,🚘,🚖,🚡,🚠,🚟,🚃,🚋,🚞,🚝,🚄,🚅,🚈,🚂,🚆,🚇,🚊,🚉,🚁,🛩,✈️,🛫,🛬,🚀,🛰,💺,🛶,⛵️,🛥,🚤,🛳,⛴,🚢,⚓️,🚧,⛽️,🚏,🚦,🚥,🗺,🗿,🗽,⛲️,🗼,🏰,🏯,🏟,🎡,🎢,🎠,⛱,🏖,🏝,⛰,🏔,🗻,🌋,🏜,🏕,⛺️,🛤,🛣,🏗,🏭,🏠,🏡,🏘,🏚,🏢,🏬,🏣,🏤,🏥,🏦,🏨,🏪,🏫,🏩,💒,🏛,⛪️,🕌,🕍,🕋,⛩,🗾,🎑,🏞,🌅,🌄,🌠,🎇,🎆,🌇,🌆,🏙,🌃,🌌,🌉,🌁"
|
||||
"CVSkipNullGlyphs" : true,
|
||||
"Data" : "🐶,🐺,🐱,🐭,🐹,🐰,🐸,🐯,🐨,🐻,🐷,🐽,🐮,🐗,🐵,🐒,🐴,🐑,🐘,🐼,🐧,🐦,🐤,🐥,🐣,🐔,🐍,🐢,🐛,🐝,🐜,🐞,🐌,🐙,🐚,🐠,🐟,🐬,🐳,🐋,🐄,🐏,🐀,🐃,🐅,🐇,🐉,🐎,🐐,🐓,🐕,🐖,🐁,🐂,🐲,🐡,🐊,🐫,🐪,🐆,🐈,🐩,🐾,💐,🌸,🌷,🍀,🌹,🌻,🌺,🍁,🍃,🍂,🌿,🌾,🍄,🌵,🌴,🌲,🌳,🌰,🌱,🌼,🌐,🌞,🌝,🌚,🌑,🌒,🌓,🌔,🌕,🌖,🌗,🌘,🌜,🌛,🌙,🌍,🌎,🌏,🌋,🌌,🌠,⭐️,☀️,⛅️,☁️,⚡️,☔️,❄️,⛄️,🌀,🌁,🌈,🌊"
|
||||
}
|
||||
},
|
||||
{
|
||||
"CVDataTitle" : "EmojiCategory-Objects",
|
||||
"CVCategoryImage" : "Emoji-ObjectsImage",
|
||||
"CVCategoryData" : {
|
||||
"CVSkipNullGlyphs" : false,
|
||||
"Data" : "⌚️,📱,📲,💻,⌨️,🖥,🖨,🖱,🖲,🕹,🗜,💽,💾,💿,📀,📼,📷,📸,📹,🎥,📽,🎞,📞,☎️,📟,📠,📺,📻,🎙,🎚,🎛,⏱,⏲,⏰,🕰,⌛️,⏳,📡,🔋,🔌,💡,🔦,🕯,🗑,🛢,💸,💵,💴,💶,💷,💰,💳,💎,⚖️,🔧,🔨,⚒,🛠,⛏,🔩,⚙️,⛓,🔫,💣,🔪,🗡,⚔️,🛡,🚬,⚰️,⚱️,🏺,🔮,📿,💈,⚗️,🔭,🔬,🕳,💊,💉,🌡,🚽,🚰,🚿,🛁,🛀,🛎,🔑,🗝,🚪,🛋,🛏,🛌,🖼,🛍,🛒,🎁,🎈,🎏,🎀,🎊,🎉,🎎,🏮,🎐,✉️,📩,📨,📧,💌,📥,📤,📦,🏷,📪,📫,📬,📭,📮,📯,📜,📃,📄,📑,📊,📈,📉,🗒,🗓,📆,📅,📇,🗃,🗳,🗄,📋,📁,📂,🗂,🗞,📰,📓,📔,📒,📕,📗,📘,📙,📚,📖,🔖,🔗,📎,🖇,📐,📏,📌,📍,✂️,🖊,🖋,✒️,🖌,🖍,📝,✏️,🔍,🔎,🔏,🔐,🔒,🔓"
|
||||
"CVSkipNullGlyphs" : true,
|
||||
"Data" : "🎍,💝,🎎,🎒,🎓,🎏,🎆,🎇,🎐,🎑,🎃,👻,🎅,🎄,🎁,🎋,🎉,🎊,🎈,🎌,🔮,🎥,📷,📹,📼,💿,📀,💽,💾,💻,📱,☎️,📞,📟,📠,📡,📺,📻,🔊,🔉,🔈,🔇,🔔,🔕,📢,📣,⏳,⌛️,⏰,⌚️,🔓,🔒,🔏,🔐,🔑,🔎,💡,🔦,🔆,🔅,🔌,🔋,🔍,🛁,🛀,🚿,🚽,🔧,🔩,🔨,🚪,🚬,💣,🔫,🔪,💊,💉,💰,💴,💵,💷,💶,💳,💸,📲,📧,📥,📤,✉️,📩,📨,📯,📫,📪,📬,📭,📮,📦,📝,📄,📃,📑,📊,📈,📉,📜,📋,📅,📆,📇,📁,📂,✂️,📌,📎,✒️,✏️,📏,📐,📕,📗,📘,📙,📓,📔,📒,📚,📖,🔖,📛,🔬,🔭,📰,🎨,🎬,🎤,🎧,🎼,🎵,🎶,🎹,🎻,🎺,🎷,🎸,👾,🎮,🃏,🎴,🀄️,🎲,🎯,🏈,🏀,⚽️,⚾️,🎾,🎱,🏉,🎳,⛳️,🚵,🚴,🏁,🏇,🏆,🎿,🏂,🏊,🏄,🎣,☕️,🍵,🍶,🍼,🍺,🍻,🍸,🍹,🍷,🍴,🍕,🍔,🍟,🍗,🍖,🍝,🍛,🍤,🍱,🍣,🍥,🍙,🍘,🍚,🍜,🍲,🍢,🍡,🍳,🍞,🍩,🍮,🍦,🍨,🍧,🎂,🍰,🍪,🍫,🍬,🍭,🍯,🍎,🍏,🍊,🍋,🍒,🍇,🍉,🍓,🍑,🍈,🍌,🍐,🍍,🍠,🍆,🍅,🌽"
|
||||
}
|
||||
},
|
||||
{
|
||||
"CVDataTitle" : "EmojiCategory-Places",
|
||||
"CVCategoryImage" : "Emoji-PlacesImage",
|
||||
"CVCategoryData" : {
|
||||
"CVSkipNullGlyphs" : true,
|
||||
"Data" : "🏠,🏡,🏫,🏢,🏣,🏥,🏦,🏪,🏩,🏨,💒,⛪️,🏬,🏤,🌇,🌆,🏯,🏰,⛺️,🏭,🗼,🗾,🗻,🌄,🌅,🌃,🗽,🌉,🎠,🎡,⛲️,🎢,🚢,⛵️,🚤,🚣,⚓️,🚀,✈️,💺,🚁,🚂,🚊,🚉,🚞,🚆,🚄,🚅,🚈,🚇,🚝,🚋,🚃,🚎,🚌,🚍,🚙,🚘,🚗,🚕,🚖,🚛,🚚,🚨,🚓,🚔,🚒,🚑,🚐,🚲,🚡,🚟,🚠,🚜,💈,🚏,🎫,🚦,🚥,⚠️,🚧,🔰,⛽️,🏮,🎰,♨️,🗿,🎪,🎭,📍,🚩,🇯🇵,🇰🇷,🇩🇪,🇨🇳,🇺🇸,🇫🇷,🇪🇸,🇮🇹,🇷🇺,🇬🇧"
|
||||
}
|
||||
},
|
||||
{
|
||||
"CVDataTitle" : "EmojiCategory-Symbols",
|
||||
"CVCategoryImage" : "Emoji-SymbolImage",
|
||||
"CVCategoryData" : {
|
||||
"CVSkipNullGlyphs" : false,
|
||||
"Data" : "❤️,💛,💚,💙,💜,🖤,💔,❣️,💕,💞,💓,💗,💖,💘,💝,💟,☮️,✝️,☪️,🕉,☸️,✡️,🔯,🕎,☯️,☦️,🛐,⛎,♈️,♉️,♊️,♋️,♌️,♍️,♎️,♏️,♐️,♑️,♒️,♓️,🆔,⚛️,🉑,☢️,☣️,📴,📳,🈶,🈚️,🈸,🈺,🈷️,✴️,🆚,💮,🉐,㊙️,㊗️,🈴,🈵,🈹,🈲,🅰️,🅱️,🆎,🆑,🅾️,🆘,❌,⭕️,🛑,⛔️,📛,🚫,💯,💢,♨️,🚷,🚯,🚳,🚱,🔞,📵,🚭,❗️,❕,❓,❔,‼️,⁉️,🔅,🔆,〽️,⚠️,🚸,🔱,⚜️,🔰,♻️,✅,🈯️,💹,❇️,✳️,❎,🌐,💠,Ⓜ️,🌀,💤,🏧,🚾,♿️,🅿️,🈳,🈂️,🛂,🛃,🛄,🛅,🚹,🚺,🚼,🚻,🚮,🎦,📶,🈁,🔣,ℹ️,🔤,🔡,🔠,🆖,🆗,🆙,🆒,🆕,🆓,0️⃣,1️⃣,2️⃣,3️⃣,4️⃣,5️⃣,6️⃣,7️⃣,8️⃣,9️⃣,🔟,🔢,#️⃣,*️⃣,▶️,⏸,⏯,⏹,⏺,⏭,⏮,⏩,⏪,⏫,⏬,◀️,🔼,🔽,➡️,⬅️,⬆️,⬇️,↗️,↘️,↙️,↖️,↕️,↔️,↪️,↩️,⤴️,⤵️,🔀,🔁,🔂,🔄,🔃,🎵,🎶,➕,➖,➗,✖️,💲,💱,™️,©️,®️,〰️,➰,➿,🔚,🔙,🔛,🔝,🔜,✔️,☑️,🔘,⚪️,⚫️,🔴,🔵,🔺,🔻,🔸,🔹,🔶,🔷,🔳,🔲,▪️,▫️,◾️,◽️,◼️,◻️,⬛️,⬜️,🔈,🔇,🔉,🔊,🔔,🔕,📣,📢,👁🗨,💬,💭,🗯,♠️,♣️,♥️,♦️,🃏,🎴,🀄️,🕐,🕑,🕒,🕓,🕔,🕕,🕖,🕗,🕘,🕙,🕚,🕛,🕜,🕝,🕞,🕟,🕠,🕡,🕢,🕣,🕤,🕥,🕦,🕧"
|
||||
}
|
||||
},
|
||||
{
|
||||
"CVDataTitle" : "EmojiCategory-Flags",
|
||||
"CVCategoryImage" : "Emoji-FlagsImage",
|
||||
"CVCategoryData" : {
|
||||
"CVSkipNullGlyphs" : false,
|
||||
"Data" : "🏳️,🏴,🏁,🚩,🏳️🌈,🇦🇫,🇦🇽,🇦🇱,🇩🇿,🇦🇸,🇦🇩,🇦🇴,🇦🇮,🇦🇶,🇦🇬,🇦🇷,🇦🇲,🇦🇼,🇦🇺,🇦🇹,🇦🇿,🇧🇸,🇧🇭,🇧🇩,🇧🇧,🇧🇾,🇧🇪,🇧🇿,🇧🇯,🇧🇲,🇧🇹,🇧🇴,🇧🇶,🇧🇦,🇧🇼,🇧🇷,🇮🇴,🇻🇬,🇧🇳,🇧🇬,🇧🇫,🇧🇮,🇨🇻,🇰🇭,🇨🇲,🇨🇦,🇮🇨,🇰🇾,🇨🇫,🇹🇩,🇨🇱,🇨🇳,🇨🇽,🇨🇨,🇨🇴,🇰🇲,🇨🇬,🇨🇩,🇨🇰,🇨🇷,🇨🇮,🇭🇷,🇨🇺,🇨🇼,🇨🇾,🇨🇿,🇩🇰,🇩🇯,🇩🇲,🇩🇴,🇪🇨,🇪🇬,🇸🇻,🇬🇶,🇪🇷,🇪🇪,🇪🇹,🇪🇺,🇫🇰,🇫🇴,🇫🇯,🇫🇮,🇫🇷,🇬🇫,🇵🇫,🇹🇫,🇬🇦,🇬🇲,🇬🇪,🇩🇪,🇬🇭,🇬🇮,🇬🇷,🇬🇱,🇬🇩,🇬🇵,🇬🇺,🇬🇹,🇬🇬,🇬🇳,🇬🇼,🇬🇾,🇭🇹,🇭🇳,🇭🇰,🇭🇺,🇮🇸,🇮🇳,🇮🇩,🇮🇷,🇮🇶,🇮🇪,🇮🇲,🇮🇱,🇮🇹,🇯🇲,🇯🇵,🎌,🇯🇪,🇯🇴,🇰🇿,🇰🇪,🇰🇮,🇽🇰,🇰🇼,🇰🇬,🇱🇦,🇱🇻,🇱🇧,🇱🇸,🇱🇷,🇱🇾,🇱🇮,🇱🇹,🇱🇺,🇲🇴,🇲🇰,🇲🇬,🇲🇼,🇲🇾,🇲🇻,🇲🇱,🇲🇹,🇲🇭,🇲🇶,🇲🇷,🇲🇺,🇾🇹,🇲🇽,🇫🇲,🇲🇩,🇲🇨,🇲🇳,🇲🇪,🇲🇸,🇲🇦,🇲🇿,🇲🇲,🇳🇦,🇳🇷,🇳🇵,🇳🇱,🇳🇨,🇳🇿,🇳🇮,🇳🇪,🇳🇬,🇳🇺,🇳🇫,🇲🇵,🇰🇵,🇳🇴,🇴🇲,🇵🇰,🇵🇼,🇵🇸,🇵🇦,🇵🇬,🇵🇾,🇵🇪,🇵🇭,🇵🇳,🇵🇱,🇵🇹,🇵🇷,🇶🇦,🇷🇪,🇷🇴,🇷🇺,🇷🇼,🇧🇱,🇸🇭,🇰🇳,🇱🇨,🇵🇲,🇻🇨,🇼🇸,🇸🇲,🇸🇹,🇸🇦,🇸🇳,🇷🇸,🇸🇨,🇸🇱,🇸🇬,🇸🇽,🇸🇰,🇸🇮,🇸🇧,🇸🇴,🇿🇦,🇬🇸,🇰🇷,🇸🇸,🇪🇸,🇱🇰,🇸🇩,🇸🇷,🇸🇿,🇸🇪,🇨🇭,🇸🇾,🇹🇼,🇹🇯,🇹🇿,🇹🇭,🇹🇱,🇹🇬,🇹🇰,🇹🇴,🇹🇹,🇹🇳,🇹🇷,🇹🇲,🇹🇨,🇹🇻,🇺🇬,🇺🇦,🇦🇪,🇬🇧,🇺🇸,🇻🇮,🇺🇾,🇺🇿,🇻🇺,🇻🇦,🇻🇪,🇻🇳,🇼🇫,🇪🇭,🇾🇪,🇿🇲,🇿🇼"
|
||||
"CVSkipNullGlyphs" : true,
|
||||
"Data" : "1️⃣,2️⃣,3️⃣,4️⃣,5️⃣,6️⃣,7️⃣,8️⃣,9️⃣,0️⃣,🔟,🔢,#️⃣,🔣,⬆️,⬇️,⬅️,➡️,🔠,🔡,🔤,↗️,↖️,↘️,↙️,↔️,↕️,🔄,◀️,▶️,🔼,🔽,↩️,↪️,ℹ️,⏪,⏩,⏫,⏬,⤵️,⤴️,🆗,🔀,🔁,🔂,🆕,🆙,🆒,🆓,🆖,📶,🎦,🈁,🈯️,🈳,🈵,🈴,🈲,🉐,🈹,🈺,🈶,🈚️,🚻,🚹,🚺,🚼,🚾,🚰,🚮,🅿️,♿️,🚭,🈷,🈸,🈂,Ⓜ️,🛂,🛄,🛅,🛃,🉑,㊙️,㊗️,🆑,🆘,🆔,🚫,🔞,📵,🚯,🚱,🚳,🚷,🚸,⛔️,✳️,❇️,❎,✅,✴️,💟,🆚,📳,📴,🅰,🅱,🆎,🅾,💠,➿,♻️,♈️,♉️,♊️,♋️,♌️,♍️,♎️,♏️,♐️,♑️,♒️,♓️,⛎,🔯,🏧,💹,💲,💱,©,®,™,❌,‼️,⁉️,❗️,❓,❕,❔,⭕️,🔝,🔚,🔙,🔛,🔜,🔃,🕛,🕧,🕐,🕜,🕑,🕝,🕒,🕞,🕓,🕟,🕔,🕠,🕕,🕖,🕗,🕘,🕙,🕚,🕡,🕢,🕣,🕤,🕥,🕦,✖️,➕,➖,➗,♠️,♥️,♣️,♦️,💮,💯,✔️,☑️,🔘,🔗,➰,〰,〽️,🔱,◼️,◻️,◾️,◽️,▪️,▫️,🔺,🔲,🔳,⚫️,⚪️,🔴,🔵,🔻,⬜️,⬛️,🔶,🔷,🔸,🔹"
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
set jsCode to "document.getElementById('output').value"
|
||||
set json to missing value
|
||||
|
||||
tell application "Safari"
|
||||
repeat
|
||||
set json to (do JavaScript jsCode in current tab of window 1)
|
||||
if (json is not missing value) then exit repeat
|
||||
delay 0.5
|
||||
end repeat
|
||||
close current tab of window 1
|
||||
end tell
|
||||
|
||||
return json
|
||||
103
db/aliases.html
@@ -11,76 +11,77 @@
|
||||
<textarea id="output" rows="50" cols="80"></textarea>
|
||||
|
||||
<script>
|
||||
const VARIATION_SELECTOR_16 = /\ufe0f$/
|
||||
const VARIATION_SELECTOR_15 = String.fromCharCode(0xfe0e);
|
||||
const VARIATION_SELECTOR_16 = String.fromCharCode(0xfe0f);
|
||||
|
||||
function detectAliases(db) {
|
||||
const canvas = document.createElement('canvas')
|
||||
for (var i = 0; i < db.length; ++i) {
|
||||
var emoji = db[i];
|
||||
var raw = emoji.emoji;
|
||||
if (!raw) {
|
||||
continue;
|
||||
}
|
||||
|
||||
for (const emoji of db) {
|
||||
const raw = emoji.emoji
|
||||
if (!raw) continue
|
||||
var candidates = [];
|
||||
|
||||
const candidates = [raw]
|
||||
if (VARIATION_SELECTOR_16.test(raw)) {
|
||||
candidates.unshift(raw.replace(VARIATION_SELECTOR_16, ''))
|
||||
if (raw.length === 1) {
|
||||
candidates.push(raw + VARIATION_SELECTOR_15);
|
||||
candidates.push(raw + VARIATION_SELECTOR_16);
|
||||
} else if (raw[raw.length - 1] === VARIATION_SELECTOR_16) {
|
||||
var base = raw.substr(0, raw.length - 1);
|
||||
candidates.push(base);
|
||||
candidates.push(base + VARIATION_SELECTOR_15);
|
||||
}
|
||||
|
||||
var aliases = candidates.filter(isColorEmoji);
|
||||
if (aliases.length) {
|
||||
emoji.unicodes = aliases;
|
||||
} else {
|
||||
candidates.push(`${raw}\u{fe0f}`)
|
||||
}
|
||||
|
||||
const newRaw = candidates.filter(e => detectEmoji(canvas, e))[0]
|
||||
|
||||
if (newRaw && newRaw != raw) {
|
||||
emoji.emoji = newRaw
|
||||
console.info('new raw representation found for %s :%s:', raw, emoji.aliases[0])
|
||||
}
|
||||
if (!newRaw) {
|
||||
console.warn('no raw representation for %s :%s:', raw, emoji.aliases[0])
|
||||
delete emoji.unicodes;
|
||||
}
|
||||
}
|
||||
|
||||
dump(db)
|
||||
dump(db);
|
||||
}
|
||||
|
||||
function detectEmoji(canvas, emoji) {
|
||||
const context = canvas.getContext('2d')
|
||||
drawEmoji(context, emoji)
|
||||
function isColorEmoji(candidate) {
|
||||
// Draw the emoji twice using a different color each time. If the emoji
|
||||
// draws as the same color regardless of what color we set, it's a color
|
||||
// emoji.
|
||||
return color(candidate, "#f00") === color(candidate, "#0f0");
|
||||
}
|
||||
|
||||
let supported = false
|
||||
const data = context.getImageData(0, 16, 64, 1).data
|
||||
|
||||
for (let x = 0; x <= 64; x++) {
|
||||
if (x <= 32) {
|
||||
// character is supported if there are any colored pixels found
|
||||
if (data[4*x] || data[4*x + 1] || data[4*x + 2]) supported = true
|
||||
} else if (x >= 48 && data[4*x + 3] > 0) {
|
||||
// however, if more than one character got rendered, treat as unsupported
|
||||
supported = false
|
||||
break
|
||||
var canvas = document.createElement("canvas");
|
||||
function color(emoji, rgb) {
|
||||
var context = canvas.getContext("2d");
|
||||
context.clearRect(0, 0, 32, 32);
|
||||
context.fillStyle = rgb;
|
||||
context.textBaseline = "top";
|
||||
context.font = "32px Arial";
|
||||
context.fillText(emoji, 0, 0);
|
||||
var data = context.getImageData(0, 0, 32, 32).data;
|
||||
for (var i = 0; i < data.length; i += 4) {
|
||||
if (data[i] === 0 && data[i + 1] === 0 && data[i + 2] === 0) {
|
||||
continue;
|
||||
}
|
||||
return data[i].toString(16)
|
||||
+ data[i + 1].toString(16)
|
||||
+ data[i + 2].toString(16);
|
||||
}
|
||||
|
||||
return supported
|
||||
}
|
||||
|
||||
function drawEmoji(context, emoji) {
|
||||
context.clearRect(0, 0, 400, 400)
|
||||
context.fillStyle = '#000'
|
||||
context.textBaseline = 'top'
|
||||
context.font = '32px sans-serif, "Apple Color Emoji", "Segoe UI", "Segoe UI Emoji", "Segoe UI Symbol"'
|
||||
context.fillText(emoji+'___', 0, 0)
|
||||
return "no colored pixel found";
|
||||
}
|
||||
|
||||
function dump(db) {
|
||||
var json = JSON.stringify(db, null, ' ')
|
||||
var json = JSON.stringify(db, null, " ")
|
||||
.replace(/^( +)(.+)\[\](,?)$/mg, "$1$2[\n$1]$3")
|
||||
.replace(/,\n( *) /g, "\n$1, ")
|
||||
document.getElementById('output').value = `${json}\n`
|
||||
.replace(/,\n( *) /g, "\n$1, ");
|
||||
document.getElementById("output").value = json + "\n";
|
||||
}
|
||||
|
||||
var xhr = new XMLHttpRequest
|
||||
var xhr = new XMLHttpRequest;
|
||||
xhr.onload = function() {
|
||||
detectAliases(JSON.parse(xhr.responseText))
|
||||
detectAliases(JSON.parse(this.responseText));
|
||||
};
|
||||
xhr.open('GET', 'emoji.json', false)
|
||||
xhr.send(null)
|
||||
xhr.open("GET", "emoji.json", false);
|
||||
xhr.send(null);
|
||||
</script>
|
||||
|
||||
135
db/dump.rb
@@ -1,57 +1,28 @@
|
||||
require 'emoji'
|
||||
require 'json'
|
||||
require 'rexml/document'
|
||||
|
||||
names_list = File.expand_path('../NamesList.txt', __FILE__)
|
||||
|
||||
class UnicodeCharacter
|
||||
attr_reader :code, :description, :version, :aliases
|
||||
attr_reader :code, :description, :aliases
|
||||
|
||||
class CharListener
|
||||
CHAR_TAG = "char".freeze
|
||||
@index = {}
|
||||
class << self
|
||||
attr_reader :index
|
||||
|
||||
def self.parse(io, &block)
|
||||
REXML::Document.parse_stream(io, self.new(&block))
|
||||
def fetch(code, *args, &block)
|
||||
code = code.to_s(16).rjust(4, '0') if code.is_a?(Integer)
|
||||
index.fetch(code, *args, &block)
|
||||
end
|
||||
|
||||
def initialize(&block)
|
||||
@callback = block
|
||||
end
|
||||
|
||||
def tag_start(name, attributes)
|
||||
if CHAR_TAG == name
|
||||
@callback.call(
|
||||
attributes.fetch("cp") { return },
|
||||
attributes.fetch("na") { return },
|
||||
attributes.fetch("age", nil),
|
||||
)
|
||||
end
|
||||
end
|
||||
|
||||
def method_missing(*) end
|
||||
end
|
||||
|
||||
def self.index
|
||||
return @index if defined? @index
|
||||
@index = {}
|
||||
File.open(File.expand_path('../ucd.nounihan.grouped.xml', __FILE__)) do |source|
|
||||
CharListener.parse(source) do |char, desc, age|
|
||||
uc = UnicodeCharacter.new(char, desc, age)
|
||||
@index[uc.code] = uc
|
||||
end
|
||||
end
|
||||
@index
|
||||
end
|
||||
|
||||
def self.fetch(code)
|
||||
code = code.to_s(16).rjust(4, '0') if code.is_a?(Integer)
|
||||
self.index.fetch(code)
|
||||
end
|
||||
|
||||
def initialize(code, description, version)
|
||||
def initialize(code, description)
|
||||
@code = code.downcase
|
||||
@description = description.downcase
|
||||
@version = version
|
||||
@aliases = []
|
||||
@references = []
|
||||
|
||||
self.class.index[@code] = self
|
||||
end
|
||||
|
||||
def add_alias(string)
|
||||
@@ -63,74 +34,44 @@ class UnicodeCharacter
|
||||
end
|
||||
end
|
||||
|
||||
unless $stdin.tty?
|
||||
codepoints = STDIN.read.chomp.codepoints.map { |code|
|
||||
UnicodeCharacter.fetch(code)
|
||||
}
|
||||
codepoints.each do |char|
|
||||
printf "%5s: %s", char.code.upcase, char.description
|
||||
printf " (%s)", char.version if char.version
|
||||
puts
|
||||
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
|
||||
exit
|
||||
end
|
||||
|
||||
trap(:PIPE) { abort }
|
||||
|
||||
normalize = -> (raw) {
|
||||
raw.sub(Emoji::VARIATION_SELECTOR_16, '')
|
||||
}
|
||||
|
||||
emojidesc = {}
|
||||
File.open(File.expand_path('../emoji-test.txt', __FILE__)) do |file|
|
||||
file.each do |line|
|
||||
next if line =~ /^(#|$)/
|
||||
line = line.chomp.split('# ', 2)[1]
|
||||
emoji, description = line.split(' ', 2)
|
||||
emojidesc[normalize.(emoji)] = description
|
||||
end
|
||||
end
|
||||
|
||||
items = []
|
||||
variation = "\u{fe0f}".freeze
|
||||
|
||||
for category, emojis in Emoji.apple_palette
|
||||
for raw in emojis
|
||||
emoji = Emoji.find_by_unicode(raw)
|
||||
unicode_version = emoji ? emoji.unicode_version : ''
|
||||
ios_version = emoji ? emoji.ios_version : ''
|
||||
|
||||
unless raw.include?(Emoji::ZERO_WIDTH_JOINER)
|
||||
uchar = UnicodeCharacter.fetch(raw.codepoints[0])
|
||||
unicode_version = uchar.version unless uchar.version.nil?
|
||||
end
|
||||
for emoji in Emoji.all
|
||||
unicodes = emoji.unicode_aliases.dup
|
||||
|
||||
description = emojidesc.fetch(normalize.(raw))
|
||||
item = {}
|
||||
|
||||
if unicode_version == ''
|
||||
warn "#{description} (#{raw}) doesn't have Unicode version"
|
||||
end
|
||||
|
||||
if ios_version == ''
|
||||
ios_version = '10.2'
|
||||
end
|
||||
|
||||
items << {
|
||||
emoji: raw,
|
||||
description: description,
|
||||
category: category,
|
||||
aliases: emoji ? emoji.aliases : [description.gsub(/\W+/, '_').downcase],
|
||||
tags: emoji ? emoji.tags : [],
|
||||
unicode_version: unicode_version,
|
||||
ios_version: ios_version,
|
||||
}
|
||||
unless emoji.custom?
|
||||
variation_codepoint = variation.codepoints[0]
|
||||
chars = emoji.raw.codepoints.map { |code| UnicodeCharacter.fetch(code) unless code == variation_codepoint }.compact
|
||||
item[:emoji] = unicodes.shift
|
||||
item[:unicodes] = unicodes if unicodes.any?
|
||||
item[:description] = chars.map(&:description).join(' + ')
|
||||
end
|
||||
end
|
||||
|
||||
for emoji in Emoji.all.select(&:custom?)
|
||||
items << {
|
||||
aliases: emoji.aliases,
|
||||
tags: emoji.tags,
|
||||
}
|
||||
item[:aliases] = emoji.aliases
|
||||
item[:tags] = emoji.tags
|
||||
|
||||
items << item
|
||||
end
|
||||
|
||||
puts JSON.pretty_generate(items)
|
||||
|
||||
23691
db/emoji.json
@@ -66,7 +66,7 @@ li > span {
|
||||
if (emoji.emoji) els[0].textContent = emoji.emoji
|
||||
else {
|
||||
var img = document.createElement('img')
|
||||
img.src = "../images/" + emoji.aliases[0] + ".png"
|
||||
img.src = "../images/emoji/" + emoji.aliases[0] + ".png"
|
||||
els[0].appendChild(img)
|
||||
}
|
||||
els[1].textContent = emoji.description || ''
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
Gem::Specification.new do |s|
|
||||
s.name = "gemoji"
|
||||
s.version = "3.0.1"
|
||||
s.summary = "Emoji library"
|
||||
s.description = "Character information and metadata for standard and custom emoji."
|
||||
s.executables = ["gemoji"]
|
||||
s.version = "2.0.1"
|
||||
s.summary = "Emoji conversion and image assets"
|
||||
s.description = "Image assets and character information for emoji."
|
||||
|
||||
s.required_ruby_version = '> 1.9'
|
||||
|
||||
@@ -14,10 +13,9 @@ Gem::Specification.new do |s|
|
||||
|
||||
s.files = Dir[
|
||||
"README.md",
|
||||
"bin/gemoji",
|
||||
"images/*.png",
|
||||
"db/Category-Emoji.json",
|
||||
"images/**/*.png",
|
||||
"db/emoji.json",
|
||||
"lib/**/*.rb",
|
||||
"lib/tasks/*.rake"
|
||||
]
|
||||
end
|
||||
|
||||
|
Before Width: | Height: | Size: 898 B |
|
Before Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 2.7 KiB |
BIN
images/emoji/bowtie.png
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
images/emoji/feelsgood.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
images/emoji/finnadie.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
images/emoji/fu.png
Normal file
|
After Width: | Height: | Size: 4.6 KiB |
BIN
images/emoji/goberserk.png
Normal file
|
After Width: | Height: | Size: 1.3 KiB |
BIN
images/emoji/godmode.png
Normal file
|
After Width: | Height: | Size: 1.0 KiB |
BIN
images/emoji/hurtrealbad.png
Normal file
|
After Width: | Height: | Size: 1.4 KiB |
BIN
images/emoji/metal.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
images/emoji/neckbeard.png
Normal file
|
After Width: | Height: | Size: 6.3 KiB |
BIN
images/emoji/octocat.png
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
BIN
images/emoji/rage1.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
images/emoji/rage2.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
images/emoji/rage3.png
Normal file
|
After Width: | Height: | Size: 1.1 KiB |
BIN
images/emoji/rage4.png
Normal file
|
After Width: | Height: | Size: 1.2 KiB |
BIN
images/emoji/shipit.png
Normal file
|
After Width: | Height: | Size: 9.1 KiB |
BIN
images/emoji/suspect.png
Normal file
|
After Width: | Height: | Size: 1016 B |
BIN
images/emoji/trollface.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
images/emoji/unicode/0023-fe0f-20e3.png
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
BIN
images/emoji/unicode/0030-fe0f-20e3.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
images/emoji/unicode/0031-fe0f-20e3.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
images/emoji/unicode/0032-fe0f-20e3.png
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
images/emoji/unicode/0033-fe0f-20e3.png
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
BIN
images/emoji/unicode/0034-fe0f-20e3.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
images/emoji/unicode/0035-fe0f-20e3.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
images/emoji/unicode/0036-fe0f-20e3.png
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
BIN
images/emoji/unicode/0037-fe0f-20e3.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
images/emoji/unicode/0038-fe0f-20e3.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
images/emoji/unicode/0039-fe0f-20e3.png
Normal file
|
After Width: | Height: | Size: 3.7 KiB |
BIN
images/emoji/unicode/00a9.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
images/emoji/unicode/00ae.png
Normal file
|
After Width: | Height: | Size: 1.6 KiB |
BIN
images/emoji/unicode/1f004-fe0f.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
images/emoji/unicode/1f0cf.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
images/emoji/unicode/1f170.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
images/emoji/unicode/1f171.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
images/emoji/unicode/1f17e.png
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
images/emoji/unicode/1f17f-fe0f.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
images/emoji/unicode/1f18e.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
images/emoji/unicode/1f191.png
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
images/emoji/unicode/1f192.png
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
BIN
images/emoji/unicode/1f193.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
images/emoji/unicode/1f194.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
images/emoji/unicode/1f195.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
images/emoji/unicode/1f196.png
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
BIN
images/emoji/unicode/1f197.png
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
BIN
images/emoji/unicode/1f198.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
images/emoji/unicode/1f199.png
Normal file
|
After Width: | Height: | Size: 3.6 KiB |
BIN
images/emoji/unicode/1f19a.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
images/emoji/unicode/1f1e8-1f1f3.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
images/emoji/unicode/1f1e9-1f1ea.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
images/emoji/unicode/1f1ea-1f1f8.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
images/emoji/unicode/1f1eb-1f1f7.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
images/emoji/unicode/1f1ec-1f1e7.png
Normal file
|
After Width: | Height: | Size: 5.8 KiB |
BIN
images/emoji/unicode/1f1ee-1f1f9.png
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
images/emoji/unicode/1f1ef-1f1f5.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
images/emoji/unicode/1f1f0-1f1f7.png
Normal file
|
After Width: | Height: | Size: 5.0 KiB |
BIN
images/emoji/unicode/1f1f7-1f1fa.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
images/emoji/unicode/1f1fa-1f1f8.png
Normal file
|
After Width: | Height: | Size: 6.1 KiB |
BIN
images/emoji/unicode/1f201.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
images/emoji/unicode/1f202.png
Normal file
|
After Width: | Height: | Size: 3.5 KiB |
BIN
images/emoji/unicode/1f21a-fe0f.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
images/emoji/unicode/1f22f-fe0f.png
Normal file
|
After Width: | Height: | Size: 4.0 KiB |
BIN
images/emoji/unicode/1f232.png
Normal file
|
After Width: | Height: | Size: 5.1 KiB |
BIN
images/emoji/unicode/1f233.png
Normal file
|
After Width: | Height: | Size: 4.1 KiB |
BIN
images/emoji/unicode/1f234.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
images/emoji/unicode/1f235.png
Normal file
|
After Width: | Height: | Size: 4.3 KiB |
BIN
images/emoji/unicode/1f236.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
images/emoji/unicode/1f237.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
images/emoji/unicode/1f238.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
images/emoji/unicode/1f239.png
Normal file
|
After Width: | Height: | Size: 4.4 KiB |
BIN
images/emoji/unicode/1f23a.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
images/emoji/unicode/1f250.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
images/emoji/unicode/1f251.png
Normal file
|
After Width: | Height: | Size: 4.6 KiB |
BIN
images/emoji/unicode/1f300.png
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
images/emoji/unicode/1f301.png
Normal file
|
After Width: | Height: | Size: 4.5 KiB |
BIN
images/emoji/unicode/1f302.png
Normal file
|
After Width: | Height: | Size: 3.9 KiB |
BIN
images/emoji/unicode/1f303.png
Normal file
|
After Width: | Height: | Size: 4.8 KiB |
BIN
images/emoji/unicode/1f304.png
Normal file
|
After Width: | Height: | Size: 6.4 KiB |
BIN
images/emoji/unicode/1f305.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
images/emoji/unicode/1f306.png
Normal file
|
After Width: | Height: | Size: 3.8 KiB |
BIN
images/emoji/unicode/1f307.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |