mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 07:46:12 +03:00
23 lines
660 B
Zig
23 lines
660 B
Zig
const std = @import("std");
|
|
const Allocator = std.mem.Allocator;
|
|
const foundation = @import("../foundation.zig");
|
|
|
|
pub const FontCollection = opaque {
|
|
pub fn createFromAvailableFonts() Allocator.Error!*FontCollection {
|
|
return CTFontCollectionCreateFromAvailableFonts(null) orelse Allocator.Error.OutOfMemory;
|
|
}
|
|
|
|
pub fn release(self: *FontCollection) void {
|
|
foundation.CFRelease(self);
|
|
}
|
|
|
|
pub extern "c" fn CTFontCollectionCreateFromAvailableFonts(
|
|
options: ?*foundation.Dictionary,
|
|
) ?*FontCollection;
|
|
};
|
|
|
|
test "collection" {
|
|
const v = try FontCollection.createFromAvailableFonts();
|
|
defer v.release();
|
|
}
|