Compare commits

...

239 Commits

Author SHA1 Message Date
Mislav Marohnić
09f66fc38a gemoji 3.0.0.rc2 2016-12-20 17:36:21 +01:00
Mislav Marohnić
342b76f06e Merge branch 'ios-10.2' 2016-12-20 17:34:49 +01:00
Mislav Marohnić
6b556ba8b2 Update integrity test
These images are finally no longer identical.
2016-12-20 17:34:00 +01:00
Mislav Marohnić
74a321c07a Fix filling in emoji that historically had default gender
Now in iOS 10.2 there are gendered emoji that don't have a default
genderless unicode variant.
2016-12-20 17:34:00 +01:00
Mislav Marohnić
7e10d1a38a Change egg in a pan to "fried_egg" since "egg" is now an emoji 2016-12-20 17:34:00 +01:00
Mislav Marohnić
8ff20db97f Add new iOS 10.2 emoji 2016-12-20 17:34:00 +01:00
Mislav Marohnić
492e18f849 Reorder existing emoji according to iOS 10.2 palette 2016-12-20 17:34:00 +01:00
Mislav Marohnić
cf852befd9 Improve dump script for new emoji 2016-12-20 17:33:52 +01:00
Mislav Marohnić
9d313238bd Remove Gemfile.lock from version control
I don't like that Bundler now makes Gemfile.lock change whenever I bump
up gemoji version. There aren't many dependencies, so a missing
Gemfile.lock won't slow down CI too much.
2016-12-20 15:15:28 +01:00
Alexander Kotov
840655ad6b Fix NoMethodError in multithreading
Fixes #109, closes #111
2016-12-20 15:13:35 +01:00
Mislav Marohnić
f394c85d80 Fix Gemfile.lock 2016-09-30 13:18:43 -04:00
Mislav Marohnić
42a606c804 Merge pull request #99 from mikeastock/fix-sierra-typo
Fix typo in README of Sierra
2016-09-30 08:17:27 -09:00
Michael Stock
21c4cfe247 Fix typo in README of Sierra 2016-09-29 23:14:17 -07:00
Mislav Marohnić
31a6c8b97b gemoji 3.0.0.rc1 2016-09-29 17:48:13 -04:00
Mislav Marohnić
36d295f2b7 There are no more Apple images included in the project
References #61
2016-09-29 17:21:16 -04:00
Mislav Marohnić
d3b9f412c9 Merge branch 'ios-10'
Closes #96, closes #93, closes #77, closes #61

References #72
2016-09-29 17:11:06 -04:00
Mislav Marohnić
a71ba68b6d Expose extra Emoji::Character metadata fields
`category`, `description`, `ios_version`, `unicode_version`
2016-09-29 17:04:39 -04:00
Mislav Marohnić
380fd48cfd Skip image integrity tests on non-macOS platforms
Only run integrity tests if the local `images/unicode` directory exists.
2016-09-29 16:50:19 -04:00
Mislav Marohnić
1e485abfe0 images/emoji/*.pngimages/*.png 2016-09-29 16:50:19 -04:00
Mislav Marohnić
537ccc48ed Replace rake emoji task with a new gemoji executable
The availability of `gemoji extract` command allows easy extraction of
emoji assets into non-Rails applications.
2016-09-29 16:50:19 -04:00
Mislav Marohnić
9cf53bf513 Strip zero-width joiner from Emoji::Character#image_filename 2016-09-29 15:41:51 -04:00
Mislav Marohnić
0e72fb70cc Improve test for invalid or duplicate aliases 2016-09-29 15:41:51 -04:00
Mislav Marohnić
8db519ecbe Add unicode alias for emoji that has implicit gender
Some emoji have gendered variants, but their default rendering (when
they don't include a gender symbol) is using a specific gender for
historic reasons. Ensure that these emoji contain a representation with
explicit gender symbol in their `unicode_aliases`.

Example: ensures that "sleuth or spy" (1F575) is also found as:

    1F575: sleuth or spy
     FE0F: variation selector-16
     200D: zero width joiner
     2642: male sign
     FE0F: variation selector-16
2016-09-29 15:41:51 -04:00
Mislav Marohnić
d0d9227065 Finalize new extractor script mapping glyphs to emoji 2016-09-29 15:41:51 -04:00
Mislav Marohnić
72e9749225 Fix images extractor for macOS Sierra
The TTFunk dependency didn't have support for parsing `ttc` files. Now
parsing is done manually and there is no dependencies.
2016-09-29 15:39:45 -04:00
Mislav Marohnić
16c7e21e5e Remove images extracted from Apple Color Emoji font
These won't ship with the library anymore. Instead, the library ships
with a script that extracts these from macOS Sierra.
2016-09-29 15:39:45 -04:00
Mislav Marohnić
cb3ab19847 Provide public API for Apple's character palette data 2016-09-29 15:39:44 -04:00
Mislav Marohnić
9ffd0e63aa Import emoji up to and including iOS 10 2016-09-29 15:39:44 -04:00
Mislav Marohnić
50865e8895 Merge pull request #86 from marconilanna/patch-1
🍊 tangerine aliases: orange and mandarin
2016-02-26 15:58:37 +09:00
Mislav Marohnić
a76d5f02f4 Try Ruby "2.3.0" instead of just "2.3"
https://travis-ci.org/github/gemoji/jobs/111940056
2016-02-26 15:54:30 +09:00
Mislav Marohnić
be21932d23 Run on new Travis infrastructure 2016-02-26 15:51:35 +09:00
Mislav Marohnić
ee403f0b7d Test against Ruby 2.3.x in CI 2016-02-05 14:52:43 +11:00
Mislav Marohnić
75d8b4374b Tweak script/bootstrap 2016-02-05 14:52:21 +11:00
Marconi Lanna
6de1de2fa1 🍊 tangerine aliases: orange and mandarin
Reference: http://emojipedia.org/tangerine/

> Also Known As
>
> Mandarin Emoji
> Orange Emoji
2016-02-04 09:01:31 -05:00
Mislav Marohnić
be21f6efc6 Merge pull request #82 from github/alias_ng_woman_for_no_good
consistency with 🙆‍♀️
2015-11-13 20:13:20 -05:00
Jason Salaz
f21379209f consistency with 🙆‍♀️ 2015-10-29 20:46:41 -06:00
Mislav Marohnić
b84bf23a5b Merge pull request #81 from jeffmcneill/master
Add "pout" as an alias to the "pouting face" emoji
2015-10-05 14:30:01 +02:00
Jeff McNeill
b05ddab3b9 Merge pull request #1 from jeffmcneill/jeffmcneill-patch-1
Add "pout" as an alias to the "pouting face" emoji
2015-10-05 18:37:21 +07:00
Jeff McNeill
365c7a184c Add "pout" as an alias to the "pouting face" emoji
The use of the term "rage" is not the same semantically, though the Apple implementation of "pouting face" is essentially the "angry face" plus color red. However, other implementations have more "pouting"-like visages, and so use of "pout" would be helpful.
2015-10-05 18:36:58 +07:00
Mislav Marohnić
3db7811891 Merge pull request #79 from gavingmiller/master
Escape mkdir paths for rake emoji task
2015-08-03 14:22:35 -07:00
Gavin Miller
22e198644d Escape mkdir paths for rake emoji task
In the event that someone tries to copy the gemoji emoji's into their
project using the rake emoji task, if that person has braces ( or ) in
the path, the task will fail. Example of error:

sh: -c: line 0: syntax error near unexpected token `('
sh: -c: line 0: `mkdir -p /Users/gmiller/Dropbox (Personal)/projects/gavinmiller.io/public/images &&
  cp -Rp /Users/gmiller/.rbenv/versions/2.0.0-p598/lib/ruby/gems/2.0.0/gems/gemoji-2.1.0/images/emoji
  /Users/gmiller/Dropbox (Personal)/projects/gavinmiller.io/public/images'

By escaping the paths in the rake task, this problem no longer occurs.
2015-08-03 12:10:09 -06:00
Mislav Marohnić
677084b5ed Merge pull request #78 from mixmaxhq/jeff/fix_skin_tone_emoji
Fix image filename lookups for default emoji.
2015-07-21 12:31:18 -07:00
Jeff Wear
859778cc4b Fix image filename lookups for default emoji.
"Default emoji" == emoji that can be modified with skin tone modifiers.
2015-07-21 12:03:30 -07:00
Brandon Keepers
a8204fd8d3 Merge pull request #76 from github/code-of-conduct
Add code of conduct to contributing guidelines
2015-07-20 10:02:26 -07:00
Brandon Keepers
694f862f73 Add code of conduct to contributing guidelines 2015-07-08 14:19:45 -04:00
Mislav Marohnić
11b4f69f5a Merge pull request #68 from github/taco
🌮
2015-02-28 15:02:47 +13:00
Mislav Marohnić
4e6ce27ed6 Merge pull request #69 from janko-m/patch-1
Use image_path instead of asset_path in readme
2015-01-26 15:17:40 -08:00
Janko Marohnić
9308a10b52 Use image_path instead of asset_path in readme
In Rails 4.2 `#asset_path` has changed. Prior to Rails 4.2,
`#asset_path` would search all asset directories, and prepend the
appropriate asset type directory name to the result:

  asset_path("emoji/unicode/<id>.png")
  #=> "/images/emoji/unicode/<id>.png"

However, In Rails 4.2 `#asset_path` doesn't do that anymore, and assumes
that you've specified the correct folder. Since Emoji images are copied
to public/images/emoji/unicode, `#asset_path` would then generate the
wrong URL path:

  asset_path("emoji/unicode/<id>.png")
  #=> "/emoji/unicode/<id>.png"

Using `#image_path` fixes that, because that method looks specifically
for images/ folder, so it will find the Emoji images.
2015-01-26 23:53:48 +01:00
Mislav Marohnić
b841e20394 Merge pull request #67 from elektronaut/add-gif-support
Add support for non-PNG assets
2014-12-12 13:53:39 -08:00
Inge Jørgensen
ac3620cf89 Make image_filename customizable 2014-12-12 22:31:34 +01:00
Mislav Marohnić
60a473bfe5 🌮
http://www.glitchthegame.com/items/food/cold-taco/

Released under the public domain: http://www.glitchthegame.com/licensing/
2014-12-11 23:01:13 -08:00
Joshua Peek
df1b6fac6e Merge pull request #66 from asianmack/basecamp
Add emoji for :basecamp: and :basecampy:
2014-11-06 12:36:50 -08:00
Jamie Dihiansan
eda537e1a9 Add :basecamp: and :basecampy: to emoji.json 2014-11-06 12:49:49 -06:00
Jamie Dihiansan
9967b2ef28 Add emoji for :basecamp: and :basecampy: 2014-11-06 12:25:44 -06:00
Javan Makhmali
d41a53d459 Merge pull request #65 from tricknotes/ruby-2.2
Test against Ruby 2.2 on Travis CI
2014-10-23 09:44:44 -05:00
Ryunosuke SATO
06a2df3427 Test against Ruby 2.2 on Travis CI 2014-10-21 00:21:16 +09:00
Mislav Marohnić
757584d2b9 Merge pull request #63 from github/extractor
Extract PNG images from Apple's "Apple Color Emoji.ttf" font
2014-10-16 15:50:52 +02:00
Mislav Marohnić
f5092b7aa4 Tweak extractor.rb code style 2014-10-16 13:06:20 +02:00
Mislav Marohnić
8a9a8572aa Run the rest of the PNGs through ImageOptim
Command used:

    $ imageOptim -a -d images/emoji/
2014-09-25 10:19:41 -07:00
Mislav Marohnić
3d35b9f862 Simplify special case for "black_medium_square" in checksum test 2014-09-25 10:19:41 -07:00
Javan Makhmali
5dea160045 Update test for expected identical emoji checksums 2014-09-25 10:19:41 -07:00
Javan Makhmali
6984758915 Extract and optimize PNGs from "Apple Color Emoji.ttf"
Commands used:

    $ rake images:extract
    $ imageOptim -a -d images/emoji/unicode/

This required both ImageOptim and ImageAlpha to be installed as OS X apps.
2014-09-25 10:17:30 -07:00
Javan Makhmali
29c25127d0 Automate extracting PNG images from "Apple Color Emoji.ttf" 2014-09-25 10:17:29 -07:00
Mislav Marohnić
701f434b60 gemoji 2.1.0 2014-08-06 17:56:17 -07:00
Mislav Marohnić
112cc8fb8b Replace MAINTAINING with CONTRIBUTING 2014-08-06 17:54:19 -07:00
Mislav Marohnić
5162959546 Refactor test to remove Ruby syntax warning 2014-08-06 17:38:26 -07:00
Mislav Marohnić
75ada7cc89 Merge pull request #60 from github/resolve-unicode-aliases
Resolve the emoji.json "unicodes" mess
2014-08-06 17:24:48 -07:00
Mislav Marohnić
0bb789e3e6 Convert applescript to plain text format
So that it's readable and diffable from the web interface

[ci skip]
2014-08-06 07:51:55 -07:00
Mislav Marohnić
9beb9c0172 Remove need for explicit "unicodes" aliases in emoji.json
We now operate on a new set of assumptions:

- Characters with VARIATION_SELECTOR_15 shouldn't render as emoji, even
  if OS X doesn't respect that currently. This removes explicit aliases
  that include VARIATION_SELECTOR_15.

- VARIATION_SELECTOR_16 is optional for most characters to render as
  emoji on OS X. For those that *don't* have it optional, we include
  VARIATION_SELECTOR_16 in their raw representation in `emoji.json`.
  Other characters list their form including VARIATION_SELECTOR_16
  implicitly in `unicode_aliases`.

- For emoji that consist of 2 characters + variation selector, we assume
  that the selector can come between the 2 characters or *after* them,
  so `find_by_unicode` now supports both forms.

- The `db/aliases.html` script ensures that `emoji.json` only contains
  characters that Safari on OS X actually renders as emojis.
2014-08-06 00:08:47 -07:00
Mislav Marohnić
ea70c98946 Only create canvas elements of just the size required to create an emoji
Otherwise canvas element defaults to a larger size.
2014-08-06 00:08:47 -07:00
Mislav Marohnić
7d416739ba Merge pull request #59 from github/script-tools
Add useful tools to `script/*`
2014-08-06 00:08:11 -07:00
Mislav Marohnić
96295d7871 Add script/release 2014-08-05 23:51:22 -07:00
Mislav Marohnić
584939127e Add script/regenerate to rebuild db/emoji.json database
Uses AppleScript to open Safari and filter the emojis by whether they
render as actual emoji on OS X or not.
2014-08-05 23:25:35 -07:00
Mislav Marohnić
680d1bc59b Add script/console for experimentation from Ruby 2014-08-05 23:08:01 -07:00
Mislav Marohnić
2c58377420 Configure Travis CI to use script/test 2014-08-05 23:07:39 -07:00
Mislav Marohnić
3bb3cea8d3 Add script/bootstrap & script/test 2014-08-05 23:06:52 -07:00
Mislav Marohnić
5e6dcae949 Merge pull request #58 from github/plain-copyright
Don't treat plain "(c)" symbol or similar as emoji
2014-08-05 22:29:50 -07:00
Mislav Marohnić
2aaf9693a9 Ruby 1.9 compat in tests 2014-08-05 22:27:01 -07:00
Mislav Marohnić
0d1a82dc6a Don't treat plain "(c)" symbol or similar as emoji
Unless these characters are followed by VARIATION SELECTOR-16, which
indicates that the should be rendered as emoji, OS X renders these
characters using plain font glyphs.

Previously we assumed that the emoji list we get from
`Category-Emoji.json` (OS X emoji character picker) are all valid emoji,
but for some reason some plain Unicode characters are included in there
without being suffixed with VARIATION SELECTOR-16.
2014-08-05 22:16:54 -07:00
Mislav Marohnić
6b9cdd6eb5 Rename PNGs on disk to not contain VARIATION_SELECTOR_16
Even if the emoji contains it, the filename on disk doesn't have to.
This will reduce having to keep renaming PNGs on disk while we tweak the
emoji database in the future in regard to which are required to have
VARIATION_SELECTOR_16 and which are not.
2014-08-05 22:16:27 -07:00
Mislav Marohnić
75f837e6b5 Improve failure message for images on disk test 2014-08-05 22:16:27 -07:00
Mislav Marohnić
c2286e7c5b Fix failure message in tests
This got broken by Emoji::Character API change in
3935375ca8
2014-08-05 20:29:17 -07:00
Adam Roben
3e21d95409 Merge pull request #56 from github/match-osx-behavior
Use the same unicode aliases as Safari 7.0.5 on OS X 10.9.4
2014-08-01 23:06:51 -04:00
Adam Roben
a86999a7f1 Fix tests 2014-08-01 14:11:13 -04:00
Adam Roben
b7c2b8e4d8 Remove incorrect unicode aliases
db/aliases.html now clears out any incorrect aliases it finds.
2014-08-01 13:56:38 -04:00
Adam Roben
1212951bc6 Use the same unicode aliases as Safari 7.0.5 on OS X 10.9.4
Category-Emoji.json contains many code point sequences ending in U+FE0F
VARIATION SELECTOR-16. OS X renders some of these code point sequences
as color emoji even if you strip off VARIATION SELECTOR-16. (And in fact
it even renders some of them as color emoji if you replace VARIATION
SELECTOR-16 with VARIATION SELECTOR-15, even though that is explicitly
requesting a "text" variant of the character).

We used to assume that VARIATION SELECTOR-16 was optional for all emoji.
But this doesn't match OS X's behavior. This could cause problems, e.g.,
if you were to use the unicode_aliases property to detect Unicode emoji
and replace them with images for browsers that don't support emoji
natively.

The Ruby code no longer does anything special with VARIATION SELECTOR-16
other than to remove it from the description of each emoji. The new
db/aliases.html file can be used to determine which the correct Unicode
aliases for each emoji are. That page takes each emoji, generates a set
of variants using VARIATION SELECTOR-16 and VARIATION SELECTOR-15,
and renders each variant into a <canvas> element twice: once with a red
font color, and once with a green font color. If the variant renders the
same way, the OS is rendering the variant as a color emoji, and we add
it to the "unicodes" array for that emoji.

So the new process for generating db/emoji.json is:

1. rake db:dump > tmp
2. mv tmp db/emoji.json
3. open -a Safari db/aliases.html
4. Copy the resulting JSON from Safari
5. pbpaste > db/emoji.json

This ensures that unicode_aliases only contains those code point
sequences which actually render as color emoji on OS X.
2014-08-01 13:37:40 -04:00
Joshua Peek
b1736a387c Merge pull request #54 from jeremy/nil_style_find_api
Change find_by_* to return nil rather than raise an exception
2014-07-19 13:14:51 -07:00
Jeremy Kemper
f9aba615af Change find_by_* to return nil rather than raise an exception.
This is a breaking API change.

You probably have code that looks like
  if emoji = Emoji.find_by_alias($1) { nil }
that you can change to
  if emoji = Emoji.find_by_alias($1)
2014-07-18 09:16:21 -07:00
Jeremy Kemper
2741be5eb6 Reflect current 2.0.0 release in Gemfile.lock 2014-07-17 17:50:05 -07:00
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
Trevor Turk
baa55a8eda Gemoji 1.3.1 2013-01-08 11:41:55 -06:00
Jamie Dihiansan
4db892b66b Changed dates to 2013 2013-01-08 08:17:28 -06:00
Jamie Dihiansan
8db84353e4 Merge pull request #25 from github/fu
added 🖕
2013-01-08 06:14:14 -08:00
Jamie Dihiansan
7f9b0eaca9 cleaned up fu image 2013-01-08 08:09:15 -06:00
Jamie Dihiansan
3e9c7cc8fb added 🖕 2013-01-07 16:23:38 -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
Julia West
88fce2aa9e Merge pull request #22 from danthompson/typo
Fix readme typo
2013-01-03 14:39:19 -08:00
Dan Thompson
b9fa07e0e2 Fix readme typo 2013-01-03 17:24:44 -05:00
Joshua Peek
6723776d77 Merge pull request #21 from rsenk330/rakefile-desc
Add a description to the emoji rake task.
2012-12-05 05:59:25 -08:00
Ryan Senkbeil
5179cd8159 Add a description to the emoji rake task.
This makes it show up when using `rake -T`.
2012-12-04 13:42:50 -06:00
Joshua Peek
198d829f42 Load tasks 2012-11-29 11:30:57 -06:00
Joshua Peek
5446d53d36 Gemoji 1.3.0 2012-11-29 11:08:46 -06:00
Joshua Peek
77e1fb9e71 Editing 2012-11-29 10:45:33 -06:00
Joshua Peek
cf468c1cfd Fix syntax error 2012-11-29 10:44:29 -06:00
Joshua Peek
6d538220a2 🔥 railtie 2012-11-29 10:42:52 -06:00
Joshua Peek
cf1632ef7a railtie 2012-11-29 10:23:41 -06:00
Joshua Peek
de74b4ec57 Merge pull request #20 from lautis/flags
Correct UTF-8 code points for flags
2012-11-29 08:18:03 -08:00
Ville Lautanala
f7af2578a1 Correct UTF-8 code points for flags
Flags are rendered in place of country's ISO 3166 code, encoded using "regional indicator symbols".
2012-11-29 13:00:29 +02:00
Joshua Peek
08ddb3bd7d Fix syntax 2012-11-16 13:17:54 -06:00
Joshua Peek
bde981dad7 emoji -> gemoji 2012-11-16 13:11:28 -06:00
Joshua Peek
13f9ecc764 Merge branch 'master' of https://github.com/github/gemoji 2012-11-16 13:09:43 -06:00
Joshua Peek
33adca56ea Add maintainer release notes 2012-11-16 13:09:29 -06:00
Julia West
3ede22022f Gemoji 1.2.1 2012-11-16 14:07:08 -05:00
Julia West
8bf88ab86e Merge pull request #17 from github/more-missing-emoji
Adding missing squares, 'sparkle', 'package', and 'back'.
2012-11-16 10:34:42 -08:00
Julia West
1e9e262ddf Adding missing squares, sparkle, package, and back.
- Renaming existing squares for consistency with sized naming convention.
2012-11-16 11:31:26 -05:00
Joshua Peek
c03becb3a0 Gemoji 1.2.0 2012-11-15 00:14:54 -06:00
Joshua Peek
ffcccd85c7 More corrections 2012-11-15 00:10:52 -06:00
Joshua Peek
175fbfb2c3 Fix miss named emoji 2012-11-14 23:50:28 -06:00
Joshua Peek
a9e9415fcc Merge pull request #16 from github/updated-code-points
Updated the 1st-gen emoji code points
2012-11-14 16:08:03 -08:00
Joshua Peek
892ac6274d Copy unicode images too 2012-11-14 17:50:21 -06:00
Joshua Peek
7ffe22d83c Add task to find unnamed images 2012-11-14 17:38:51 -06:00
Julia West
c0c2f10406 Recoding 1st-gen emoji. 2012-11-14 17:53:42 -05:00
Joshua Peek
8cca11fdb1 Gemoji 1.1.3 2012-11-12 12:50:08 -06:00
Joshua Peek
91a5a025ca Add emoji path to assets group
Closes #15
2012-11-12 12:49:29 -06:00
Joshua Peek
01e1710b79 Gemoji 1.1.2 2012-10-25 09:17:17 -05:00
Trevor Turk
2f0ad36b67 lowercase! 2012-10-24 22:40:12 -05:00
Trevor Turk
b84e5754d9 lowercase! 2012-10-24 22:34:13 -05:00
Trevor Turk
c6af1af8f6 Merge pull request #14 from github/missing-emoji
Adding missing emoji
2012-10-24 14:59:22 -07:00
Julia West
8190c65f76 Renaming tongue emojis to be consistent with official names and each other. 2012-10-24 17:07:14 -04:00
Julia West
c921ef1b5b Adding missing emoji.
- Renaming kissing_face to kissing_closed_eyes.
- Adding alias for unlinked Heavy White Check Mark.
2012-10-24 16:53:35 -04:00
Jamie Dihiansan
bfa00106fc Merge pull request #13 from github/add-bee-alias
Add bee -> honeybee alias
2012-10-17 09:47:15 -07:00
Mike Skalnik
9ee88a974d Add bee -> honeybee 2012-10-17 11:12:58 -05:00
Joshua Peek
e11d502d4d Gemoji 1.1.1 2012-10-02 17:06:00 -05:00
Joshua Peek
24cb142c5e Fix rake task path 2012-10-02 17:05:39 -05:00
Joshua Peek
42503f1dfa Gemoji 1.1.0 2012-10-02 16:45:16 -05:00
Joshua Peek
3bf04c21ab Restrict gemspec file 2012-10-02 16:32:04 -05:00
Joshua Peek
dbb7e48c66 Update bundler instructions 2012-10-02 16:30:57 -05:00
Joshua Peek
ed273dee14 Fix config paths 2012-10-02 16:28:39 -05:00
Joshua Peek
b5542d5075 Assets not, config 2012-10-02 16:24:21 -05:00
Joshua Peek
e21a63645c Add images path directly 2012-10-02 16:20:53 -05:00
Joshua Peek
c79a1d69d0 Move images into subdir 2012-10-02 16:20:53 -05:00
Joshua Peek
971bcd6236 Separate railtie file 2012-10-02 16:20:51 -05:00
Trevor Turk
d1d6d35da9 add an example to the readme 2012-10-02 15:47:15 -05:00
Joshua Peek
97f5441ada Gemoji 1.0.0 2012-10-02 15:26:33 -05:00
Trevor Turk
e43f1ac171 try to give attribution where possible 2012-10-02 15:24:13 -05:00
Trevor Turk
fc275cad0a clean up readme 2012-10-02 15:17:17 -05:00
Joshua Peek
38731ced7e Stub gemoji require 2012-10-02 15:15:41 -05:00
Joshua Peek
0e3f686bbd Rename gemspec 2012-10-02 15:15:13 -05:00
Trevor Turk
bd929a9ee0 require emoji in the task 2012-10-01 16:57:41 -05:00
Trevor Turk
436209c12f require environment instead of emoji 2012-10-01 16:51:21 -05:00
Trevor Turk
24d9881f20 move rake task so we can require it in our apps 2012-10-01 16:42:43 -05:00
Trevor Turk
74372af2f8 draft new readme 2012-10-01 11:14:45 -05:00
Jamie Dihiansan
a94b90198a Update LICENSE
Added 37signals credit.
2012-10-01 10:09:40 -05:00
Joshua Peek
25da8c9323 Add copyrights 2012-10-01 10:07:18 -05:00
Joshua Peek
da797b13e3 Emoji 0.4.0 2012-10-01 09:40:40 -05:00
Joshua Peek
9fa5dcd311 Remove gitignore 2012-10-01 09:40:01 -05:00
Joshua Peek
f2f80d4e8a Merge pull request #11 from github/improved-octocat
Know a better Octocat emoji
2012-10-01 07:38:21 -07:00
Matt Burke
315015e90e Recreate symlinks from 97709fea55 with all lowercase file names. 2012-09-30 17:30:01 -04:00
Joshua Peek
d815c7f9b7 💥
Closes #10
2012-09-29 10:18:36 -05:00
Coby Chapple
5919a89968 use a better octocat image 2012-09-29 14:54:32 +10:00
Joshua Peek
3358ffbeb4 Remove some old instructions 2012-09-28 10:05:13 -05:00
Joshua Peek
e46c8207fc Just images/emoji 2012-09-28 10:00:59 -05:00
Joshua Peek
ded4714831 Merge pull request #9 from github/cleanup
Cleanup
2012-09-28 07:58:30 -07:00
Joshua Peek
8c15ced399 Add rake copy task 2012-09-28 09:53:41 -05:00
Joshua Peek
765df113e1 Remove stuff 2012-09-28 09:36:54 -05:00
Shay Frendt
52210cece2 Merge pull request #7 from github/remove-git-from-gemspec
Update gemspec to not rely on `git` executable
2012-08-24 13:07:48 -07:00
Shay Frendt
bcf62ad7cd Update gemspec to not rely on git executable
- This prevents runtime issues when this gem is vendored in an
  application running on systems that don't have git installed
2012-08-24 14:23:58 -04:00
Trevor Turk
db6bc0fb28 todo about the problematic symlinks 2012-08-01 13:01:44 -05:00
Trevor Turk
69e7ea119c Revert "Recreate symlinks from 97709fea55c97c55c467b983b2d98c927fbb5b3f"
This reverts commit 15fd347c8e.
2012-08-01 13:00:15 -05:00
Trevor Turk
1ebc4b1f74 Emoji 0.3.4 2012-08-01 12:01:37 -05:00
Trevor Turk
a2e1d15d13 notes and todos 2012-08-01 11:53:38 -05:00
Trevor Turk
ffaef44107 use replace for sprite and emojify for images 2012-08-01 11:45:06 -05:00
1707 changed files with 19511 additions and 1848 deletions

10
.gitignore vendored
View File

@@ -1 +1,9 @@
Gemfile.lock
/bin/*
!/bin/gemoji
.bundle
.ruby-version
Gemfile.lock
db/emoji-test.txt
db/ucd.nounihan.grouped.xml
images/unicode/*.png
vendor/

9
.travis.yml Normal file
View File

@@ -0,0 +1,9 @@
sudo: false
script: script/test
rvm:
- 1.9.3
- '2.1'
- '2.2'
- 2.3.0
notifications:
email: false

52
CONTRIBUTING.md Normal file
View File

@@ -0,0 +1,52 @@
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.

View File

@@ -1,2 +1,6 @@
source :rubygems
source "https://rubygems.org"
gem "rake", "~> 10.3.2"
gem "minitest", "~> 5.3.5"
gemspec

36
LICENSE Normal file
View File

@@ -0,0 +1,36 @@
octocat, squirrel, shipit
Copyright (c) 2013 GitHub Inc. All rights reserved.
bowtie, neckbeard, fu
Copyright (c) 2013 37signals, LLC. All rights reserved.
feelsgood, finnadie, goberserk, godmode, hurtrealbad, rage 1-4, suspect
Copyright (c) 2013 id Software. All rights reserved.
trollface
Copyright (c) 2013 whynne@deviantart. 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.

122
README.md
View File

@@ -1,35 +1,115 @@
Emoji
=====
gemoji
======
Shared Emoji assets between GitHub, Campfire, and BCX.
This library contains character information about native emoji, as well as image
files for a few custom emoji.
Contributing
Installation
------------
### Designers
Add `gemoji` to your Gemfile.
Drop a 64x64 png into `images/` and commit it.
``` ruby
gem 'gemoji'
```
### Others
### Extract images
Rerun `rake` to rebuild static assets and sprites. (Trying to make this step unnecessary)
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**:
Deploying
---------
``` sh
bundle exec gemoji extract public/images/emoji
```
### GitHub
This will extract images into filenames such as:
1. Run `rake emoji` in app root
* `public/images/emoji/octocat.png`
* `public/images/emoji/unicode/1f9c0.png` (the `:cheese:` emoji)
### Campfire
1. Push changes to 37signals/emoji
2. Update emoji version in config/externals.yml
3. Run `cap local externals:setup` in app root
4. Run `rake emoji` in app root
5. Run `Rails.cache.clear` in app console
Example Rails Helper
--------------------
### BCX
This would allow emojifying content such as: `it's raining :cat:s and :dog:s!`
1. Push changes to 37signals/emoji
2. Run `bundle update emoji` in app root
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(/:([\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.
```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.
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
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,32 +1,45 @@
$:.unshift File.expand_path("../lib", __FILE__)
require 'rake/testtask'
require 'emoji'
require 'sprockets'
require 'rake/clean'
task :default => :test
Assets = Sprockets::Environment.new do |env|
env.append_path Emoji.path
env.append_path File.join(Emoji.path, 'assets')
Rake::TestTask.new do |t|
t.libs << "test"
t.test_files = FileList["test/*_test.rb"]
end
file "lib/emoji.png" do |f|
Assets["emoji.png.erb"].write_to(f.name)
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',
]
desc %(Dump a list of supported Emoji with Unicode descriptions and aliases)
task :dump => :generate do
system 'ruby', '-Ilib', 'db/dump.rb'
end
end
file "lib/emoji.js" do |f|
Assets["emoji.js.erb"].write_to(f.name)
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
end
file "lib/emoji.css" do |f|
Assets["emoji.css.erb"].write_to(f.name)
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
assets = [
"lib/emoji.png",
"lib/emoji.js",
"lib/emoji.css"
]
file 'db/emoji-test.txt' do |t|
system 'curl', '-fsSL', 'http://unicode.org/Public/emoji/4.0/emoji-test.txt', '-o', t.name
end
assets.each { |asset| CLOBBER.include(asset) }
task :default => [:clobber] + assets
directory 'images/unicode' do
require 'emoji/extractor'
Emoji::Extractor.new(64, Emoji.images_path).extract!
end

5
bin/gemoji Executable file
View File

@@ -0,0 +1,5 @@
#!/usr/bin/env ruby
require 'emoji/cli'
exit_code = Emoji::CLI.dispatch(ARGV)
exit exit_code

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

@@ -0,0 +1,71 @@
{
"EmojiDataArray" : [
{
"CVDataTitle" : "EmojiCategory-People",
"CVCategoryImage" : "Emoji-HumanImage",
"CVCategoryData" : {
"CVSkipNullGlyphs" : false,
"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" : "🚗,🚕,🚙,🚌,🚎,🏎,🚓,🚑,🚒,🚐,🚚,🚛,🚜,🛴,🚲,🛵,🏍,🚨,🚔,🚍,🚘,🚖,🚡,🚠,🚟,🚃,🚋,🚞,🚝,🚄,🚅,🚈,🚂,🚆,🚇,🚊,🚉,🚁,🛩,✈️,🛫,🛬,🚀,🛰,💺,🛶,⛵️,🛥,🚤,🛳,⛴,🚢,⚓️,🚧,⛽️,🚏,🚦,🚥,🗺,🗿,🗽,⛲️,🗼,🏰,🏯,🏟,🎡,🎢,🎠,⛱,🏖,🏝,⛰,🏔,🗻,🌋,🏜,🏕,⛺️,🛤,🛣,🏗,🏭,🏠,🏡,🏘,🏚,🏢,🏬,🏣,🏤,🏥,🏦,🏨,🏪,🏫,🏩,💒,🏛,⛪️,🕌,🕍,🕋,⛩,🗾,🎑,🏞,🌅,🌄,🌠,🎇,🎆,🌇,🌆,🏙,🌃,🌌,🌉,🌁"
}
},
{
"CVDataTitle" : "EmojiCategory-Objects",
"CVCategoryImage" : "Emoji-ObjectsImage",
"CVCategoryData" : {
"CVSkipNullGlyphs" : false,
"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" : "🏳️,🏴,🏁,🚩,🏳️‍🌈,🇦🇫,🇦🇽,🇦🇱,🇩🇿,🇦🇸,🇦🇩,🇦🇴,🇦🇮,🇦🇶,🇦🇬,🇦🇷,🇦🇲,🇦🇼,🇦🇺,🇦🇹,🇦🇿,🇧🇸,🇧🇭,🇧🇩,🇧🇧,🇧🇾,🇧🇪,🇧🇿,🇧🇯,🇧🇲,🇧🇹,🇧🇴,🇧🇶,🇧🇦,🇧🇼,🇧🇷,🇮🇴,🇻🇬,🇧🇳,🇧🇬,🇧🇫,🇧🇮,🇨🇻,🇰🇭,🇨🇲,🇨🇦,🇮🇨,🇰🇾,🇨🇫,🇹🇩,🇨🇱,🇨🇳,🇨🇽,🇨🇨,🇨🇴,🇰🇲,🇨🇬,🇨🇩,🇨🇰,🇨🇷,🇨🇮,🇭🇷,🇨🇺,🇨🇼,🇨🇾,🇨🇿,🇩🇰,🇩🇯,🇩🇲,🇩🇴,🇪🇨,🇪🇬,🇸🇻,🇬🇶,🇪🇷,🇪🇪,🇪🇹,🇪🇺,🇫🇰,🇫🇴,🇫🇯,🇫🇮,🇫🇷,🇬🇫,🇵🇫,🇹🇫,🇬🇦,🇬🇲,🇬🇪,🇩🇪,🇬🇭,🇬🇮,🇬🇷,🇬🇱,🇬🇩,🇬🇵,🇬🇺,🇬🇹,🇬🇬,🇬🇳,🇬🇼,🇬🇾,🇭🇹,🇭🇳,🇭🇰,🇭🇺,🇮🇸,🇮🇳,🇮🇩,🇮🇷,🇮🇶,🇮🇪,🇮🇲,🇮🇱,🇮🇹,🇯🇲,🇯🇵,🎌,🇯🇪,🇯🇴,🇰🇿,🇰🇪,🇰🇮,🇽🇰,🇰🇼,🇰🇬,🇱🇦,🇱🇻,🇱🇧,🇱🇸,🇱🇷,🇱🇾,🇱🇮,🇱🇹,🇱🇺,🇲🇴,🇲🇰,🇲🇬,🇲🇼,🇲🇾,🇲🇻,🇲🇱,🇲🇹,🇲🇭,🇲🇶,🇲🇷,🇲🇺,🇾🇹,🇲🇽,🇫🇲,🇲🇩,🇲🇨,🇲🇳,🇲🇪,🇲🇸,🇲🇦,🇲🇿,🇲🇲,🇳🇦,🇳🇷,🇳🇵,🇳🇱,🇳🇨,🇳🇿,🇳🇮,🇳🇪,🇳🇬,🇳🇺,🇳🇫,🇲🇵,🇰🇵,🇳🇴,🇴🇲,🇵🇰,🇵🇼,🇵🇸,🇵🇦,🇵🇬,🇵🇾,🇵🇪,🇵🇭,🇵🇳,🇵🇱,🇵🇹,🇵🇷,🇶🇦,🇷🇪,🇷🇴,🇷🇺,🇷🇼,🇧🇱,🇸🇭,🇰🇳,🇱🇨,🇵🇲,🇻🇨,🇼🇸,🇸🇲,🇸🇹,🇸🇦,🇸🇳,🇷🇸,🇸🇨,🇸🇱,🇸🇬,🇸🇽,🇸🇰,🇸🇮,🇸🇧,🇸🇴,🇿🇦,🇬🇸,🇰🇷,🇸🇸,🇪🇸,🇱🇰,🇸🇩,🇸🇷,🇸🇿,🇸🇪,🇨🇭,🇸🇾,🇹🇼,🇹🇯,🇹🇿,🇹🇭,🇹🇱,🇹🇬,🇹🇰,🇹🇴,🇹🇹,🇹🇳,🇹🇷,🇹🇲,🇹🇨,🇹🇻,🇺🇬,🇺🇦,🇦🇪,🇬🇧,🇺🇸,🇻🇮,🇺🇾,🇺🇿,🇻🇺,🇻🇦,🇻🇪,🇻🇳,🇼🇫,🇪🇭,🇾🇪,🇿🇲,🇿🇼"
}
}
],
"CVViewFontList" : [
"AppleColorEmoji"
]
}

13
db/aliases.applescript Normal file
View File

@@ -0,0 +1,13 @@
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

81
db/aliases.html Normal file
View File

@@ -0,0 +1,81 @@
<!DOCTYPE html>
<title>Emoji alias detection</title>
<style>
textarea {
font-family: monospace;
}
</style>
<p>Save the following as <tt>emoji.json</tt>:</p>
<textarea id="output" rows="50" cols="80"></textarea>
<script>
const VARIATION_SELECTOR_15 = String.fromCharCode(0xfe0e);
const VARIATION_SELECTOR_16 = String.fromCharCode(0xfe0f);
const EMOJI_SIZE = 32
function detectAliases(db) {
for (var i = 0; i < db.length; ++i) {
var emoji = db[i];
var raw = emoji.emoji;
if (!raw) {
continue;
}
if (raw.indexOf(VARIATION_SELECTOR_16) > -1) {
var candidates = [raw.replace(VARIATION_SELECTOR_16, ""), raw];
} else {
var candidates = [raw, raw + VARIATION_SELECTOR_16];
}
var aliases = candidates.filter(isColorEmoji);
emoji.emoji = aliases[0];
}
dump(db);
}
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");
}
var canvas = document.createElement("canvas");
canvas.width = canvas.height = EMOJI_SIZE;
function color(emoji, rgb) {
var context = canvas.getContext("2d");
context.clearRect(0, 0, canvas.width, canvas.height);
context.fillStyle = rgb;
context.textBaseline = "top";
context.font = EMOJI_SIZE+"px Arial";
context.fillText(emoji, 0, 0);
var data = context.getImageData(0, 0, EMOJI_SIZE, EMOJI_SIZE).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 "no colored pixel found";
}
function dump(db) {
var json = JSON.stringify(db, null, " ")
.replace(/^( +)(.+)\[\](,?)$/mg, "$1$2[\n$1]$3")
.replace(/,\n( *) /g, "\n$1, ");
document.getElementById("output").value = json + "\n";
}
var xhr = new XMLHttpRequest;
xhr.onload = function() {
detectAliases(JSON.parse(this.responseText));
};
xhr.open("GET", "emoji.json", false);
xhr.send(null);
</script>

138
db/dump.rb Normal file
View File

@@ -0,0 +1,138 @@
require 'emoji'
require 'json'
require 'rexml/document'
class UnicodeCharacter
attr_reader :code, :description, :version, :aliases
class CharListener
CHAR_TAG = "char".freeze
def self.parse(io, &block)
REXML::Document.parse_stream(io, self.new(&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)
@code = code.downcase
@description = description.downcase
@version = version
@aliases = []
@references = []
end
def add_alias(string)
@aliases.concat string.split(/\s*,\s*/)
end
def add_reference(code)
@references << code.downcase
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
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 = []
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
description = emojidesc.fetch(normalize.(raw))
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,
}
end
end
for emoji in Emoji.all.select(&:custom?)
items << {
aliases: emoji.aliases,
tags: emoji.tags,
}
end
puts JSON.pretty_generate(items)
.gsub("\n\n", "\n")
.gsub(/,\n( +)/) { "\n%s, " % $1[2..-1] }

17962
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,14 +0,0 @@
Gem::Specification.new do |s|
s.name = "emoji"
s.version = "0.3.3"
s.summary = "Emoji Assets"
s.description = "Shared Emoji assets between GitHub, Campfire, and BCX."
s.authors = ["GitHub", "37signals"]
s.email = "support@github.com"
s.homepage = "https://github.com/github/emoji"
s.files = `git ls-files`.split("\n")
s.add_development_dependency "sprockets", "~> 2.0"
end

23
gemoji.gemspec Normal file
View File

@@ -0,0 +1,23 @@
Gem::Specification.new do |s|
s.name = "gemoji"
s.version = "3.0.0.rc2"
s.summary = "Emoji library"
s.description = "Character information and metadata for standard and custom emoji."
s.executables = ["gemoji"]
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",
"bin/gemoji",
"images/*.png",
"db/Category-Emoji.json",
"db/emoji.json",
"lib/**/*.rb",
]
end

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1 +0,0 @@
unicode/e534.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/e01d.png

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

BIN
images/basecamp.png Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 898 B

BIN
images/basecampy.png Normal file
View File

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@@ -1 +0,0 @@
unicode/1f0cf.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