mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 16:56:09 +03:00
font/fontconfig: adhere to correct function signature
This commit is contained in:
@ -379,6 +379,7 @@ test "fontconfig" {
|
|||||||
|
|
||||||
const discovery = @import("main.zig").discovery;
|
const discovery = @import("main.zig").discovery;
|
||||||
const testing = std.testing;
|
const testing = std.testing;
|
||||||
|
const alloc = testing.allocator;
|
||||||
|
|
||||||
// Load freetype
|
// Load freetype
|
||||||
var lib = try Library.init();
|
var lib = try Library.init();
|
||||||
@ -387,7 +388,7 @@ test "fontconfig" {
|
|||||||
// Get a deferred face from fontconfig
|
// Get a deferred face from fontconfig
|
||||||
var def = def: {
|
var def = def: {
|
||||||
var fc = discovery.Fontconfig.init();
|
var fc = discovery.Fontconfig.init();
|
||||||
var it = try fc.discover(.{ .family = "monospace", .size = 12 });
|
var it = try fc.discover(alloc, .{ .family = "monospace", .size = 12 });
|
||||||
defer it.deinit();
|
defer it.deinit();
|
||||||
break :def (try it.next()).?;
|
break :def (try it.next()).?;
|
||||||
};
|
};
|
||||||
|
@ -835,7 +835,7 @@ test "discover monospace with fontconfig and freetype" {
|
|||||||
|
|
||||||
// Search for fonts
|
// Search for fonts
|
||||||
var fc = Discover.init();
|
var fc = Discover.init();
|
||||||
var it = try fc.discover(.{ .family = "monospace", .size = 12 });
|
var it = try fc.discover(alloc, .{ .family = "monospace", .size = 12 });
|
||||||
defer it.deinit();
|
defer it.deinit();
|
||||||
|
|
||||||
// Initialize the group with the deferred face
|
// Initialize the group with the deferred face
|
||||||
|
@ -234,7 +234,9 @@ pub const Fontconfig = struct {
|
|||||||
|
|
||||||
/// Discover fonts from a descriptor. This returns an iterator that can
|
/// Discover fonts from a descriptor. This returns an iterator that can
|
||||||
/// be used to build up the deferred fonts.
|
/// be used to build up the deferred fonts.
|
||||||
pub fn discover(self: *const Fontconfig, desc: Descriptor) !DiscoverIterator {
|
pub fn discover(self: *const Fontconfig, alloc: Allocator, desc: Descriptor) !DiscoverIterator {
|
||||||
|
_ = alloc;
|
||||||
|
|
||||||
// Build our pattern that we'll search for
|
// Build our pattern that we'll search for
|
||||||
const pat = desc.toFcPattern();
|
const pat = desc.toFcPattern();
|
||||||
errdefer pat.destroy();
|
errdefer pat.destroy();
|
||||||
|
Reference in New Issue
Block a user