mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 07:46:12 +03:00
macos/text: matching font descriptors
This commit is contained in:
@ -11,12 +11,26 @@ pub const FontCollection = opaque {
|
|||||||
foundation.CFRelease(self);
|
foundation.CFRelease(self);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn createMatchingFontDescriptors(self: *FontCollection) *foundation.Array {
|
||||||
|
return CTFontCollectionCreateMatchingFontDescriptors(self);
|
||||||
|
}
|
||||||
|
|
||||||
pub extern "c" fn CTFontCollectionCreateFromAvailableFonts(
|
pub extern "c" fn CTFontCollectionCreateFromAvailableFonts(
|
||||||
options: ?*foundation.Dictionary,
|
options: ?*foundation.Dictionary,
|
||||||
) ?*FontCollection;
|
) ?*FontCollection;
|
||||||
|
pub extern "c" fn CTFontCollectionCreateMatchingFontDescriptors(
|
||||||
|
collection: *FontCollection,
|
||||||
|
) *foundation.Array;
|
||||||
};
|
};
|
||||||
|
|
||||||
test "collection" {
|
test "collection" {
|
||||||
|
const testing = std.testing;
|
||||||
|
|
||||||
const v = try FontCollection.createFromAvailableFonts();
|
const v = try FontCollection.createFromAvailableFonts();
|
||||||
defer v.release();
|
defer v.release();
|
||||||
|
|
||||||
|
const list = v.createMatchingFontDescriptors();
|
||||||
|
defer list.release();
|
||||||
|
|
||||||
|
try testing.expect(list.getCount() > 0);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user