Skip to content
 
 

Latest commit

 

History

34 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

emoji-fx

A fork of Gluon's emoji library, extended with automatic sprite downloading and multi-vendor support.

How it works

On first run, the library automatically:

  1. Resolves the latest emoji-data commit from GitHub (falls back to cache or a known-good commit if offline).
  2. Downloads emoji.json for that commit and generates a local emoji.csv.
  3. Downloads the sprite sheets for the chosen vendor (20, 32, 64 px).
  4. Caches everything under ~/.emoji-fx/{vendor}/{commit}/ for subsequent runs.

Usage

Initialization

Call once at application startup before using any emoji API:

EmojiInitializer.initialize(EmojiVendor.TWITTER)
    .thenAccept(ok -> {
        if (ok) {
        // library is ready
        }
        });

The download directory defaults to ~/.emoji-fx/, but can be customized by passing a Path as the second argument:

EmojiInitializer.initialize(EmojiVendor.FACEBOOK, Path.of("/your/custom/directory"))
        .thenAccept(ok -> {
            if (!ok) log.warn("Emoji assets failed to load");
        })
        .join();

Vendors

Three emoji image sets are supported:

Vendor Identifier
EmojiVendor.GOOGLE Google
EmojiVendor.TWITTER Twitter (Twemoji)
EmojiVendor.FACEBOOK Facebook

API overview

EmojiData contains the public API to create Emoji objects from text, unicode, or hex codepoints.

Fetch 👋 from short name:

Optional<Emoji> emoji = EmojiData.emojiFromShortName("wave");

Search emojis by partial text:

List<Emoji> emojis = EmojiData.search("wav");

Fetch 👋 from unicode:

Optional<Emoji> emoji = EmojiData.emojiFromUnicodeString("\uD83D\uDC4B");

Fetch 👋 from hex codepoint:

Optional<Emoji> emoji = EmojiData.emojiFromCodepoints("1F44B-1F3FC");

Parse a UTF-8 string into a mixed list of text and emoji objects:

List<Object> nodes = TextUtil.convertToStringAndEmojiObjects("hello \uD83D\uDC4B");

Dependency

<dependency>
    <groupId>io.github.b077as.emojifx</groupId>
    <artifactId>emoji</artifactId>
    <version>1.0.1</version>
</dependency>

Contribution

All contributions are welcome!

  • Submit issues for bug reports, questions, or feature requests.
  • Contributions can be submitted via pull request.

License

GNU General Public License v3.0

About

JavaFX emoji support with multiple styles

Topics

Resources

Contributing

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages