mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-25 13:16:11 +03:00
metal: support for box glyphs
This commit is contained in:
@ -408,6 +408,12 @@ pub fn setFontSize(self: *Metal, size: font.face.DesiredSize) !void {
|
|||||||
if (std.meta.eql(self.cell_size, new_cell_size)) return;
|
if (std.meta.eql(self.cell_size, new_cell_size)) return;
|
||||||
self.cell_size = new_cell_size;
|
self.cell_size = new_cell_size;
|
||||||
|
|
||||||
|
// Set the cell size of the box font
|
||||||
|
if (self.font_group.group.box_font) |*box| {
|
||||||
|
box.width = @floatToInt(u32, self.cell_size.width);
|
||||||
|
box.height = @floatToInt(u32, self.cell_size.height);
|
||||||
|
}
|
||||||
|
|
||||||
// Notify the window that the cell size changed.
|
// Notify the window that the cell size changed.
|
||||||
_ = self.window_mailbox.push(.{
|
_ = self.window_mailbox.push(.{
|
||||||
.cell_size = new_cell_size,
|
.cell_size = new_cell_size,
|
||||||
@ -880,8 +886,11 @@ pub fn updateCell(
|
|||||||
);
|
);
|
||||||
|
|
||||||
// If we're rendering a color font, we use the color atlas
|
// If we're rendering a color font, we use the color atlas
|
||||||
const face = try self.font_group.group.faceFromIndex(shaper_run.font_index);
|
const presentation = try self.font_group.group.presentationFromIndex(shaper_run.font_index);
|
||||||
const mode: GPUCellMode = if (face.presentation == .emoji) .fg_color else .fg;
|
const mode: GPUCellMode = switch (presentation) {
|
||||||
|
.text => .fg,
|
||||||
|
.emoji => .fg_color,
|
||||||
|
};
|
||||||
|
|
||||||
self.cells.appendAssumeCapacity(.{
|
self.cells.appendAssumeCapacity(.{
|
||||||
.mode = mode,
|
.mode = mode,
|
||||||
|
@ -967,7 +967,7 @@ pub fn updateCell(
|
|||||||
|
|
||||||
// If we're rendering a color font, we use the color atlas
|
// If we're rendering a color font, we use the color atlas
|
||||||
const presentation = try self.font_group.group.presentationFromIndex(shaper_run.font_index);
|
const presentation = try self.font_group.group.presentationFromIndex(shaper_run.font_index);
|
||||||
var mode: GPUCellMode = switch (presentation) {
|
const mode: GPUCellMode = switch (presentation) {
|
||||||
.text => .fg,
|
.text => .fg,
|
||||||
.emoji => .fg_color,
|
.emoji => .fg_color,
|
||||||
};
|
};
|
||||||
|
Reference in New Issue
Block a user