From 425c86179791cd32e2d4ce0ae7f269940b4b0663 Mon Sep 17 00:00:00 2001 From: Can Celik Date: Thu, 10 Sep 2026 21:51:57 +0300 Subject: chore: upgrade libghostty and preserve terminal behavior (#3906) --- vendor/libghostty-vt/pkg/macos/text/font.zig | 13 ++++++++++++- vendor/libghostty-vt/pkg/macos/text/typesetter.zig | 6 +++--- 2 files changed, 15 insertions(+), 4 deletions(-) (limited to 'vendor/libghostty-vt/pkg/macos/text') diff --git a/vendor/libghostty-vt/pkg/macos/text/font.zig b/vendor/libghostty-vt/pkg/macos/text/font.zig index ea37891f..626b9089 100644 --- a/vendor/libghostty-vt/pkg/macos/text/font.zig +++ b/vendor/libghostty-vt/pkg/macos/text/font.zig @@ -18,6 +18,17 @@ pub const Font = opaque { ) orelse Allocator.Error.OutOfMemory; } + pub fn createWithName(name: *foundation.String, size: f32) Allocator.Error!*Font { + return @as( + ?*Font, + @ptrFromInt(@intFromPtr(c.CTFontCreateWithName( + @ptrCast(name), + size, + null, + ))), + ) orelse Allocator.Error.OutOfMemory; + } + pub fn createForString( self: *Font, str: *foundation.String, @@ -156,7 +167,7 @@ pub const Font = opaque { return @ptrFromInt(@intFromPtr(c.CTFontCopyFamilyName(@ptrCast(self)))); } - pub fn copyDisplayName(self: *Font) *foundation.String { + pub fn copyDisplayName(self: *Font) ?*foundation.String { return @ptrFromInt(@intFromPtr(c.CTFontCopyDisplayName(@ptrCast(self)))); } diff --git a/vendor/libghostty-vt/pkg/macos/text/typesetter.zig b/vendor/libghostty-vt/pkg/macos/text/typesetter.zig index dc07df98..16cd7816 100644 --- a/vendor/libghostty-vt/pkg/macos/text/typesetter.zig +++ b/vendor/libghostty-vt/pkg/macos/text/typesetter.zig @@ -27,10 +27,10 @@ pub const Typesetter = opaque { pub fn createLine( self: *Typesetter, range: foundation.c.CFRange, - ) *text.Line { - return @ptrFromInt(@intFromPtr(c.CTTypesetterCreateLine( + ) Allocator.Error!*text.Line { + return @ptrCast(@constCast(c.CTTypesetterCreateLine( @ptrCast(self), range, - ))); + ) orelse return error.OutOfMemory)); } }; -- cgit v1.2.3