diff options
| author | 2025-06-24 07:55:16 -0400 | |
|---|---|---|
| committer | 2025-06-24 07:55:16 -0400 | |
| commit | d7df2b4b92e198fbdbe5cfc29095d48980675004 (patch) | |
| tree | 3a6a8afa88dfcbee6b5733769604060d0f95b7b9 /README.md | |
| parent | Merge pull request 'Fix benchmarks' (#56) from jacobsandlund/zg:benchmarks in... (diff) | |
| download | zg-d7df2b4b92e198fbdbe5cfc29095d48980675004.tar.gz zg-d7df2b4b92e198fbdbe5cfc29095d48980675004.tar.xz zg-d7df2b4b92e198fbdbe5cfc29095d48980675004.zip | |
Add Emoji module and codegen/emoji
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 |