mirror of
https://github.com/ghostty-org/ghostty.git
synced 2026-04-19 22:10:29 +00:00
font: unify metrics calculations & separate sprite metrics
Unify grid metrics calculations by relying on shared logic mostly based on values directly from the font tables, this deduplicates a lot of code and gives us more control over how we interpret various metrics. Also separate metrics for underlined, strikethrough, and overline thickness and position, and box drawing thickness, so that they can individually be adjusted as the user desires.
This commit is contained in:
@@ -122,13 +122,7 @@ fn reloadMetrics(self: *SharedGrid) !void {
|
||||
self.metrics = face.metrics;
|
||||
|
||||
// Setup our sprite font.
|
||||
self.resolver.sprite = .{
|
||||
.width = self.metrics.cell_width,
|
||||
.height = self.metrics.cell_height,
|
||||
.thickness = self.metrics.underline_thickness,
|
||||
.underline_position = self.metrics.underline_position,
|
||||
.strikethrough_position = self.metrics.strikethrough_position,
|
||||
};
|
||||
self.resolver.sprite = .{ .metrics = self.metrics };
|
||||
}
|
||||
|
||||
/// Returns the grid cell size.
|
||||
|
||||
Reference in New Issue
Block a user