rio icon indicating copy to clipboard operation
rio copied to clipboard

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

Open timon-schelling opened this issue 1 year ago • 2 comments

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

timon-schelling avatar Aug 08 '24 12:08 timon-schelling

Thanks for the issue @timon-schelling!

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

raphamorim avatar Aug 08 '24 14:08 raphamorim

Yes Linux (NixOS)

timon-schelling avatar Aug 08 '24 14:08 timon-schelling

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" }]

raphamorim avatar Aug 14 '24 18:08 raphamorim

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?

timon-schelling avatar Aug 14 '24 18:08 timon-schelling

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

raphamorim avatar Aug 14 '24 18:08 raphamorim

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

timon-schelling avatar Aug 14 '24 19:08 timon-schelling

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

dreamfliper avatar Oct 18 '24 08:10 dreamfliper

For me it also reappeared.

timon-schelling avatar Oct 18 '24 09:10 timon-schelling

I think you should create a new issue for the misalignment

timon-schelling avatar Oct 18 '24 09:10 timon-schelling

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

Screenshot 2024-10-18 at 13 52 07

raphamorim avatar Oct 18 '24 11:10 raphamorim