mirror of
https://github.com/ghostty-org/ghostty.git
synced 2025-07-14 15:56:13 +03:00
Add new font adjust configs (#2962)
Add keys for adjusting overline position/thickness and box drawing thickness, + docs to each adjust key clarifying what the metric they adjust does.
This commit is contained in:
@ -9,7 +9,7 @@ pub const zsh_completions = comptimeGenerateZshCompletions();
|
||||
|
||||
fn comptimeGenerateZshCompletions() []const u8 {
|
||||
comptime {
|
||||
@setEvalBranchQuota(19000);
|
||||
@setEvalBranchQuota(50000);
|
||||
var counter = std.io.countingWriter(std.io.null_writer);
|
||||
try writeZshCompletions(&counter.writer());
|
||||
|
||||
|
@ -255,12 +255,28 @@ const c = @cImport({
|
||||
/// that things like status lines continue to look aligned.
|
||||
@"adjust-cell-width": ?MetricModifier = null,
|
||||
@"adjust-cell-height": ?MetricModifier = null,
|
||||
/// Distance in pixels from the bottom of the cell to the text baseline.
|
||||
/// Increase to move baseline UP, decrease to move baseline DOWN.
|
||||
@"adjust-font-baseline": ?MetricModifier = null,
|
||||
/// Distance in pixels from the top of the cell to the top of the underline.
|
||||
/// Increase to move underline DOWN, decrease to move underline UP.
|
||||
@"adjust-underline-position": ?MetricModifier = null,
|
||||
/// Thickness in pixels of the underline.
|
||||
@"adjust-underline-thickness": ?MetricModifier = null,
|
||||
/// Distance in pixels from the top of the cell to the top of the strikethrough.
|
||||
/// Increase to move strikethrough DOWN, decrease to move underline UP.
|
||||
@"adjust-strikethrough-position": ?MetricModifier = null,
|
||||
/// Thickness in pixels of the strikethrough.
|
||||
@"adjust-strikethrough-thickness": ?MetricModifier = null,
|
||||
/// Distance in pixels from the top of the cell to the top of the overline.
|
||||
/// Increase to move overline DOWN, decrease to move underline UP.
|
||||
@"adjust-overline-position": ?MetricModifier = null,
|
||||
/// Thickness in pixels of the overline.
|
||||
@"adjust-overline-thickness": ?MetricModifier = null,
|
||||
/// Thickness in pixels of the bar cursor and outlined rect cursor.
|
||||
@"adjust-cursor-thickness": ?MetricModifier = null,
|
||||
/// Thickness in pixels of box drawing characters.
|
||||
@"adjust-box-thickness": ?MetricModifier = null,
|
||||
|
||||
/// The method to use for calculating the cell width of a grapheme cluster.
|
||||
/// The default value is `unicode` which uses the Unicode standard to determine
|
||||
|
@ -427,7 +427,10 @@ pub const DerivedConfig = struct {
|
||||
@"adjust-underline-thickness": ?Metrics.Modifier,
|
||||
@"adjust-strikethrough-position": ?Metrics.Modifier,
|
||||
@"adjust-strikethrough-thickness": ?Metrics.Modifier,
|
||||
@"adjust-overline-position": ?Metrics.Modifier,
|
||||
@"adjust-overline-thickness": ?Metrics.Modifier,
|
||||
@"adjust-cursor-thickness": ?Metrics.Modifier,
|
||||
@"adjust-box-thickness": ?Metrics.Modifier,
|
||||
@"freetype-load-flags": font.face.FreetypeLoadFlags,
|
||||
|
||||
/// Initialize a DerivedConfig. The config should be either a
|
||||
@ -462,7 +465,10 @@ pub const DerivedConfig = struct {
|
||||
.@"adjust-underline-thickness" = config.@"adjust-underline-thickness",
|
||||
.@"adjust-strikethrough-position" = config.@"adjust-strikethrough-position",
|
||||
.@"adjust-strikethrough-thickness" = config.@"adjust-strikethrough-thickness",
|
||||
.@"adjust-overline-position" = config.@"adjust-overline-position",
|
||||
.@"adjust-overline-thickness" = config.@"adjust-overline-thickness",
|
||||
.@"adjust-cursor-thickness" = config.@"adjust-cursor-thickness",
|
||||
.@"adjust-box-thickness" = config.@"adjust-box-thickness",
|
||||
.@"freetype-load-flags" = if (font.face.FreetypeLoadFlags != void) config.@"freetype-load-flags" else {},
|
||||
|
||||
// This must be last so the arena contains all our allocations
|
||||
@ -604,7 +610,10 @@ pub const Key = struct {
|
||||
if (config.@"adjust-underline-thickness") |m| try set.put(alloc, .underline_thickness, m);
|
||||
if (config.@"adjust-strikethrough-position") |m| try set.put(alloc, .strikethrough_position, m);
|
||||
if (config.@"adjust-strikethrough-thickness") |m| try set.put(alloc, .strikethrough_thickness, m);
|
||||
if (config.@"adjust-overline-position") |m| try set.put(alloc, .overline_position, m);
|
||||
if (config.@"adjust-overline-thickness") |m| try set.put(alloc, .overline_thickness, m);
|
||||
if (config.@"adjust-cursor-thickness") |m| try set.put(alloc, .cursor_thickness, m);
|
||||
if (config.@"adjust-box-thickness") |m| try set.put(alloc, .box_thickness, m);
|
||||
break :set set;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user