Madeorsk / EmojisFX

Beautiful emojis support for JavaFX 8.
MIT License
7 stars 1 forks source link
emojione emojis gui javafx ui-components

EmojisFX

Beautiful emojis support for JavaFX 8.

Simple example

Default emojis: Open Moji 13.0.

TODO

How to use

Full example: com.madeorsk.emojisfx.examples.SimpleExample

Classic label

EmojisLabel is very similar to a normal label, it just has one more property which is the path of the emojis directory (only internal directories for now).

// See com.madeorsk.emojisfx.examples.SimpleExample in test directory for the full example.

// Create an EmojisLabel, and we are so happy that we indicate it with an emoji.
EmojisLabel label = new EmojisLabel("Look! That's a coloured emoji! \uD83D\uDE04");
label.setFont(Font.font(24)); // Please, I want to see this text!
root.getChildren().add(label);

Selectable label

EmojisLabel text is selectable, and you can set the selection colors.

// See com.madeorsk.emojisfx.examples.SimpleExample in test directory for the full example.

label.setSelectionFill(Color.BLACK); // So dark...
label.setSelectedTextFill(Color.WHITE);

Linkable label

EmojisLabel also support integrated links!

// See com.madeorsk.emojisfx.examples.SimpleExample in test directory for the full example.

EmojisLabel linkedLabel = new EmojisLabel("Do you ❤ this? If yes, consider making a donation.");
linkedLabel.setLinkTextFill(Color.rgb(255, 90, 121)); // A link with the same color as the heart.
linkedLabel.addLinkRange(new Range(24, 40, () -> { /* Link action. */ }));
root.getChildren().add(linkedLabel);

You can use com.madeorsk.emojisfx.Testing as another example.