font: autoitalic should only apply to text presentation

Fixes #1256
This commit is contained in:
Mitchell Hashimoto
2024-01-08 07:57:42 -08:00
parent 4498bb77f3
commit ab606c6cfd

View File

@ -265,11 +265,16 @@ pub fn italicize(self: *Group) !void {
const list = self.faces.get(.regular); const list = self.faces.get(.regular);
if (list.items.len == 0) return; if (list.items.len == 0) return;
// The font must be loaded. // Find our first font that is text.
break :regular try self.faceFromIndex(.{ for (0..list.items.len) |i| {
.style = .regular, const face = try self.faceFromIndex(.{
.idx = 0, .style = .regular,
}); .idx = @intCast(i),
});
if (face.presentation == .text) break :regular face;
}
return;
}; };
// Try to italicize it. // Try to italicize it.