mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-25 13:16:11 +03:00
font: share skew matrix for core text
This commit is contained in:
@ -75,16 +75,7 @@ pub const CoreText = struct {
|
|||||||
|
|
||||||
/// Auto-italicize the font by applying a skew.
|
/// Auto-italicize the font by applying a skew.
|
||||||
pub fn italicize(self: *const CoreText) !CoreText {
|
pub fn italicize(self: *const CoreText) !CoreText {
|
||||||
const skew = macos.graphics.AffineTransform{
|
const ct_font = try self.font.copyWithAttributes(0.0, &Face.italic_skew, null);
|
||||||
.a = 1,
|
|
||||||
.b = 0,
|
|
||||||
.c = 0.267949, // approx. tan(15)
|
|
||||||
.d = 1,
|
|
||||||
.tx = 0,
|
|
||||||
.ty = 0,
|
|
||||||
};
|
|
||||||
|
|
||||||
const ct_font = try self.font.copyWithAttributes(0.0, &skew, null);
|
|
||||||
errdefer ct_font.release();
|
errdefer ct_font.release();
|
||||||
return .{ .font = ct_font };
|
return .{ .font = ct_font };
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user