diff options
Diffstat (limited to 'README.md')
| -rw-r--r-- | README.md | 28 |
1 files changed, 28 insertions, 0 deletions
| @@ -520,6 +520,34 @@ test "Scripts" { | |||
| 520 | } | 520 | } |
| 521 | ``` | 521 | ``` |
| 522 | 522 | ||
| 523 | ## Emoji | ||
| 524 | |||
| 525 | To get information about emoji and emoji-like characters, use the `Emoji` module. | ||
| 526 | |||
| 527 | In your `build.zig`: | ||
| 528 | |||
| 529 | ```zig | ||
| 530 | exe.root_module.addImport("Emoji", zg.module("Emoji")); | ||
| 531 | ``` | ||
| 532 | |||
| 533 | In your code: | ||
| 534 | |||
| 535 | ```zig | ||
| 536 | const Emoji = @import("Emoji"); | ||
| 537 | |||
| 538 | test "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 | ||
| 525 | zg is a total re-write of some of the components of Ziglyph. The idea was to | 553 | zg is a total re-write of some of the components of Ziglyph. The idea was to |