Compare commits

...

160 Commits

Author SHA1 Message Date
Mislav Marohnić
ac35c33c44 gemoji 4.0.0 2022-11-16 14:35:13 +01:00
Mislav Marohnić
70eb18cf81 Merge pull request #165 from github/skin-tones
Add skin tones support
2022-11-15 21:03:30 +01:00
Mislav Marohnić
d04fd7701e Merge pull request #253 from github/tests-refresh
Touch up emoji integrity tests
2022-11-15 21:01:09 +01:00
Mislav Marohnić
744495f776 Expand skin tones support
- Lookup emoji by unicode that contains a skin tone modifier
- Generate skin tone variants from an emoji
2022-11-15 20:41:33 +01:00
Mislav Marohnić
ea4d73899a People holding hands emoji doesn't seem to support skin tones rendering (macOS) 2022-11-15 20:40:52 +01:00
Mislav Marohnić
d7ca116556 Merge remote-tracking branch 'origin' into skin-tones 2022-11-15 19:21:39 +01:00
Mislav Marohnić
f7a6bb68c0 🔥 unused variable 2022-11-15 18:46:47 +01:00
Mislav Marohnić
a8d55fd539 Disallow dashes in new emoji aliases 2022-11-15 18:46:23 +01:00
Mislav Marohnić
5f3415f5fe Account for the addition of 🫃 2022-11-15 18:45:45 +01:00
Mislav Marohnić
9917299963 Merge pull request #244 from kardeslik/import-emoji-14
Import Emoji 14.0 characters
2022-11-15 18:30:26 +01:00
Mislav Marohnić
e13ac61ebd Merge pull request #252 from github/ci-update
Update Ruby CI testing setup
2022-11-15 18:29:27 +01:00
Mislav Marohnić
6af51fcecd Add tags to Unicode 14 2022-11-15 18:25:34 +01:00
Mislav Marohnić
a166a06499 Update Ruby CI testing setup 2022-11-15 18:03:48 +01:00
Mislav Marohnić
44c22eac93 🔥 Travis CI 2022-11-15 18:03:43 +01:00
Emmar Kardeslik
1c3519c6bb Import Emoji 14.0 characters 2022-07-26 12:43:16 +03:00
Kristján Oddsson
55bb37afa4 gemoji 4.0.0.rc3 2021-07-26 12:08:11 +01:00
Kristján Oddsson
64cd0e9ccf Merge pull request #209 from imageneratext/master
Import Emoji 13.1 characters
2021-07-26 12:00:14 +01:00
franciscorode
0f2f9ce047 Import Emoji 13.1 characters 2021-04-17 21:37:45 +02:00
Mislav Marohnić
b1c7878afe Change envelope and email alias (#185) 2020-10-07 17:08:43 +02:00
Job
ce6c4ab12a Changed canonical alias for email emoji 2020-08-26 09:49:07 +02:00
Job
4c47a26900 Added email tag to envelope for compatibility 2020-08-20 11:59:49 +02:00
Job
2a97e7e98c Fix indent 2020-08-20 11:57:23 +02:00
Job
f6fa963350 Move email alias from envelope to e-mail 2020-08-20 11:53:04 +02:00
Mislav Marohnić
2eb30abcd1 Merge pull request #181 from PurpleBooth/piñata-to-pinata
Safely transliterate international characters for aliases
2020-07-31 17:19:59 +02:00
Mislav Marohnić
59ef859169 Set up CI via GitHub Actions (#183) 2020-07-31 17:15:15 +02:00
Billie Thompson
be99618db3 Convert none ascii characters safely to their ASCII representation
Relates-to: github/gemoji#180
2020-07-30 22:06:23 +02:00
Kristján Oddsson
3675a8781f Merge pull request #182 from PurpleBooth/only-pinjata
Remove underscore from Pinata
2020-07-30 10:48:03 +01:00
Billie Thompson
7f6550fe73 Remove underscore from Pinata
Relates-to: github/gemoji#180
2020-07-30 08:46:57 +02:00
Mislav Marohnić
5361b5639f gemoji 4.0.0.rc2 2020-01-31 03:29:58 +01:00
Mislav Marohnić
955be747f2 Merge branch 'charvp/master' 2020-01-31 03:29:23 +01:00
Mislav Marohnić
d98617abf2 Bring back bride_with_veil for backwards compatibility 2020-01-31 03:26:58 +01:00
Charlotte Van Petegem
bf598c57fc Import Emoji 13.0 characters
https://emojipedia.org/emoji-13.0/
2020-01-30 14:16:34 +01:00
Mislav Marohnić
d371b81198 gemoji 4.0.0.rc1 2019-11-29 18:38:34 +01:00
Mislav Marohnić
cefc4b015e Merge branch 'unicode-12.1' 2019-11-29 18:37:18 +01:00
Mislav Marohnić
d1002aa48c Simplify emoji-test-parser 2019-11-29 17:44:55 +01:00
Mislav Marohnić
3cde479627 Import Unicode 12.1 characters
https://emojipedia.org/emoji-12.1/
2019-11-29 13:24:35 +01:00
Mislav Marohnić
cbf7fb30b9 Revert "Merge pull request #164 from github/mislav/text-glyphs"
This reverts commit d48b0d90ac, reversing
changes made to 03dea3bd7d.
2019-11-29 13:24:35 +01:00
Kristján Oddsson
59b3fde91e Merge pull request #169 from JuanitoFatas/fix-emoji-test-parser
Fix ArgumentError in emoji-test-parser
2019-09-16 09:29:00 +01:00
Juanito Fatas
f9e41a8739 Fix ArgumentError in emoji-test-parser 2019-09-16 14:32:34 +09:00
Mislav Marohnić
0a24792305 gemoji 4.0.0.pre0 2019-07-05 10:32:29 +02:00
Mislav Marohnić
d48b0d90ac Merge pull request #164 from github/mislav/text-glyphs
Prefer `emoji.raw` without VARIATION SELECTOR 16
2019-07-03 20:11:32 +02:00
Mislav Marohnić
a5865153a2 Add Emoji::Character#skin_tones? 2019-07-03 18:28:34 +02:00
Mislav Marohnić
37b14e495b Ensure that emoji can't be looked up by their text glyph 2019-07-03 18:26:48 +02:00
Mislav Marohnić
fd84af55cf Regenerate emoji.json with shorter sequences 2019-07-03 17:57:25 +02:00
Mislav Marohnić
b37659ccd8 Use shortest possible sequence as emoji.raw representation 2019-07-03 17:57:25 +02:00
Mislav Marohnić
5766d15e27 Explicitly list glyphs to render as text when no VARIATION_SELECTOR_16 2019-07-03 17:37:56 +02:00
Mislav Marohnić
03dea3bd7d Merge pull request #161 from jhawthorn/dedup
Freeze and dedup strings
2019-07-03 15:34:12 +02:00
John Hawthorn
69009d4c1e Freeze and dedup strings 2019-05-15 16:16:37 -07:00
Mislav Marohnić
22b920f8bd Merge pull request #158 from github/rm-custom-emoji
Remove custom emoji
2019-05-06 18:47:57 +02:00
Mislav Marohnić
55a00803d8 Merge pull request #159 from github/unicode-12
Add Unicode 12 emoji
2019-05-05 03:47:38 +02:00
Mislav Marohnić
6f5518a9ed Add new Unicode 12 emoji 2019-05-05 03:26:18 +02:00
Mislav Marohnić
ff9b85268e Reorder existing emoji based on Unicode 12 2019-05-05 03:13:27 +02:00
Mislav Marohnić
c8cebe22eb Ensure that dump.rb accounts for all existing emoji.json entries 2019-05-05 03:12:43 +02:00
Mislav Marohnić
28a179180b Skip emoji-test.txt entries that are variations of skin tones 2019-05-05 03:11:46 +02:00
Mislav Marohnić
b801800935 Pull in emoji-test.txt for Unicode 12 2019-05-05 03:04:09 +02:00
Mislav Marohnić
16c382b744 Remove obsolete information 2019-05-05 02:28:19 +02:00
Mislav Marohnić
0f9400398e 🔥 extractor logic
We no longer ship any images to extract.
2019-05-05 02:28:19 +02:00
Mislav Marohnić
040aebef64 🔥 custom emoji
On GitHub.com, people predominantly use `:octocat:` and `:shipit:`, but
other custom emoji not as much. These two most used custom emoji also
happen to be specific to the GitHub brand, so it makes more sense that
we add them as custom emoji in the app itself rather than shipping them
with the gemoji library.
2019-05-05 02:28:19 +02:00
Mislav Marohnić
4b2d44d272 🔥 integrity tests
These were tied to the logic that extracts PNG images from Apple font
2019-05-05 02:02:03 +02:00
Mislav Marohnić
987463b50b 🔥 obsolete scripts 2019-05-05 01:58:35 +02:00
Mislav Marohnić
3bc9fe0694 Merge pull request #155 from github/no-apple
Deprecate Apple Palette and upgrade to Emoji 11.
2019-05-05 01:47:18 +02:00
Mislav Marohnić
e55d1457ab Vendor emoji-test.txt from Unicode.org so it can be used in tests 2019-05-05 01:27:01 +02:00
Mislav Marohnić
444ad5b1f4 Fix tests 2019-05-05 01:05:06 +02:00
Mislav Marohnić
e2911b66f2 Generate sequences with alternate VARIATION_SELECTOR_16 positioning 2019-05-05 01:05:06 +02:00
Mislav Marohnić
3e67cc2a60 Regenerate emoji.json 2019-05-05 01:05:06 +02:00
Mislav Marohnić
e5eb1e8bcf Cleanup in constants 2019-05-04 17:50:33 +02:00
Mislav Marohnić
f00846a597 Avoid reusing existing emoji in dump.rb 2019-05-04 17:49:45 +02:00
Mislav Marohnić
4301394495 Symbolize keys when parsing data file 2019-05-02 15:08:04 +02:00
Mislav Marohnić
294b5c4c5c Clean up hacks around gendered emoji 2019-05-02 14:54:06 +02:00
Mislav Marohnić
6ac95753f0 Remove palette method
This represented Apple's palette of characters before, but now has no
purpose since the `Emoji.all` list plus categories represents the
character palette recommendation from Unicode.
2019-05-02 14:52:12 +02:00
Mislav Marohnić
3e7a9bebe2 Parse emoji-test.txt from Unicode 2019-05-02 14:30:27 +02:00
Kristján Oddsson
70b65c3b10 Unicode 11 emojis 2019-05-02 14:30:27 +02:00
Mislav Marohnić
d582f48cbf Merge pull request #137 from nicolasleger/patch-1
Test build on new Ruby versions
2019-05-02 10:36:17 +02:00
Mislav Marohnić
a3cefa60de Ruby versions in CI without patch numbers 2019-05-02 10:23:16 +02:00
Mislav Marohnić
3668746720 Merge pull request #156 from ashmaroli/interpolate-regex-once
Interpolate gender-variation regex just once
2019-05-02 10:20:46 +02:00
Mislav Marohnić
1a652be3dc Merge pull request #152 from ashmaroli/frozen-string-literals
Freeze string literals when using a modern Ruby
2019-05-02 09:51:51 +02:00
Mislav Marohnić
df9d9491e8 Merge pull request #154 from ashmaroli/module-private-constant
Use Module#private_constant to hide constants
2019-05-02 09:51:26 +02:00
Ashwin Maroli
667d62c1a6 Interpolate gender-variation regex just once 2019-04-28 11:59:19 +05:30
Kristján Oddsson
8d7c6fa4e3 bump version 2019-04-25 11:19:03 +01:00
Kristján Oddsson
21c4e27ee2 Merge pull request #151 from github/policewoman-is-also-a-cop
👮‍♀️ Add "police", "law" and "cop" as tags for 👮‍♀️
2019-04-25 11:18:16 +01:00
Ashwin Maroli
7c91775a0b Use Module#private_constant to hide constants 2019-04-22 15:50:47 +05:30
Ashwin Maroli
afc91a5235 Freeze string literals when using a modern Ruby 2019-04-22 14:47:59 +05:30
Kristján Oddsson
aed88bb347 add "police", "law" and "cop" as tags for 👮‍♀️ 2019-04-18 08:38:24 +01:00
Mike McQuaid
b04991b001 Merge pull request #140 from github/contributing-license
CONTRIBUTING: note license.
2018-02-16 09:30:59 +00:00
Mike McQuaid
8d6aff3fc6 CONTRIBUTING: note license.
This is to be more explicit about the contribution process and license.
2018-02-16 09:09:16 +00:00
Nicolas Leger
3f8feffc48 Test build on new Ruby versions 2018-01-08 10:23:45 +01:00
Joshua Peek
3f6057146c Merge pull request #125 from github/sass
Add "sassy" alias to information desk people
2017-05-22 09:32:14 -07:00
Joshua Peek
61e16ae891 Add "sassy" alias to information desk people 2017-05-20 19:47:16 -07:00
Mislav Marohnić
9b8ad85de0 Merge branch 'unicode-aliases'
Fixes #122
2017-04-21 16:32:11 +02:00
Mislav Marohnić
09125ab983 Fix rendering of custom emoji in db/index.html 2017-04-21 16:31:32 +02:00
Mislav Marohnić
b9ce241bf1 Regenerate emoji.json with minimal raw representations
If a raw representation of emoji includes VARIATION SELECTOR 16, but a
browser would render it as a color emoji even without that character,
drop the VARIATION SELECTOR 16 from the raw representation.
2017-04-21 16:31:32 +02:00
Mislav Marohnić
ed954928d7 Improve script for detecting supported unicode aliases 2017-04-21 16:31:31 +02:00
Mislav Marohnić
7858e79566 Merge pull request #116 from skunkmb/master
Add a laugh alias and a hooray alias to 😄 and 🎉
2017-02-16 12:00:55 +01:00
Skunk
7bdd3f657f Use tags instead of aliases for laugh and hooray
As mentioned by @mislav in github/gemoji#116, too many aliases can be
tricky, but tags don’t need to be unique. Therefore, replace new aliases
with new tags for the recently changed 😄 and 🎉 emoji.
2017-02-15 16:23:33 -08:00
Skunk
68af9e3320 Add a laugh alias and a hooray alias to 😄 and 🎉
In the GitHub Reactions menu, there are six emoji: 👍, 👎, 😄, 🎉, 😕, and
❤️. However, two out of the six (😄 and 🎉) have descriptions (“Laugh”
and “Hooray”) that do not actually correspond to Gemoji aliases. Add new
aliases to those two Gemoji so that they directly correspond to the
GitHub Reactions.
2017-02-12 08:41:46 -08:00
Mislav Marohnić
7d27517382 gemoji 3.0.0 2016-12-21 17:14:05 +01:00
Mislav Marohnić
53325ab398 Allow specifying image size to extract 2016-12-21 17:12:58 +01:00
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
890 changed files with 25779 additions and 5770 deletions

24
.github/workflows/test.yml vendored Normal file
View File

@@ -0,0 +1,24 @@
name: Test
on: [push, pull_request]
jobs:
test:
strategy:
fail-fast: false
matrix:
ruby: ["2.7", "3.0", "3.1"]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Ruby
uses: ruby/setup-ruby@v1
with:
ruby-version: ${{matrix.ruby}}
bundler-cache: true
- name: Run tests
run: bundle exec rake

6
.gitignore vendored
View File

@@ -1,2 +1,6 @@
/bin/*
.bundle
.ruby-version
db/NamesList.txt
Gemfile.lock
vendor/*
!vendor/unicode-emoji-test.txt

View File

@@ -1,6 +0,0 @@
script: script/test
rvm:
- 1.9.3
- 2.1.2
notifications:
email: false

View File

@@ -1,5 +1,4 @@
Our emoji set is based off Apple's emoji character palette, plus some custom
emoji such as :octocat: :shipit: :metal:.
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).
Some useful tools in development are:
@@ -12,28 +11,11 @@ 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.
Runs the test suite.
```
script/console

View File

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

View File

@@ -1,11 +1,14 @@
PATH
remote: .
specs:
gemoji (2.1.0)
gemoji (4.0.0)
GEM
remote: https://rubygems.org/
specs:
concurrent-ruby (1.1.7)
i18n (1.8.5)
concurrent-ruby (~> 1.0)
minitest (5.3.5)
rake (10.3.2)
@@ -14,5 +17,9 @@ PLATFORMS
DEPENDENCIES
gemoji!
minitest
rake
i18n (~> 1.8.5)
minitest (~> 5.3.5)
rake (~> 10.3.2)
BUNDLED WITH
2.0.2

19
LICENSE
View File

@@ -1,21 +1,4 @@
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.
All other images
Copyright (c) 2013 Apple Inc. All rights reserved.
Source code:
Copyright (c) 2013 GitHub, Inc.
Copyright (c) 2019 GitHub, Inc.
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation

View File

@@ -1,7 +1,7 @@
gemoji
======
Emoji images and names. See the LICENSE for copyright information.
This library contains character information about native emojis.
Installation
@@ -13,37 +13,6 @@ Add `gemoji` to your Gemfile.
gem 'gemoji'
```
**Sync images**
Images can be copied to your public directory with `rake emoji` in your app. This is the recommended approach since the images will be available at a consistent location. This works best with cached formatted user content generated by tools like [html-pipeline](https://github.com/jch/html-pipeline).
``` ruby
# Rakefile
load 'tasks/emoji.rake'
```
```
$ rake 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
--------------------
@@ -57,7 +26,7 @@ module EmojiHelper
def emojify(content)
h(content).to_str.gsub(/:([\w+-]+):/) do |match|
if emoji = Emoji.find_by_alias($1)
%(<img alt="#$1" src="#{asset_path("emoji/#{emoji.image_filename}")}" style="vertical-align:middle" width="20" height="20" />)
%(<img alt="#$1" src="#{image_path("emoji/#{emoji.image_filename}")}" style="vertical-align:middle" width="20" height="20" />)
else
match
end
@@ -107,6 +76,14 @@ 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

View File

@@ -9,7 +9,9 @@ end
namespace :db do
desc %(Generate Emoji data files needed for development)
task :generate => ['db/Category-Emoji.json', 'db/NamesList.txt']
task :generate => [
'vendor/unicode-emoji-test.txt',
]
desc %(Dump a list of supported Emoji with Unicode descriptions and aliases)
task :dump => :generate do
@@ -17,13 +19,6 @@ 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 '#{emoji_plist}' -o '#{t.name}'"
end
file 'db/NamesList.txt' do |t|
system "curl -fsSL '#{nameslist_url}' -o '#{t.name}'"
file 'vendor/unicode-emoji-test.txt' do |t|
system 'curl', '-fsSL', 'http://unicode.org/Public/emoji/14.0/emoji-test.txt', '-o', t.name
end

View File

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

View File

@@ -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

View File

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

View File

@@ -1,74 +1,69 @@
# frozen_string_literal: true
require "i18n"
require 'emoji'
require 'json'
require_relative './emoji-test-parser'
names_list = File.expand_path('../NamesList.txt', __FILE__)
I18n.config.available_locales = :en
items = []
class UnicodeCharacter
attr_reader :code, :description, :aliases
_, categories = EmojiTestParser.parse(File.expand_path("../../vendor/unicode-emoji-test.txt", __FILE__))
seen_existing = {}
@index = {}
class << self
attr_reader :index
def fetch(code, *args, &block)
code = code.to_s(16).rjust(4, '0') if code.is_a?(Integer)
index.fetch(code, *args, &block)
for category in categories
for sub_category in category[:emoji]
for emoji_item in sub_category[:emoji]
raw = emoji_item[:sequences][0]
existing_emoji = Emoji.find_by_unicode(raw) || Emoji.find_by_unicode("#{raw}\u{fe0f}")
if seen_existing.key?(existing_emoji)
existing_emoji = nil
else
seen_existing[existing_emoji] = true
end
description = emoji_item[:description].sub(/^E\d+(\.\d+)? /, '')
output_item = {
emoji: raw,
description: description,
category: category[:name],
}
if existing_emoji
output_item.update(
aliases: existing_emoji.aliases,
tags: existing_emoji.tags,
unicode_version: existing_emoji.unicode_version,
ios_version: existing_emoji.ios_version,
)
else
output_item.update(
aliases: [I18n.transliterate(description).gsub(/\W+/, '_').downcase],
tags: [],
unicode_version: "14.0",
ios_version: "15.4",
)
end
output_item[:skin_tones] = true if emoji_item[:skin_tones]
items << output_item
end
end
def initialize(code, description)
@code = code.downcase
@description = description.downcase
@aliases = []
@references = []
self.class.index[@code] = self
end
def add_alias(string)
@aliases.concat string.split(/\s*,\s*/)
end
def add_reference(code)
@references << code.downcase
end
end
char = nil
missing_emoji = Emoji.all.reject { |e| e.custom? || seen_existing.key?(e) }
if missing_emoji.any?
$stderr.puts "Error: these `emoji.json` entries were not matched:"
$stderr.puts missing_emoji.map { |e| "%s (%s)" % [e.hex_inspect, e.name] }
exit 1
end
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
for emoji in Emoji.all.select(&:custom?)
items << {
aliases: emoji.aliases,
tags: emoji.tags,
}
end
trap(:PIPE) { abort }
items = []
variation_codepoint = Emoji::VARIATION_SELECTOR_16.codepoints[0]
for emoji in Emoji.all
item = {}
unless emoji.custom?
chars = emoji.raw.codepoints.map { |code| UnicodeCharacter.fetch(code) unless code == variation_codepoint }.compact
item[:emoji] = emoji.raw
item[:description] = chars.map(&:description).join(' + ')
end
item[:aliases] = emoji.aliases
item[:tags] = emoji.tags
items << item
end
puts JSON.pretty_generate(items)
.gsub("\n\n", "\n")
.gsub(/,\n( +)/) { "\n%s, " % $1[2..-1] }

117
db/emoji-test-parser.rb Normal file
View File

@@ -0,0 +1,117 @@
# frozen_string_literal: true
module EmojiTestParser
VARIATION_SELECTOR_16 = "\u{fe0f}"
SKIN_TONES = [
"\u{1F3FB}", # light skin tone
"\u{1F3FC}", # medium-light skin tone
"\u{1F3FD}", # medium skin tone
"\u{1F3FE}", # medium-dark skin tone
"\u{1F3FF}", # dark skin tone
]
SKIN_TONES_RE = /(#{SKIN_TONES.join("|")})/o
SKIP_TYPES = ["unqualified", "component"]
module_function
def parse(filename)
File.open(filename, "r:UTF-8") do |file|
parse_file(file)
end
end
def parse_file(io)
data = []
emoji_map = {}
category = nil
sub_category = nil
io.each do |line|
begin
if line.start_with?("# group: ")
_, group_name = line.split(":", 2)
category = {
name: group_name.strip,
emoji: [],
}
data << category
sub_category = nil
elsif line.start_with?("# subgroup: ")
_, group_name = line.split(":", 2)
sub_category = {
name: group_name.strip,
emoji: [],
}
category[:emoji] << sub_category
elsif line.start_with?("#") || line.strip.empty?
next
else
row, desc = line.split("#", 2)
desc = desc.strip.split(" ", 2)[1]
codepoints, qualification = row.split(";", 2)
next if SKIP_TYPES.include?(qualification.strip)
emoji_raw = codepoints.strip.split.map { |c| c.hex }.pack("U*")
emoji_normalized = emoji_raw
.gsub(VARIATION_SELECTOR_16, "")
.gsub(SKIN_TONES_RE, "")
emoji_item = emoji_map[emoji_normalized]
if SKIN_TONES.any? { |s| emoji_raw.include?(s) }
emoji_item[:skin_tones] = true if emoji_item
next
end
if emoji_item
emoji_item[:sequences] << emoji_raw
else
emoji_item = {
sequences: [emoji_raw],
description: desc,
}
emoji_map[emoji_normalized] = emoji_item
sub_category[:emoji] << emoji_item
end
end
rescue
warn "line: %p" % line
raise
end
end
[emoji_map, data]
end
end
if $0 == __FILE__
html_output = false
if ARGV[0] == "--html"
ARGV.shift
html_output = true
end
_, categories = EmojiTestParser.parse(File.expand_path("../../vendor/unicode-emoji-test.txt", __FILE__))
trap(:PIPE) { abort }
if html_output
puts "<!doctype html>"
puts "<meta charset=utf-8>"
for category in categories
puts "<h2>#{category[:name]}</h2>"
for sub_category in category[:emoji]
puts "<h3>#{sub_category[:name]}</h3>"
puts "<ol>"
for char in sub_category[:emoji]
puts "<li>"
for sequence in char[:sequences]
codepoints = sequence.unpack("U*").map { |c| c.to_s(16).upcase }.join(" ")
printf '<span class=emoji title="%s">%s</span> ', codepoints, sequence
end
puts "#{char[:description]}</li>"
end
puts "</ol>"
end
end
else
require "json"
puts JSON.pretty_generate(categories)
end
end

View File

File diff suppressed because it is too large Load Diff

View File

@@ -66,7 +66,7 @@ li > span {
if (emoji.emoji) els[0].textContent = emoji.emoji
else {
var img = document.createElement('img')
img.src = "../images/emoji/" + emoji.aliases[0] + ".png"
img.src = "../images/" + emoji.aliases[0] + ".png"
els[0].appendChild(img)
}
els[1].textContent = emoji.description || ''

View File

@@ -1,8 +1,8 @@
Gem::Specification.new do |s|
s.name = "gemoji"
s.version = "2.1.0"
s.summary = "Emoji conversion and image assets"
s.description = "Image assets and character information for emoji."
s.version = "4.0.0"
s.summary = "Unicode emoji library"
s.description = "Character information and metadata for Unicode emoji."
s.required_ruby_version = '> 1.9'
@@ -13,9 +13,8 @@ Gem::Specification.new do |s|
s.files = Dir[
"README.md",
"images/**/*.png",
"LICENSE",
"db/emoji.json",
"lib/**/*.rb",
"lib/tasks/*.rake"
]
end

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.3 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.2 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1016 B

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.7 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.2 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.6 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.6 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.4 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.1 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.8 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.0 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.1 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.1 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.3 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.4 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.3 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.6 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.9 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.9 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.4 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.8 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.2 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.0 KiB

View File

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

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