mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-19 05:50:27 +00:00
fontconfig: font list
This commit is contained in:
22
pkg/fontconfig/test.zig
Normal file
22
pkg/fontconfig/test.zig
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user