font: render sprites with a configurable grid cell width

Fixes #666
This commit is contained in:
Mitchell Hashimoto
2023-10-13 14:31:55 -07:00
parent d66d2c8827
commit 7995d44cfb
6 changed files with 20 additions and 7 deletions

View File

@@ -1364,7 +1364,7 @@ pub fn updateCell(
self.alloc,
font.sprite_index,
@intFromEnum(sprite),
.{},
.{ .cell_width = if (cell.attrs.wide) 2 else 1 },
);
const color = if (cell.attrs.underline_color) cell.underline_fg else colors.fg;
@@ -1421,7 +1421,7 @@ fn addCursor(
self.alloc,
font.sprite_index,
@intFromEnum(sprite),
.{},
.{ .cell_width = if (cell.attrs.wide) 2 else 1 },
) catch |err| {
log.warn("error rendering cursor glyph err={}", .{err});
return null;

View File

@@ -872,7 +872,7 @@ fn addCursor(
self.alloc,
font.sprite_index,
@intFromEnum(sprite),
.{},
.{ .cell_width = if (cell.attrs.wide) 2 else 1 },
) catch |err| {
log.warn("error rendering cursor glyph err={}", .{err});
return null;
@@ -1136,7 +1136,7 @@ pub fn updateCell(
self.alloc,
font.sprite_index,
@intFromEnum(sprite),
.{},
.{ .cell_width = if (cell.attrs.wide) 2 else 1 },
);
const color = if (cell.attrs.underline_color) cell.underline_fg else colors.fg;