Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Line height should be configurable #388

Open
colemickens opened this issue Dec 16, 2024 · 1 comment
Open

Line height should be configurable #388

colemickens opened this issue Dec 16, 2024 · 1 comment

Comments

@colemickens
Copy link

I really love cosmic-term. I think y'all are using a custom renderer, but wow does the text look great compared to my otherwise-normal-daily-driver Alacritty.

however, the line height seems a bit high. There are are a number of applications that render graphics or text in a way where it's noticeable that cosmic-term's line height is taller than other terminal applications.

It would be great if it were customizable, or generally lower by default to match other terms and the expectations of some TUI applications.

@leb-kuchen
Copy link
Contributor

Here is the relevant code if you are willing to change the values ​​and compile Cosmic Terminal.

cosmic-term/src/terminal.rs

Lines 272 to 290 in 0cc5c3d

let (cell_width, cell_height) = {
let mut font_system = font_system().write().unwrap();
let font_system = font_system.raw();
buffer.set_wrap(font_system, Wrap::None);
// Use size of space to determine cell size
buffer.set_text(font_system, " ", default_attrs, Shaping::Advanced);
let layout = buffer.line_layout(font_system, 0).unwrap();
let w = layout[0].w;
buffer.set_monospace_width(font_system, Some(w));
(w, metrics.line_height)
};
let size = Size {
width: (80.0 * cell_width).ceil() as u32,
height: (24.0 * cell_height).ceil() as u32,
cell_width,
cell_height,
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants