mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-08-02 14:57:31 +03:00
macos: create descriptors from URL
This commit is contained in:
@ -1,6 +1,7 @@
|
|||||||
pub usingnamespace @import("text/font.zig");
|
pub usingnamespace @import("text/font.zig");
|
||||||
pub usingnamespace @import("text/font_collection.zig");
|
pub usingnamespace @import("text/font_collection.zig");
|
||||||
pub usingnamespace @import("text/font_descriptor.zig");
|
pub usingnamespace @import("text/font_descriptor.zig");
|
||||||
|
pub usingnamespace @import("text/font_manager.zig");
|
||||||
|
|
||||||
test {
|
test {
|
||||||
@import("std").testing.refAllDecls(@This());
|
@import("std").testing.refAllDecls(@This());
|
||||||
|
13
pkg/macos/text/font_manager.zig
Normal file
13
pkg/macos/text/font_manager.zig
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
const std = @import("std");
|
||||||
|
const Allocator = std.mem.Allocator;
|
||||||
|
const foundation = @import("../foundation.zig");
|
||||||
|
const c = @import("c.zig");
|
||||||
|
|
||||||
|
pub fn createFontDescriptorsFromURL(url: *foundation.URL) ?*foundation.Array {
|
||||||
|
return @intToPtr(
|
||||||
|
?*foundation.Array,
|
||||||
|
@ptrToInt(c.CTFontManagerCreateFontDescriptorsFromURL(
|
||||||
|
@ptrCast(c.CFURLRef, url),
|
||||||
|
)),
|
||||||
|
);
|
||||||
|
}
|
Reference in New Issue
Block a user