Tool for generating a PNG of an emoji at various sizes. Mostly designed to generate favicons for websites and WebManifests.
emoji-to-icon <options>
Options:
--help Show help [boolean]
--version Show version number [boolean]
--emoji Emoji to render [string] [required]
--size Size to render in pixels [array] [required]
--padding Padding to add in pixels [string]
--outDir Directory to output to [string] [required]
Examples:
emoji-to-icon --emoji "🐳" --size 90 Renders two whale emojis at 90px and
--size 120 --padding "12%" --outDir 120px with 12% of padding into the
"./test" ./test dir
Which results in a PNG which can be then used as a icon, as can be seen here.
This tool uses the NotoEmoji-Regular
font which is open-source from Google. The issue is that we have to use the five-year old black & white library rather than the latest version. This is likely out of sync with the licensed fonts installed in your console.
If the tool cannot find an emoji witihn it's font (which is five years old now) then it uses twemoji
to download a png of the emoji from a CDN.
Be my guest friend, but note you'll first have to add CBLC/CBDT support to fontkit
. You might find it tricky given the format was used by Google in Noto, but the only docs I found were by Microsoft here.
Standard Node
project with Typscript
. It was developed inside a VSCode .devcontainer
so you should be able to just use Remote-Containers
to open it and all the tools will be installed. VSCode tasks and launches used for debugging.
PR's welcome.