diff --git a/pkg/macos/text/font_collection.zig b/pkg/macos/text/font_collection.zig index 7de026f29..9335c7658 100644 --- a/pkg/macos/text/font_collection.zig +++ b/pkg/macos/text/font_collection.zig @@ -11,12 +11,26 @@ pub const FontCollection = opaque { foundation.CFRelease(self); } + pub fn createMatchingFontDescriptors(self: *FontCollection) *foundation.Array { + return CTFontCollectionCreateMatchingFontDescriptors(self); + } + pub extern "c" fn CTFontCollectionCreateFromAvailableFonts( options: ?*foundation.Dictionary, ) ?*FontCollection; + pub extern "c" fn CTFontCollectionCreateMatchingFontDescriptors( + collection: *FontCollection, + ) *foundation.Array; }; test "collection" { + const testing = std.testing; + const v = try FontCollection.createFromAvailableFonts(); defer v.release(); + + const list = v.createMatchingFontDescriptors(); + defer list.release(); + + try testing.expect(list.getCount() > 0); }