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

22
pkg/fontconfig/test.zig Normal file
View File

@@ -0,0 +1,22 @@
const std = @import("std");
const fontconfig = @import("main.zig");
test "fc-list" {
const testing = std.testing;
var cfg = fontconfig.initLoadConfigAndFonts();
defer cfg.destroy();
var pat = fontconfig.Pattern.create();
defer pat.destroy();
var os = fontconfig.ObjectSet.create();
defer os.destroy();
var fs = cfg.list(pat, os);
defer fs.destroy();
// Note: this is environmental, but in general we expect all our
// testing environments to have at least one font.
try testing.expect(fs.len() > 0);
}