From 5c9ce93a639f04e414b7bf04a3dc73af6f50e8f6 Mon Sep 17 00:00:00 2001 From: Tim Culverhouse Date: Sun, 28 Jan 2024 21:35:31 -0600 Subject: [PATCH] update ziglyph update ziglyph to include proper default text emoji with VS16 selector widths Signed-off-by: Tim Culverhouse --- build.zig.zon | 4 ++-- src/gwidth.zig | 5 +++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/build.zig.zon b/build.zig.zon index 172aafd..b19b16c 100644 --- a/build.zig.zon +++ b/build.zig.zon @@ -11,8 +11,8 @@ .dependencies = .{ .ziglyph = .{ - .url = "https://codeberg.org/dude_the_builder/ziglyph/archive/main.tar.gz", - .hash = "12208553f3f47e51494e187f4c0e6f6b3844e3993436cad4a0e8c4db4e99645967b5", + .url = "https://codeberg.org/dude_the_builder/ziglyph/archive/ac50ab06c91d2dd632ff4573c035dafe3b374aba.tar.gz", + .hash = "1220e097fbfb3a15a6f3484cf507f1f10ab571d1bcf519c3b5447ca727782b7a5264", }, .zigimg = .{ .url = "https://github.com/zigimg/zigimg/archive/f6998808f283f8d3c2ef34e8b4af423bc1786f32.tar.gz", diff --git a/src/gwidth.zig b/src/gwidth.zig index 3d6d35f..1edc20d 100644 --- a/src/gwidth.zig +++ b/src/gwidth.zig @@ -40,6 +40,11 @@ test "gwidth: emoji with ZWJ" { try testing.expectEqual(4, try gwidth("👩‍🚀", .wcwidth)); } +test "gwidth: emoji with VS16 selector" { + try testing.expectEqual(2, try gwidth("\xE2\x9D\xA4\xEF\xB8\x8F", .unicode)); + try testing.expectEqual(1, try gwidth("\xE2\x9D\xA4\xEF\xB8\x8F", .wcwidth)); +} + test "gwidth: emoji with skin tone selector" { try testing.expectEqual(2, try gwidth("👋🏿", .unicode)); try testing.expectEqual(4, try gwidth("👋🏿", .wcwidth));