stylix icon indicating copy to clipboard operation
stylix copied to clipboard

Add support for fallback fonts

Open jalil-salame opened this issue 2 years ago • 4 comments

This adds options fallbackFonts and extraPackages to all fonts, allowing for extra fallback fonts.

I needed this because I want a nerd patched font for waybar, but I also want asian characters. This means that I want the nerd font to fall back to a font with asian characters. For example; NotoSans Nerd with fallback on Noto Sans (with cjk support).

I also added a patch to include these fonts into wezterm that natively supports fallback fonts. I do not know if any other programs support that though.

jalil-salame avatar Dec 10 '23 19:12 jalil-salame

I am facing problems (somewhere it's trying to coerce a list to a string). I will mark it as ready once that is fixed.

jalil-salame avatar Dec 10 '23 20:12 jalil-salame

New approach seems to work, it only installs the fallback fonts and adds then to fontconfig fallback. Additional support might be needed in programs like Wezterm and i3/sway. I'll handle that in a different PR if there is interest.

jalil-salame avatar Dec 11 '23 08:12 jalil-salame

Personally I think it would be more elegant to convert the existing options into a list, then assume that the first item is the main choice. Having it that way would promote using fallback fonts whenever possible. However we would need to add backwards compatibility to avoid breaking existing configs. What do you think?

I'll try that, I did something similar before and it backfired 🥲 couldn't figure out the issue.

jalil-salame avatar Dec 19 '23 17:12 jalil-salame

Personally I think it would be more elegant to convert the existing options into a list, then assume that the first item is the main choice. Having it that way would promote using fallback fonts whenever possible. However we would need to add backwards compatibility to avoid breaking existing configs. What do you think?

Just setting it to a list breaks stylix (see comments in #201 ), until we figure out what is causing that there is no way to even think about backwards compatibility.

jalil-salame avatar Dec 20 '23 17:12 jalil-salame

Should this PR be closed by https://github.com/danth/stylix/pull/201 as it supersedes it?

trueNAHO avatar Feb 11 '24 21:02 trueNAHO

Yep, it should, I just forgot about it.

jalil-salame avatar Feb 12 '24 07:02 jalil-salame