wez / wezterm

A GPU-accelerated cross-platform terminal emulator and multiplexer written by @wez and implemented in Rust
https://wezfurlong.org/wezterm/
Other
16.34k stars 724 forks source link

`config.line_height` cause weird behaviour #3893

Open eval-exec opened 1 year ago

eval-exec commented 1 year ago

What Operating System(s) are you seeing this problem on?

Linux X11

Which Wayland compositor or X11 Window manager(s) are you using?

No response

WezTerm version

20230408-112425-69ae8472

Did you try the latest nightly build to see if the issue is better (or worse!) than your current version?

Yes, and I updated the version box above to show the version of the nightly that I tried

Describe the bug

I have this in ~/.wezterm.lua:

config.font = wezterm.font 'Noto Sans Mono'
config.font_size = 7
config.line_height = 0.9

Look, it's weird, letter c and o didn't in same line image But, if I change config.font_size to 10, it seems good: image

To Reproduce

  1. put this in your ~/.wezterm.lua:
    
    -- Pull in the wezterm API
    local wezterm = require 'wezterm'

-- This table will hold the configuration. local config = {}

-- In newer versions of wezterm, use the config_builder which will -- help provide clearer error messages if wezterm.config_builder then config = wezterm.config_builder() end

-- This is where you actually apply your config choices

-- For example, changing the color scheme: -- config.color_scheme = 'AdventureTime' config.font = wezterm.font 'Noto Sans Mono' config.font_size = 10 config.line_height = 0.9 -- config.color_scheme = 'Builtin Dark' -- config.hide_tab_bar_if_only_one_tab = true

-- and finally, return the configuration to wezterm return config


2. change `config.font_size` to `9`, then `8`, then `7`, weired thing will happen

### Configuration

-- Pull in the wezterm API
local wezterm = require 'wezterm'

-- This table will hold the configuration.
local config = {}

-- In newer versions of wezterm, use the config_builder which will
-- help provide clearer error messages
if wezterm.config_builder then
  config = wezterm.config_builder()
end

-- This is where you actually apply your config choices

-- For example, changing the color scheme:
-- config.color_scheme = 'AdventureTime'
config.font = wezterm.font 'Noto Sans Mono'
config.font_size = 10
config.line_height = 0.9
-- config.color_scheme = 'Builtin Dark'
-- config.hide_tab_bar_if_only_one_tab = true

-- and finally, return the configuration to wezterm
return config

### Expected Behavior

I expect characters should be in same line.

### Logs

_No response_

### Anything else?

_No response_
SilverMira commented 1 year ago

Seeing the same, line_height is causing letters to dance up and down image image

There seems to be sweet spots where things look right again image

wez commented 1 year ago

Try setting config.freetype_load_flags = 'NO_HINTING'

SilverMira commented 12 months ago

Does not seem to work for my case image

jesseleite commented 9 months ago

Not sure the cause is known yet, but just for reference this is probably related to https://github.com/wez/wezterm/discussions/4091

Also see https://github.com/wez/wezterm/issues/4096, which was an attempt at a workaround using dpi-per-screen settings, but even this hasn't quite fixed the font rendering issue for me 🙏