fontconfig: font list

This commit is contained in:
Mitchell Hashimoto
2022-09-14 10:14:09 -07:00
parent ce899dca11
commit eb2ce495b3
6 changed files with 40 additions and 3 deletions

View File

@@ -1,8 +1,19 @@
const std = @import("std");
const c = @import("c.zig");
const FontSet = @import("font_set.zig").FontSet;
const ObjectSet = @import("object_set.zig").ObjectSet;
const Pattern = @import("pattern.zig").Pattern;
pub const Config = opaque {
pub fn destroy(self: *Config) void {
c.FcConfigDestroy(@ptrCast(*c.struct__FcConfig, self));
}
pub fn list(self: *Config, pat: *Pattern, os: *ObjectSet) *FontSet {
return @ptrCast(*FontSet, c.FcFontList(self.cval(), pat.cval(), os.cval()));
}
pub inline fn cval(self: *Config) *c.struct__FcConfig {
return @ptrCast(*c.struct__FcConfig, self);
}
};