wez / wezterm

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

Font rendering on external monitor is not correct (macOS) #3575

Open asapkep opened 1 year ago

asapkep commented 1 year ago

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

macOS

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

No response

WezTerm version

wezterm 20230420-215209-70d809fa

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

When configuring wezterm to utilize MonoLisa nerd font, the font rendering on an external 1920x1080 display is not correct. When moving the terminal window back to M1 retina display, the font issue disappears. My wezterm.lua config is very basic and only has lines for font size and font currently.

The first screenshot illustrates the issue: Screenshot 2023-04-21 at 11 27 08 AM

The following screenshot shows the issue disappearing when on native macbook screen:

Screenshot 2023-04-21 at 11 27 38 AM

The issue doesn't occur with the default font however. The issue also doesn't arise on other emulators like Kitty.

To Reproduce

On an external display utilizing the MonoLisa font.

Configuration

local wezterm = require("wezterm")

return { font = wezterm.font("MonoLisa Nerd Font Mono"), font_size = 14, }

Expected Behavior

The font "crispness" should be consistent between the two monitors

Logs

No response

Anything else?

No response

wez commented 1 year ago

If you resize the window, does it get sharper?

Please open the debug overlay (CTRL-SHIFT-L) and then input:

> wezterm.gui.screens()

and share the output

What resolution/scaling do you have configured for that display in the macOS display settings?

asapkep commented 1 year ago

If you resize the window, does it get sharper?

Please open the debug overlay (CTRL-SHIFT-L) and then input:

> wezterm.gui.screens()

and share the output

What resolution/scaling do you have configured for that display in the macOS display settings?

Resizing the window doesn't have any effect on the font rendering, unfortunately. Making the window larger gives me more room to read but the font size stays the same and so no effect.

The output of the above-mentioned command is:

{
    "active": {
        "height": 1080,
        "max_fps": 75,
        "name": "K273",
        "scale": 1,
        "width": 1920,
        "x": 1800,
        "y": 89,
    },
    "by_name": {
        "Built-in Retina Display": {
            "height": 2338,
            "max_fps": 120,
            "name": "Built-in Retina Display",
            "scale": 1,
            "width": 3600,
            "x": 0,
            "y": 0,
        },
        "K273": {
            "height": 1080,
            "max_fps": 75,
            "name": "K273",
            "scale": 1,
            "width": 1920,
            "x": 1800,
            "y": 89,
        },
    },
    "main": {
        "height": 2338,
        "max_fps": 120,
        "name": "Built-in Retina Display",
        "scale": 1,
        "width": 3600,
        "x": 0,
        "y": 0,
    },
    "origin_x": 0,
    "origin_y": 0,
    "virtual_height": 2338,
    "virtual_width": 3720,
}

I have the default resolution for the 14 in M1 pro with the scaling set to "more space". From the output of the command you mentioned, it looks like the scale is set to 1 for both monitors.

I have tried adding the dpi flag within the config based on your documentation (96 and 144 I believe) and although this fixes the issue I notice that the font itself is not mono. For example, there is noticeable space between the e and t in wezterm (kind of like we zterm although its not as extreme as how it looks here in my example)

EDIT: The issue is not local to neovim but rather all text within the terminal.

wez commented 7 months ago

Please try the latest nightly build and let me know if this is still an issue!