coretext: rasterization looking cleaner

This commit is contained in:
Mitchell Hashimoto
2023-06-30 14:47:59 -07:00
parent 079fe7bc94
commit 552a1b51d0
3 changed files with 170 additions and 16 deletions

View File

@@ -26,6 +26,27 @@ pub fn Context(comptime T: type) type {
);
}
pub fn setAllowsFontSmoothing(self: *T, v: bool) void {
c.CGContextSetAllowsFontSmoothing(
@ptrCast(self),
v,
);
}
pub fn setAllowsFontSubpixelPositioning(self: *T, v: bool) void {
c.CGContextSetAllowsFontSubpixelPositioning(
@ptrCast(self),
v,
);
}
pub fn setAllowsFontSubpixelQuantization(self: *T, v: bool) void {
c.CGContextSetAllowsFontSubpixelQuantization(
@ptrCast(self),
v,
);
}
pub fn setShouldAntialias(self: *T, v: bool) void {
c.CGContextSetShouldAntialias(
@ptrCast(self),
@@ -40,6 +61,20 @@ pub fn Context(comptime T: type) type {
);
}
pub fn setShouldSubpixelPositionFonts(self: *T, v: bool) void {
c.CGContextSetShouldSubpixelPositionFonts(
@ptrCast(self),
v,
);
}
pub fn setShouldSubpixelQuantizeFonts(self: *T, v: bool) void {
c.CGContextSetShouldSubpixelQuantizeFonts(
@ptrCast(self),
v,
);
}
pub fn setGrayFillColor(self: *T, gray: f64, alpha: f64) void {
c.CGContextSetGrayFillColor(
@ptrCast(self),