mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-10-17 15:21:50 +00:00
add utf8proc so we can detect unicode char width
This commit is contained in:
8
pkg/utf8proc/main.zig
Normal file
8
pkg/utf8proc/main.zig
Normal file
@@ -0,0 +1,8 @@
|
||||
pub const c = @import("c.zig");
|
||||
|
||||
/// Given a codepoint, return a character width analogous to `wcwidth(codepoint)`,
|
||||
/// except that a width of 0 is returned for non-printable codepoints
|
||||
/// instead of -1 as in `wcwidth`.
|
||||
pub fn charwidth(codepoint: u21) u8 {
|
||||
return @intCast(u8, c.utf8proc_charwidth(@intCast(i32, codepoint)));
|
||||
}
|
Reference in New Issue
Block a user