mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-24 08:15:21 +00:00
font: specific codepoint lookup in internals
This commit is contained in:
@@ -51,6 +51,14 @@ pub const MutableDictionary = opaque {
|
||||
))) orelse Allocator.Error.OutOfMemory;
|
||||
}
|
||||
|
||||
pub fn createMutableCopy(cap: usize, src: *Dictionary) Allocator.Error!*MutableDictionary {
|
||||
return @intToPtr(?*MutableDictionary, @ptrToInt(c.CFDictionaryCreateMutableCopy(
|
||||
null,
|
||||
@intCast(c.CFIndex, cap),
|
||||
@ptrCast(c.CFDictionaryRef, src),
|
||||
))) orelse Allocator.Error.OutOfMemory;
|
||||
}
|
||||
|
||||
pub fn release(self: *MutableDictionary) void {
|
||||
foundation.CFRelease(self);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,19 @@ pub const FontDescriptor = opaque {
|
||||
) orelse Allocator.Error.OutOfMemory;
|
||||
}
|
||||
|
||||
pub fn createCopyWithAttributes(
|
||||
original: *FontDescriptor,
|
||||
dict: *foundation.Dictionary,
|
||||
) Allocator.Error!*FontDescriptor {
|
||||
return @intToPtr(
|
||||
?*FontDescriptor,
|
||||
@ptrToInt(c.CTFontDescriptorCreateCopyWithAttributes(
|
||||
@ptrCast(c.CTFontDescriptorRef, original),
|
||||
@ptrCast(c.CFDictionaryRef, dict),
|
||||
)),
|
||||
) orelse Allocator.Error.OutOfMemory;
|
||||
}
|
||||
|
||||
pub fn release(self: *FontDescriptor) void {
|
||||
c.CFRelease(self);
|
||||
}
|
||||
@@ -28,6 +41,12 @@ pub const FontDescriptor = opaque {
|
||||
@ptrCast(c.CFStringRef, attr.key()),
|
||||
)));
|
||||
}
|
||||
|
||||
pub fn copyAttributes(self: *FontDescriptor) *foundation.Dictionary {
|
||||
return @intToPtr(*foundation.Dictionary, @ptrToInt(c.CTFontDescriptorCopyAttributes(
|
||||
@ptrCast(c.CTFontDescriptorRef, self),
|
||||
)));
|
||||
}
|
||||
};
|
||||
|
||||
pub const FontAttribute = enum {
|
||||
|
||||
Reference in New Issue
Block a user