mirror of
https://github.com/wez/wezterm.git
synced 2024-12-24 13:52:55 +03:00
config: add line_height config option
The default is 1.0. `line_height` is used to scale the effective cell height, increasing the amount of space between font baselines. refs: https://github.com/wez/wezterm/discussions/387
This commit is contained in:
parent
c948fff0d2
commit
0ae494fb94
@ -460,6 +460,9 @@ pub struct Config {
|
||||
#[serde(default = "default_font_size")]
|
||||
pub font_size: f64,
|
||||
|
||||
#[serde(default = "default_one_point_oh_f64")]
|
||||
pub line_height: f64,
|
||||
|
||||
#[serde(default)]
|
||||
pub allow_square_glyphs_to_overflow_width: AllowSquareGlyphOverflow,
|
||||
|
||||
@ -827,6 +830,10 @@ pub struct Config {
|
||||
pub enable_csi_u_key_encoding: bool,
|
||||
}
|
||||
|
||||
fn default_one_point_oh_f64() -> f64 {
|
||||
1.0
|
||||
}
|
||||
|
||||
fn default_one_point_oh() -> f32 {
|
||||
1.0
|
||||
}
|
||||
|
@ -28,6 +28,7 @@ brief notes about them may accumulate here.
|
||||
* Revised pty output processing and removed the related `ratelimit_output_bytes_per_second` option
|
||||
* Workaround Cocoa leaking window position saved state file descriptors to child processes on macOS Big Sur
|
||||
* The 256 color cube now uses slightly brighter colors [#348](https://github.com/wez/wezterm/issues/348)
|
||||
* New: added `line_height` configuration option to scale the computed cell height. The default is `1.0`, resulting in using the font-specified metrics. Setting it to `1.2` will result in a 20% larger cell height.
|
||||
|
||||
### 20201101-103216-403d002d
|
||||
|
||||
|
@ -28,6 +28,15 @@ return {
|
||||
-- emulators, you may wish to tune this value!
|
||||
dpi = 96.0,
|
||||
|
||||
-- (available in nightly builds)
|
||||
-- Scale the effective cell height.
|
||||
-- The cell height is computed based on your selected font_size
|
||||
-- and dpi and then multiplied by line_height. Setting it to
|
||||
-- eg: 1.2 will result in the spacing between lines being 20%
|
||||
-- larger than the distance specified by the font author.
|
||||
-- Setting it to eg: 0.9 will make it 10% smaller.
|
||||
line_height = 1.0,
|
||||
|
||||
-- When true (the default), text that is set to ANSI color
|
||||
-- indices 0-7 will be shifted to the corresponding brighter
|
||||
-- color index (8-15) when the intensity is set to Bold.
|
||||
|
@ -2,6 +2,7 @@ use super::glyphcache::GlyphCache;
|
||||
use ::window::bitmaps::atlas::{OutOfTextureSpace, Sprite};
|
||||
use ::window::bitmaps::{BitmapImage, Image, Texture2d};
|
||||
use ::window::*;
|
||||
use config::configuration;
|
||||
use std::rc::Rc;
|
||||
use termwiz::surface::CursorShape;
|
||||
use wezterm_font::units::*;
|
||||
@ -24,8 +25,10 @@ impl RenderMetrics {
|
||||
.default_font_metrics()
|
||||
.expect("failed to get font metrics!?");
|
||||
|
||||
let line_height = configuration().line_height;
|
||||
|
||||
let (cell_height, cell_width) = (
|
||||
metrics.cell_height.get().ceil() as usize,
|
||||
(metrics.cell_height.get() * line_height).ceil() as usize,
|
||||
metrics.cell_width.get().ceil() as usize,
|
||||
);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user