wez / wezterm

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

Unicode #5051

Closed stribor14 closed 1 month ago

stribor14 commented 4 months ago

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

Linux X11

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

Ubuntu 20.04.6 LTS Budgie Desktop 10.5.1

WezTerm version

wezterm 20240203-110809-5046fc22

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

Unicode "Symbols for Legacy Computing" are no rendered correctly. Here is an example screenshot with Guake, Kitty and WezTerm

image

When custom_block_glyphs = true, some blocks are internally handled by wezterm, but some are still from font. But even when I fully switch to font (i.e. = false), It is not drawn correctly

Output with = true

LeftToRight
 0 🭉    \u{1fb49}    x_adv=12.5 cells=1  glyph=11633 wezterm.font("Symbola", {weight="Regular", stretch="SemiCondensed", style="Normal"})
                                      /home/mirko/.local/share/fonts/Symbola-13.otf, FontConfig
 4 🭂    \u{1fb42}    x_adv=12.5 cells=1  glyph=11626 wezterm.font("Symbola", {weight="Regular", stretch="SemiCondensed", style="Normal"})
                                      /home/mirko/.local/share/fonts/Symbola-13.otf, FontConfig
 8 🭀    \u{1fb40}    drawn by wezterm because custom_block_glyphs=true: Poly([Poly { path: [MoveTo(Zero, Zero), LineTo(Zero, One), LineTo(Frac(1, 2), One), Close], intensity: Full, style: Fill }])
12 🭁    \u{1fb41}    x_adv=12.5 cells=1  glyph=11625 wezterm.font("Symbola", {weight="Regular", stretch="SemiCondensed", style="Normal"})
                                      /home/mirko/.local/share/fonts/Symbola-13.otf, FontConfig
16 🭝    \u{1fb5d}    x_adv=12.5 cells=1  glyph=11653 wezterm.font("Symbola", {weight="Regular", stretch="SemiCondensed", style="Normal"})
                                      /home/mirko/.local/share/fonts/Symbola-13.otf, FontConfig
20 🮄    \u{1fb84}    drawn by wezterm because custom_block_glyphs=true: Edges([Upper(5)])
24 🭚    \u{1fb5a}    x_adv=12.5 cells=1  glyph=11650 wezterm.font("Symbola", {weight="Regular", stretch="SemiCondensed", style="Normal"})
                                      /home/mirko/.local/share/fonts/Symbola-13.otf, FontConfig

To Reproduce

echo '\U1fb49\U1fb42\U1fb40\n\U1fb41\U1fb5d\U1fb84\U1fb5a'

Configuration

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

-- This will hold the configuration. local config = wezterm.config_builder()

-- This is where you actually apply your config choices

-- For example, changing the color scheme: config.custom_block_glyphs = true -- INFO: neither true/false works correctly -- config.font_size = 24.0 -- config.use_cap_height_to_scale_fallback_fonts = true config.color_scheme = 'OneHalfDark'

config.font = wezterm.font 'FiraCode Nerd Font' config.font = wezterm.font_with_fallback { 'Fira Code Nerd Font', 'Symbola', }

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

Expected Behavior

No response

Logs

No response

Anything else?

No response

stribor14 commented 4 months ago

I think the problem is with Symbola having stretch = SemiCondensed, so I tried:

config.font = wezterm.font_with_fallback {
  { family = 'FiraCode Nerd Font', stretch = 'Normal'},
  { family = 'Symbola', stretch = 'Normal'},
}

Still, the ls-fonts --text ... says that Symbola has 'strech = SemiCondensed'

stribor14 commented 4 months ago

Additional, when added some normal letters to ls-fonts:

LeftToRight
 0 🭉    \u{1fb49}    x_adv=11 cells=1  glyph=u1FB49,74   wezterm.font("LegacyComputing", {weight="Regular", stretch="Normal", style="Normal"})
                                      /home/mirko/.local/share/fonts/LegacyComputing.otf, FontConfig
 4 🭂    \u{1fb42}    x_adv=10.3125 cells=1  glyph=u1FB42,67   wezterm.font("LegacyComputing", {weight="Regular", stretch="Normal", style="Normal"})
                                      /home/mirko/.local/share/fonts/LegacyComputing.otf, FontConfig
 8 🭀    \u{1fb40}    x_adv=11 cells=1  glyph=u1FB40,65   wezterm.font("LegacyComputing", {weight="Regular", stretch="Normal", style="Normal"})
                                      /home/mirko/.local/share/fonts/LegacyComputing.otf, FontConfig
12 🭁    \u{1fb41}    x_adv=10.3125 cells=1  glyph=u1FB41,66   wezterm.font("LegacyComputing", {weight="Regular", stretch="Normal", style="Normal"})
                                      /home/mirko/.local/share/fonts/LegacyComputing.otf, FontConfig
16 🭝    \u{1fb5d}    x_adv=10.3125 cells=1  glyph=u1FB5D,94   wezterm.font("LegacyComputing", {weight="Regular", stretch="Normal", style="Normal"})
                                      /home/mirko/.local/share/fonts/LegacyComputing.otf, FontConfig
20 🮄    \u{1fb84}    x_adv=10.3125 cells=1  glyph=u1FB84,133  wezterm.font("LegacyComputing", {weight="Regular", stretch="Normal", style="Normal"})
                                      /home/mirko/.local/share/fonts/LegacyComputing.otf, FontConfig
24 🭚    \u{1fb5a}    x_adv=10.3125 cells=1  glyph=u1FB5A,91   wezterm.font("LegacyComputing", {weight="Regular", stretch="Normal", style="Normal"})
                                      /home/mirko/.local/share/fonts/LegacyComputing.otf, FontConfig
28 Z    \u{5a}       x_adv=9  cells=1  glyph=Z,125  wezterm.font("Fira Code", {weight=450, stretch="Normal", style="Normal"})
                                      /home/mirko/.local/share/fonts/FiraCode-Retina.ttf, FontConfig
29 Y    \u{59}       x_adv=9  cells=1  glyph=Y,120  wezterm.font("Fira Code", {weight=450, stretch="Normal", style="Normal"})
                                      /home/mirko/.local/share/fonts/FiraCode-Retina.ttf, FontConfig
30 X    \u{58}       x_adv=9  cells=1  glyph=X,119  wezterm.font("Fira Code", {weight=450, stretch="Normal", style="Normal"})
                                      /home/mirko/.local/share/fonts/FiraCode-Retina.ttf, FontConfig

We can see that x_adv variable changes, while when ls-fonts is run with only unicode characters, the x_adv is always 12.5

wez commented 1 month ago

Fixed in 1dd5d6deac760a4542a3212d34f4e3c8e2e0f910

github-actions[bot] commented 3 weeks ago

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.