mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-23 12:16:11 +03:00
renderer/opengl: support font size change
This commit is contained in:
@ -590,41 +590,13 @@ pub fn setFocus(self: *OpenGL, focus: bool) !void {
|
|||||||
/// Set the new font size.
|
/// Set the new font size.
|
||||||
///
|
///
|
||||||
/// Must be called on the render thread.
|
/// Must be called on the render thread.
|
||||||
pub fn setFontSize(self: *OpenGL, size: font.face.DesiredSize) !void {
|
pub fn setFontGrid(self: *OpenGL, grid: *font.SharedGrid) void {
|
||||||
_ = self;
|
if (single_threaded_draw) self.draw_mutex.lock();
|
||||||
_ = size;
|
defer if (single_threaded_draw) self.draw_mutex.unlock();
|
||||||
if (true) @panic("TODO"); // TODO(fontmem)
|
|
||||||
//
|
// Defer our GPU updates
|
||||||
// if (single_threaded_draw) self.draw_mutex.lock();
|
self.deferred_font_size = .{ .metrics = grid.metrics };
|
||||||
// defer if (single_threaded_draw) self.draw_mutex.unlock();
|
self.grid_metrics = grid.metrics;
|
||||||
//
|
|
||||||
// log.info("set font size={}", .{size});
|
|
||||||
//
|
|
||||||
// // Set our new size, this will also reset our font atlas.
|
|
||||||
// try self.font_group.setSize(size);
|
|
||||||
//
|
|
||||||
// // Reset our GPU uniforms
|
|
||||||
// const metrics = try resetFontMetrics(
|
|
||||||
// self.alloc,
|
|
||||||
// self.font_group,
|
|
||||||
// self.config.font_thicken,
|
|
||||||
// );
|
|
||||||
//
|
|
||||||
// // Defer our GPU updates
|
|
||||||
// self.deferred_font_size = .{ .metrics = metrics };
|
|
||||||
//
|
|
||||||
// // Recalculate our cell size. If it is the same as before, then we do
|
|
||||||
// // nothing since the grid size couldn't have possibly changed.
|
|
||||||
// if (std.meta.eql(self.grid_metrics, metrics)) return;
|
|
||||||
// self.grid_metrics = metrics;
|
|
||||||
//
|
|
||||||
// // Notify the window that the cell size changed.
|
|
||||||
// _ = self.surface_mailbox.push(.{
|
|
||||||
// .cell_size = .{
|
|
||||||
// .width = metrics.cell_width,
|
|
||||||
// .height = metrics.cell_height,
|
|
||||||
// },
|
|
||||||
// }, .{ .forever = {} });
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The primary render callback that is completely thread-safe.
|
/// The primary render callback that is completely thread-safe.
|
||||||
|
Reference in New Issue
Block a user