View Source Exmoji (Exmoji v0.3.2)
An Elixir/Erlang library providing low level operations for dealing with Emoji glyphs in the Unicode standard.
Exmoji is like a swiss-army knife for dealing with Emoji encoding issues. If
all you need to do is translate :poop:
into a smiling poop glyph, then there
are plenty of other libs out there that will probably do what you want. But
once you are dealing with Emoji as a fundamental part of your application, and
you start to realize the nightmare of doublebyte encoding or variants, then
this library may be your new best friend.
Summary
Functions
Returns a list of all 845 Emoji characters as EmojiChar
.
Returns a list of all EmojiChar
that are represented as doublebyte encoding.
Returns a list of all EmojiChar
that have at least one variant encoding.
Convert a native bitstring glyph to its unified codepoint ID.
Returns a list of all known Emoji characters rendered as Unicode bitstrings.
Returns a list of all known codepoints representing Emoji characters.
Finds any EmojiChar
that contains given string in its official name.
Find all EmojiChar
that match substring in any of their associated short
name keywords.
Finds an EmojiChar
based on its short name keyword.
Finds a specific EmojiChar
based on the unified codepoint ID.
Convert a unified ID directly to its bitstring glyph representation.
Functions
Returns a list of all 845 Emoji characters as EmojiChar
.
Returns a list of all EmojiChar
that are represented as doublebyte encoding.
Returns a list of all EmojiChar
that have at least one variant encoding.
Convert a native bitstring glyph to its unified codepoint ID.
This is a conversion operation, not a match, so it may produce unexpected results with different types of values.
Examples
iex> Exmoji.char_to_unified("👾")
"1F47E"
iex> Exmoji.char_to_unified("#️⃣")
"0023-FE0F-20E3"
Returns a list of all known Emoji characters rendered as Unicode bitstrings.
By default, the default rendering options for this library will be used.
However, if you pass the option of include_variants: true
then all possible
renderings of a single glyph will be included, meaning that:
- You will have "duplicate" emojis in your list.
- This list is now suitable for exhaustably matching against in a search.
Returns a list of all known codepoints representing Emoji characters.
This function also accepts the include_variants
option, for details on its
significance, see similar discussion for the Exmoji.chars/1
function.
Finds any EmojiChar
that contains given string in its official name.
Examples
iex> Exmoji.find_by_name "father"
[%Exmoji.EmojiChar{name: "FATHER CHRISTMAS", short_name: "santa",
short_names: ["santa"], text: nil, unified: "1F385", variations: []}]
iex> for t <- Exmoji.find_by_name("tree"), do: t.name
["EVERGREEN TREE", "DECIDUOUS TREE", "PALM TREE", "CHRISTMAS TREE",
"TANABATA TREE"]
Find all EmojiChar
that match substring in any of their associated short
name keywords.
Finds an EmojiChar
based on its short name keyword.
Case insensitive. Otherwise must match exactly. Do not include the :colon:
identifiers if you are parsing text that uses them to indicate the presence of
a keyword.
Finds a specific EmojiChar
based on the unified codepoint ID.
Convert a unified ID directly to its bitstring glyph representation.
Example
iex> Exmoji.unified_to_char("1F47E")
"👾"