aboutsummaryrefslogtreecommitdiff
path: root/vendor/libghostty-vt/pkg/macos/text/font.zig
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/libghostty-vt/pkg/macos/text/font.zig')
-rw-r--r--vendor/libghostty-vt/pkg/macos/text/font.zig13
1 files changed, 12 insertions, 1 deletions
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))));
}