attempting to use uucode from uucode.x

pull/8757/head
Jacob Sandlund 2025-08-23 09:16:01 -04:00
parent 0444c614da
commit 3c61aaca2a
3 changed files with 15 additions and 7 deletions

View File

@ -37,12 +37,12 @@
.lazy = true,
},
.uucode = .{
.url = "https://github.com/jacobsandlund/uucode/archive/907218a2c8097688554e54bb0999e6dbd59b226e.tar.gz",
.hash = "uucode-0.0.0-ZZjBPopfPwDqH70dn65Zklni_Yo8KWdLcVMEvmPoj1vW",
.url = "https://github.com/jacobsandlund/uucode/archive/7e2bde7c3cd90a5b754cd62b7d0059f70f5eea3f.tar.gz",
.hash = "uucode-0.0.0-ZZjBPn1iPwCsTwd680sxrXcqNZxA8r_EmnpMiP53h5a5",
},
.uucode_x = .{
.url = "https://github.com/jacobsandlund/uucode.x/archive/9f5cfb1b48ab923677e837e22aa33c2a4380fc47.tar.gz",
.hash = "uucode_x-0.0.0-5_D0j2YhAAC8KvciYTFrV3hKANPbXke5havA5OIEf7XT",
.url = "https://github.com/jacobsandlund/uucode.x/archive/5964041fa51234a5d86dedda88f2af6bb9adf361.tar.gz",
.hash = "uucode_x-0.0.0-5_D0j200AAB5nu0QR5oQiceKujDN8C1WqMNlZiaxqNu0",
},
.zig_wayland = .{
// codeberg ifreund/zig-wayland

View File

@ -428,6 +428,14 @@ pub fn add(
})) |dep| {
step.root_module.addImport("uucode", dep.module("uucode"));
}
if (b.lazyDependency("uucode_x", .{
.target = target,
.optimize = optimize,
})) |dep| {
const mod = dep.module("uucode.x");
step.root_module.addImport("uucode.x", mod);
mod.addImport("root_module", step.root_module);
}
if (b.lazyDependency("zf", .{
.target = target,
.optimize = optimize,

View File

@ -3,7 +3,7 @@ const assert = std.debug.assert;
const Allocator = std.mem.Allocator;
const font = @import("../main.zig");
const terminal = @import("../../terminal/main.zig");
const unicode = @import("../../unicode/main.zig");
const uucode_x = @import("uucode.x");
const log = std.log.scoped(.font_shaper);
@ -111,7 +111,7 @@ pub const Shaper = struct {
// font ligatures. However, we do support grapheme clustering.
// This means we can render things like skin tone emoji but
// we can't render things like single glyph "=>".
var break_state: unicode.GraphemeBreakState = .{};
var break_state: uucode_x.GraphemeBreakState = .default;
var cp1: u21 = @intCast(codepoints[0]);
var start: usize = 0;
@ -126,7 +126,7 @@ pub const Shaper = struct {
const cp2: u21 = @intCast(codepoints[i]);
defer cp1 = cp2;
break :blk unicode.graphemeBreak(
break :blk uucode_x.graphemeBreakXEmoji(
cp1,
cp2,
&break_state,