mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-16 08:46:08 +03:00
update to API
This commit is contained in:
@ -95,6 +95,8 @@ pub const Face = struct {
|
||||
var bounding: [1]macos.graphics.Rect = undefined;
|
||||
_ = self.font.getBoundingRectForGlyphs(.horizontal, &glyphs, &bounding);
|
||||
const glyph_width = @floatToInt(u32, @ceil(bounding[0].size.width));
|
||||
const glyph_height = @floatToInt(u32, @ceil(bounding[0].size.height));
|
||||
_ = glyph_height;
|
||||
const width = @floatToInt(u32, self.metrics.cell_width);
|
||||
const height = @floatToInt(u32, self.metrics.cell_height);
|
||||
|
||||
@ -110,6 +112,8 @@ pub const Face = struct {
|
||||
.advance_x = 0,
|
||||
};
|
||||
|
||||
//std.log.warn("bound={}", .{bounding[0]});
|
||||
|
||||
// Get the advance that we need for the glyph
|
||||
var advances: [1]macos.graphics.Size = undefined;
|
||||
_ = self.font.getAdvancesForGlyphs(.horizontal, &glyphs, &advances);
|
||||
@ -130,10 +134,12 @@ pub const Face = struct {
|
||||
8,
|
||||
width,
|
||||
space,
|
||||
@enumToInt(macos.graphics.BitmapInfo.alpha_mask) &
|
||||
@enumToInt(macos.graphics.ImageAlphaInfo.none),
|
||||
);
|
||||
defer ctx.release();
|
||||
|
||||
ctx.setShouldAntialias(true);
|
||||
ctx.setShouldAntialias(false);
|
||||
ctx.setShouldSmoothFonts(false);
|
||||
ctx.setGrayFillColor(1, 1);
|
||||
ctx.setGrayStrokeColor(1, 1);
|
||||
|
Reference in New Issue
Block a user