raphamorim / rio

A hardware-accelerated GPU terminal emulator focusing to run in desktops and browsers.
https://raphamorim.io/rio
MIT License
4.01k stars 129 forks source link

[Bug]: some parts of fonts are not renderd correcly #583

Closed timon-schelling closed 3 months ago

timon-schelling commented 3 months ago

Some parts of my font are now broken with d86ec56ab17629d4add2f75c50d8e676f7e9d0c4.

In this video on the left d86ec56ab17629d4add2f75c50d8e676f7e9d0c4 on the right v0.0.39:

https://github.com/user-attachments/assets/9b76e413-3db3-4302-b528-e25edfd7b62c

Environment of both processes is identical. Did font loading change in some way?

Font related config:

[fonts]
family = "JetBrainsMono Nerd Font"
size = 24

[fonts.regular]
weight = 600
raphamorim commented 3 months ago

Thanks for the issue @timon-schelling!

What's your OS? (I assume is linux right?)

timon-schelling commented 3 months ago

Yes Linux (NixOS)

raphamorim commented 3 months ago

Yea, the issue is similar to a problem we discussed on Discord. Rio doesn't add or load symbols/unicode on linux. We have been discussing the best way to address this issue, an idea would be the package manager install the font for you and Rio just loads it.

But for your case you can simply add on your configuration file

[fonts]
extras = [{ family = "The name of the symbol font installed" }]
timon-schelling commented 3 months ago

Ok, will try that and get back to you later. What changed between v0.0.39 and v0.1.4 in font loading? Did older versions load UTF-8 symbols?

raphamorim commented 3 months ago

What changed between v0.0.39 and v0.1.4 in font loading? Did older versions load UTF-8 symbols?

Rio used to load DejavuSans and chrysanthi-unicode-font that got builtin in the app: https://github.com/raphamorim/rio/tree/0.0.x/sugarloaf/src/font/resources . But those fonts were removed from the source code. Currently we only have three fallback fonts for linux but I believe more will be added https://github.com/raphamorim/rio/blob/dc11bc7d2f709e88ae37279c7adf8812f54fbf01/sugarloaf/src/font/fallbacks/mod.rs#L24-L31

timon-schelling commented 3 months ago

Thanks, I'll close this issue once I got your solution to work. :)

dreamfliper commented 1 month ago

I'm facing the same problem, it shows the symbol but a bit miss aligned :{

macos 15.0.1

[fonts]
family = "JetBrainsMono Nerd Font"
extras = [{ family = "CaskaydiaCove Nerd Font Mono" }]
Screenshot 2024-10-18 at 4 36 22 PM
timon-schelling commented 1 month ago

For me it also reappeared.

timon-schelling commented 1 month ago

I think you should create a new issue for the misalignment

raphamorim commented 1 month ago

That's weird. I cannot reproduce it, but yes please create a new issue 🙏

Screenshot 2024-10-18 at 13 52 07