mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 16:56:09 +03:00
font: fix failing macos tests
This commit is contained in:
@ -431,6 +431,6 @@ test "coretext" {
|
|||||||
try testing.expect(n.len > 0);
|
try testing.expect(n.len > 0);
|
||||||
|
|
||||||
// Load it and verify it works
|
// 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);
|
try testing.expect(face.glyphIndex(' ') != null);
|
||||||
}
|
}
|
||||||
|
@ -182,6 +182,7 @@ pub const Face = struct {
|
|||||||
pub fn setVariations(
|
pub fn setVariations(
|
||||||
self: *Face,
|
self: *Face,
|
||||||
vs: []const font.face.Variation,
|
vs: []const font.face.Variation,
|
||||||
|
opts: font.face.Options,
|
||||||
) !void {
|
) !void {
|
||||||
// Create a new font descriptor with all the variations set.
|
// Create a new font descriptor with all the variations set.
|
||||||
var desc = self.font.copyDescriptor();
|
var desc = self.font.copyDescriptor();
|
||||||
@ -197,7 +198,7 @@ pub const Face = struct {
|
|||||||
// Initialize a font based on these attributes.
|
// Initialize a font based on these attributes.
|
||||||
const ct_font = try self.font.copyWithAttributes(0, null, desc);
|
const ct_font = try self.font.copyWithAttributes(0, null, desc);
|
||||||
errdefer ct_font.release();
|
errdefer ct_font.release();
|
||||||
const face = try initFont(ct_font);
|
const face = try initFont(ct_font, opts);
|
||||||
self.deinit();
|
self.deinit();
|
||||||
self.* = face;
|
self.* = face;
|
||||||
}
|
}
|
||||||
@ -622,7 +623,7 @@ test "variable set variation" {
|
|||||||
|
|
||||||
try face.setVariations(&.{
|
try face.setVariations(&.{
|
||||||
.{ .id = font.face.Variation.Id.init("wght"), .value = 400 },
|
.{ .id = font.face.Variation.Id.init("wght"), .value = 400 },
|
||||||
});
|
}, .{ .size = .{ .points = 12 } });
|
||||||
|
|
||||||
// Generate all visible ASCII
|
// Generate all visible ASCII
|
||||||
var i: u8 = 32;
|
var i: u8 = 32;
|
||||||
|
Reference in New Issue
Block a user