mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 07:46:12 +03:00

* update zig * pkg/fontconfig: clean up @as * pkg/freetype,harfbuzz: clean up @as * pkg/imgui: clean up @as * pkg/macos: clean up @as * pkg/pixman,utf8proc: clean up @as * clean up @as * lots more @as cleanup * undo flatpak changes * clean up @as
44 lines
800 B
Zig
44 lines
800 B
Zig
const std = @import("std");
|
|
const c = @import("c.zig");
|
|
const Config = @import("config.zig").Config;
|
|
|
|
pub fn init() bool {
|
|
return c.FcInit() == c.FcTrue;
|
|
}
|
|
|
|
pub fn fini() void {
|
|
c.FcFini();
|
|
}
|
|
|
|
pub fn initLoadConfig() *Config {
|
|
return @ptrCast(c.FcInitLoadConfig());
|
|
}
|
|
|
|
pub fn initLoadConfigAndFonts() *Config {
|
|
return @ptrCast(c.FcInitLoadConfigAndFonts());
|
|
}
|
|
|
|
pub fn version() u32 {
|
|
return @intCast(c.FcGetVersion());
|
|
}
|
|
|
|
test "version" {
|
|
const testing = std.testing;
|
|
try testing.expect(version() > 0);
|
|
}
|
|
|
|
test "init" {
|
|
try std.testing.expect(init());
|
|
defer fini();
|
|
}
|
|
|
|
test "initLoadConfig" {
|
|
var config = initLoadConfig();
|
|
defer config.destroy();
|
|
}
|
|
|
|
test "initLoadConfigAndFonts" {
|
|
var config = initLoadConfigAndFonts();
|
|
defer config.destroy();
|
|
}
|