Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get individual emoji as PNG #84

Open
frizurd opened this issue Aug 26, 2020 · 1 comment
Open

Get individual emoji as PNG #84

frizurd opened this issue Aug 26, 2020 · 1 comment
Labels
question Further information is requested

Comments

@frizurd
Copy link

frizurd commented Aug 26, 2020

This may also be a feature request...
But are there any easy hacks to get a chosen emoji as an individual PNG image?

All the individual images are available on Unpkg:
https://unpkg.com/browse/[email protected]/img/apple/64/

Thanks!

Love the plugin by the way!

@serebrov
Copy link
Owner

serebrov commented Sep 5, 2020

@frizurd This component only uses sprites with all emojis on one image, so you can't literally get the image, but you can probably get a file name that you need using EmojiIndex.

For example:

import data from '../data/all.json'
import { EmojiIndex } from '../src'

let index = new EmojiIndex(data)

let emojiData = index.emoji('+1')
console.log(emojiData)

Will output this:

EmojiData
    colons: ":+1:"
    emoticons: undefined
    id: "+1"
    name: "Thumbs Up Sign"
    native: "👍"
    short_name: "+1"
    short_names: Array(2)
        0: "+1"
        1: "thumbsup"
    skin: 1
    unified: "1f44d"
    _data:
        added_in: "2.0"
        emoticons: undefined
        has_img_apple: true
        has_img_facebook: true
        has_img_google: true
        has_img_twitter: true
        keywords: (9) ["thumbsup", "yes", "awesome", "good", "agree", "accept", "cool", "hand", "like"]
        name: "Thumbs Up Sign"
        non_qualified: undefined
        search: "+1,thumbsup,thumbs,up,sign,yes,awesome,good,agree,accept,cool,hand,like"
        sheet_x: 13
        sheet_y: 38
        short_names: (2) ["+1", "thumbsup"]
        skin_variations:
        1F3FB:
            added_in: "2.0"
            has_img_apple: true
            has_img_facebook: true
            has_img_google: true
            has_img_twitter: true
            image: "1f44d-1f3fb.png"
            non_qualified: null
            sheet_x: 13
            sheet_y: 39
            unified: "1F44D-1F3FB"
            __proto__: Object
        1F3FC: {unified: "1F44D-1F3FC", non_qualified: null, image: "1f44d-1f3fc.png", sheet_x: 13, sheet_y: 40, …}
        1F3FD: {unified: "1F44D-1F3FD", non_qualified: null, image: "1f44d-1f3fd.png", sheet_x: 13, sheet_y: 41, …}
        1F3FE: {unified: "1F44D-1F3FE", non_qualified: null, image: "1f44d-1f3fe.png", sheet_x: 13, sheet_y: 42, …}
        1F3FF: {unified: "1F44D-1F3FF", non_qualified: null, image: "1f44d-1f3ff.png", sheet_x: 13, sheet_y: 43, …}
        text: ""
        unified: "1F44D"
        ...

There is the image field under skin variations: image: "1f44d-1f3fb.png" - this is the file name that you can use to fetch the emoji file.

@serebrov serebrov added the question Further information is requested label Sep 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants