font: fix failing macos tests

This commit is contained in:
Mitchell Hashimoto
2023-10-05 08:08:04 -07:00
parent 26948d2310
commit 7a0b8a6781
2 changed files with 4 additions and 3 deletions

View File

@ -431,6 +431,6 @@ test "coretext" {
try testing.expect(n.len > 0);
// Load it and verify it works
const face = try def.load(lib, .{ .points = 12 });
const face = try def.load(lib, .{ .size = .{ .points = 12 } });
try testing.expect(face.glyphIndex(' ') != null);
}

View File

@ -182,6 +182,7 @@ pub const Face = struct {
pub fn setVariations(
self: *Face,
vs: []const font.face.Variation,
opts: font.face.Options,
) !void {
// Create a new font descriptor with all the variations set.
var desc = self.font.copyDescriptor();
@ -197,7 +198,7 @@ pub const Face = struct {
// Initialize a font based on these attributes.
const ct_font = try self.font.copyWithAttributes(0, null, desc);
errdefer ct_font.release();
const face = try initFont(ct_font);
const face = try initFont(ct_font, opts);
self.deinit();
self.* = face;
}
@ -622,7 +623,7 @@ test "variable set variation" {
try face.setVariations(&.{
.{ .id = font.face.Variation.Id.init("wght"), .value = 400 },
});
}, .{ .size = .{ .points = 12 } });
// Generate all visible ASCII
var i: u8 = 32;