rio icon indicating copy to clipboard operation
rio copied to clipboard

Wrong unicode character alignment

Open TornaxO7 opened this issue 1 year ago • 7 comments

Rio isn't displaying the lines from a TUI-file manager correctly: image

This is how it looks like in alacritty:

image

Reproduction steps

  1. Install yazi
  2. Open it up by executing yazi
  3. See the results

TornaxO7 avatar Aug 28 '24 07:08 TornaxO7

echo "│\n│\n│" is enough to reproduce for me. Seems like it's rendering the lines as semi-transparent, and overlap makes it darker.

VOID404 avatar Aug 28 '24 07:08 VOID404

Stupid bots

peepoRage

TornaxO7 avatar Aug 28 '24 07:08 TornaxO7

@qiliq could you link the other issue? Does it describe actual solution? The link seems to be for windows :/

VOID404 avatar Aug 28 '24 07:08 VOID404

Screenshot from 2024-09-08 15-39-54

I am seeing alignment issues with block characters. Font is Victor Mono Nerd Font. Left is rio and right is kitty for comparison.

sharph avatar Sep 08 '24 19:09 sharph

image I have the Same issue I think. It causes black lines above my powerline prompt as well as dark lines to appear in my shiny charizard.

wulfalpha avatar Sep 28 '24 18:09 wulfalpha

I have the similar issue using lualine on Neo Vim in MacOs.

Top is Alacritty, bottom is Rio. Font is SF Mono for Powerline.

Screenshot 2024-09-30 at 15 09 46

It also shows the Nerd Font icons from starship.rs differently. Again, Alacritty top, Rio bottom:

Screenshot 2024-09-30 at 15 33 01 Screenshot 2024-09-30 at 15 33 23

Rio config
theme = 'catppuccin-mocha'
padding-x = 1
padding-y = [1, 1]

option-as-alt = 'both'

[fonts]
family = "SF Mono Powerline"
size = 13

[fonts.regular]
family = "SF Mono Powerline"
style = "Normal"
weight = 600

[fonts.emoji]
family = "Apple Color Emoji"
style = "Normal"

[navigation]
use-current-path = true
mode = "NativeTab"

[renderer]
performance = "High"
backend = "Metal"
disable-unfocused-render = false

[window]
decorations = "Enabled"
Rio Version
❯ rio --version
rioterm 0.1.16

cvortmann avatar Sep 30 '24 13:09 cvortmann

Yes, sorry about that. The issue is that Rio isn’t resizing the other fonts to respect the dimensions of the main font. I plan to work on that after finish the split support #691 (which I am currently working on)

raphamorim avatar Sep 30 '24 19:09 raphamorim

Finally will start seeing this 👌

raphamorim avatar Jan 12 '25 16:01 raphamorim

I don't know if this is the same issue, but the visual effect is the same.

In my case, I'm only using a single font -- Fira Code -- so it's not an interaction between different fonts. I have to scale my font sizes up by 2 points to get similar sizes to font point sizes in other terminals, and I see both the overlap, but also gaps between blocks. In the attached screenshot, we have Rio in the upper left, Alacritty in the upper right, and ghostty in the lower left. They're each showing their config on the left, cava in the upper right, and xprop showing which terminal they are.

Note that the Rio font size has to be 16 and is still slightly smaller than 14 point font sizes in Alacritty and Ghostty. We see the overlap on the bars that other people display in this ticket, but also note that, in Cava, there's space around each character box in Rio that doesn't show up in other terminals. Finally, while it's difficult to eyeball this, Fira Code doesn't look quite right in Rio.

Other things I've noticed is that, while Fira Code does have Bold styles, if I try to use them in Rio it complains that only "Regular" and "Italic" are available; it's the same if I use "FiraCode Nerd Font" or "Go Mono" -- while Rio can find the fonts, it doesn't recognize most of the styles. Despite not understanding the style, the "weight" attribute is clearly working. This is probably an unrelated issue, but it's making me suspicious about Rio's font handling.

Finally, I also tried wezterm and saw similar behavior to ghostty -- everything looks fine in wezterm. FWIW, I uninstalled wezterm because -- just running cava -- wezterm consumed 43% of the CPU; ghostty came in at 24%, rio at 14%, and Alacritty at 7%. However, I'm running an Alacritty supporting sixel, Alacritty doesn't support ligatures and is so not at feature parity with the others.

Image

xxxserxxx avatar Mar 11 '25 17:03 xxxserxxx

Is this the same issue? I'm seeing sometimes eza output with icons (nerdfont symbols) gets truncated at the right side:

Image

[fonts]
size = 24
family = "Andysevka Term"
hinting = false
extras = [
  { family = "Symbols Nerd Font Mono" },
]
features = ["frac"]

Font File Links:

AndydeCleyre avatar Apr 03 '25 20:04 AndydeCleyre

The last one is different, yours is https://github.com/raphamorim/rio/issues/1011 that i am fixing soon.

The one from @TornaxO7 i am fixing in this PR #980 (that i already got working locally)

raphamorim avatar Apr 03 '25 20:04 raphamorim

@raphamorim For giggles, I compiled from your branch and have been playing with it. tmux seems to be working well; I ran cava and it crashed with:

thread 'main' panicked at frontends/rioterm/src/renderer/mod.rs:366:29:
Could not find '▁'
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

But, progress!

xxxserxxx avatar Apr 08 '25 21:04 xxxserxxx

haha yes!! I added that panic to help me match which characters are missing!

thanks for testing

raphamorim avatar Apr 08 '25 21:04 raphamorim

Folks, please help me testing that branch as well 🙏

raphamorim avatar Apr 12 '25 18:04 raphamorim

Fixed for most of the issues mentioned here.

Merged into main but will keep iterating in a second PR (adding more box characters)

raphamorim avatar Apr 12 '25 22:04 raphamorim

Installed on Arch from AUR rio-git, it says it's version 0.2.13.

Everything looks great! tmux divisions, gotop glyphs, cava bars, btop, Unicode characters (é, ŭ), and ligatures. Looks great!

xxxserxxx avatar Apr 17 '25 00:04 xxxserxxx

I've been having some issues with glyphs in my tmux status bar but after updating to 0.3.0-nightly everything renders perfectly. Great work @raphamorim! ❤️

bombsimon avatar Apr 17 '25 07:04 bombsimon

Posted a video on youtube to talk very quickly about the changes: https://www.youtube.com/watch?v=c47cFF2k8_0

Still some stuff to be added: sextants, fix antialising for arc and few missing characters

raphamorim avatar Apr 17 '25 13:04 raphamorim

@raphamorim I'm still seeing some very subtle issues with cava; it may be related to refresh rate? Here's a short video, but you can also see it in any frame:

Image

It should be easy for you to reproduce: just run cava and play some music.

The artifact, you'll notice, is that in some of the bars the very top of the bar has subtle boxing around the glyphs.

I haven't noticed any other drawing effects in TUIs -- gotop, btop, tmux -- which use Unicode glyphs, and I wonder if it's an artifact of the speed at which cava is drawing these. In any case, I'm really pleased with this latest patch, but thought you'd like to be aware of this edge case.

xxxserxxx avatar Apr 18 '25 09:04 xxxserxxx

It should be easy for you to reproduce: just run cava and play some music.

Nice thank you! Will do it

raphamorim avatar Apr 18 '25 09:04 raphamorim