mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 16:56:09 +03:00
font: fix coretext test issues with harfbuzz shaper
This commit is contained in:
@ -380,32 +380,35 @@ test getIndex {
|
|||||||
var c = try Collection.init(alloc);
|
var c = try Collection.init(alloc);
|
||||||
c.load_options = .{ .library = lib };
|
c.load_options = .{ .library = lib };
|
||||||
|
|
||||||
_ = try c.add(alloc, .regular, .{ .loaded = try Face.init(
|
{
|
||||||
lib,
|
errdefer c.deinit(alloc);
|
||||||
testFont,
|
_ = try c.add(alloc, .regular, .{ .loaded = try Face.init(
|
||||||
.{ .size = .{ .points = 12, .xdpi = 96, .ydpi = 96 } },
|
lib,
|
||||||
) });
|
testFont,
|
||||||
if (font.options.backend != .coretext) {
|
.{ .size = .{ .points = 12, .xdpi = 96, .ydpi = 96 } },
|
||||||
// Coretext doesn't support Noto's format
|
) });
|
||||||
|
if (comptime !font.options.backend.hasCoretext()) {
|
||||||
|
// Coretext doesn't support Noto's format
|
||||||
|
_ = try c.add(
|
||||||
|
alloc,
|
||||||
|
.regular,
|
||||||
|
.{ .loaded = try Face.init(
|
||||||
|
lib,
|
||||||
|
testEmoji,
|
||||||
|
.{ .size = .{ .points = 12 } },
|
||||||
|
) },
|
||||||
|
);
|
||||||
|
}
|
||||||
_ = try c.add(
|
_ = try c.add(
|
||||||
alloc,
|
alloc,
|
||||||
.regular,
|
.regular,
|
||||||
.{ .loaded = try Face.init(
|
.{ .loaded = try Face.init(
|
||||||
lib,
|
lib,
|
||||||
testEmoji,
|
testEmojiText,
|
||||||
.{ .size = .{ .points = 12 } },
|
.{ .size = .{ .points = 12 } },
|
||||||
) },
|
) },
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
_ = try c.add(
|
|
||||||
alloc,
|
|
||||||
.regular,
|
|
||||||
.{ .loaded = try Face.init(
|
|
||||||
lib,
|
|
||||||
testEmojiText,
|
|
||||||
.{ .size = .{ .points = 12 } },
|
|
||||||
) },
|
|
||||||
);
|
|
||||||
|
|
||||||
var r: CodepointResolver = .{ .collection = c };
|
var r: CodepointResolver = .{ .collection = c };
|
||||||
defer r.deinit(alloc);
|
defer r.deinit(alloc);
|
||||||
@ -429,7 +432,7 @@ test getIndex {
|
|||||||
{
|
{
|
||||||
const idx = r.getIndex(alloc, 0x270C, .regular, .text).?;
|
const idx = r.getIndex(alloc, 0x270C, .regular, .text).?;
|
||||||
try testing.expectEqual(Style.regular, idx.style);
|
try testing.expectEqual(Style.regular, idx.style);
|
||||||
const text_idx = if (font.options.backend == .coretext) 1 else 2;
|
const text_idx = if (comptime font.options.backend.hasCoretext()) 1 else 2;
|
||||||
try testing.expectEqual(@as(Collection.Index.IndexInt, text_idx), idx.idx);
|
try testing.expectEqual(@as(Collection.Index.IndexInt, text_idx), idx.idx);
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
|
@ -1213,7 +1213,7 @@ fn testShaperWithFont(alloc: Allocator, font_req: TestFont) !TestShaper {
|
|||||||
.{ .size = .{ .points = 12 } },
|
.{ .size = .{ .points = 12 } },
|
||||||
) });
|
) });
|
||||||
|
|
||||||
if (font.options.backend != .coretext) {
|
if (comptime !font.options.backend.hasCoretext()) {
|
||||||
// Coretext doesn't support Noto's format
|
// Coretext doesn't support Noto's format
|
||||||
_ = try c.add(alloc, .regular, .{ .loaded = try Face.init(
|
_ = try c.add(alloc, .regular, .{ .loaded = try Face.init(
|
||||||
lib,
|
lib,
|
||||||
|
Reference in New Issue
Block a user