summaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'README.md')
-rw-r--r--README.md28
1 files changed, 28 insertions, 0 deletions
diff --git a/README.md b/README.md
index bfa8d5e..5912ce4 100644
--- a/README.md
+++ b/README.md
@@ -520,6 +520,34 @@ test "Scripts" {
520} 520}
521``` 521```
522 522
523## Emoji
524
525To get information about emoji and emoji-like characters, use the `Emoji` module.
526
527In your `build.zig`:
528
529```zig
530exe.root_module.addImport("Emoji", zg.module("Emoji"));
531```
532
533In your code:
534
535```zig
536const Emoji = @import("Emoji");
537
538test "Emoji" {
539 const emoji = try Emoji.init(allocator);
540 defer emoji.deinit(allocator);
541
542 try expect(emoji.isEmoji(0x1F415)); // 🐕
543 try expect(emoji.isEmojiPresentation(0x1F408)); // 🐈
544 try expect(emoji.isEmojiModifier(0x1F3FF)); // 🏿
545 try expect(emoji.isEmojiModifierBase(0x1F977)); // 🥷
546 try expect(emoji.isEmojiComponent(0x1F9B0)); // 🦰
547 try expect(emoji.isExtendedPictographic(0x1F005)); // 🀅
548}
549```
550
523## Relation to Ziglyph 551## Relation to Ziglyph
524 552
525zg is a total re-write of some of the components of Ziglyph. The idea was to 553zg is a total re-write of some of the components of Ziglyph. The idea was to