diff --git a/pkg/macos/foundation/dictionary.zig b/pkg/macos/foundation/dictionary.zig index 0b6aa48be..ebb0fcc33 100644 --- a/pkg/macos/foundation/dictionary.zig +++ b/pkg/macos/foundation/dictionary.zig @@ -39,6 +39,23 @@ pub const Dictionary = opaque { key, ))); } + + pub fn getKeysAndValues(self: *Dictionary, alloc: Allocator) !struct { + keys: []?*const anyopaque, + values: []?*const anyopaque, + } { + const count = self.getCount(); + const keys = try alloc.alloc(?*const anyopaque, count); + errdefer alloc.free(keys); + const values = try alloc.alloc(?*const anyopaque, count); + errdefer alloc.free(values); + c.CFDictionaryGetKeysAndValues( + @ptrCast(self), + @ptrCast(keys.ptr), + @ptrCast(values.ptr), + ); + return .{ .keys = keys, .values = values }; + } }; pub const MutableDictionary = opaque { diff --git a/pkg/macos/text.zig b/pkg/macos/text.zig index 1203ed426..2d5de91db 100644 --- a/pkg/macos/text.zig +++ b/pkg/macos/text.zig @@ -1,3 +1,4 @@ +pub const c = @import("text/c.zig"); pub usingnamespace @import("text/font.zig"); pub usingnamespace @import("text/font_collection.zig"); pub usingnamespace @import("text/font_descriptor.zig"); diff --git a/pkg/macos/text/font.zig b/pkg/macos/text/font.zig index 845f19d61..a4997503b 100644 --- a/pkg/macos/text/font.zig +++ b/pkg/macos/text/font.zig @@ -47,6 +47,10 @@ pub const Font = opaque { return @ptrCast(@constCast(c.CTFontCopyFontDescriptor(@ptrCast(self)))); } + pub fn copyFeatures(self: *Font) *foundation.Array { + return @ptrCast(@constCast(c.CTFontCopyFeatures(@ptrCast(self)))); + } + pub fn getGlyphCount(self: *Font) usize { return @intCast(c.CTFontGetGlyphCount(@ptrCast(self))); }