-
-
Notifications
You must be signed in to change notification settings - Fork 12.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nixos/steam: add option extraPackages
fontPackages
, fix CJK fonts on client
#312268
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Slight wording change
Please just add those two packages unconditionally into the standard Steam fhsenv, and please check if |
Is there an easy way to test this locally? I don't see anything wrong with that screenshot. |
I set |
And adding the font to the fhsenv actually makes it work? Can you run |
This doesn't work for me. Feel free to check https://store.steampowered.com/app/1647250/KUUKIYOMI_3_Consider_It_More_and_More__Father_to_Son/ as an example. If I use both |
And in case of not providing, steam is still Tofu block. |
Adding the fonts to the fhsenv just make steam to pick up a lucky font , still not following font-config. It was discussed in #302862 (comment) . @CoelacanthusHex reports that steam follows font-config on her Arch Linux, that's sth. weird on NixOS...... |
log.txt fontconfig = {
defaultFonts = {
emoji = [
"Source Han Serif SC"
"JetBrainsMono Nerd Font"
"Noto Color Emoji"
];
monospace = [
"Source Han Serif SC"
"Sarasa Mono SC"
"JetBrainsMono Nerd Font Mono"
];
sansSerif = [ "Source Han Serif SC" ];
serif = [ "Source Han Serif SC" ];
};
cache32Bit = true;
}; |
Steam query Arial font instead generic font sans-serif from fontconfig. You can set fallback font for Arial to enforce steam use it. <test name="prgname" compare="contains" ignore-blanks="true">
<string>steam</string>
</test> |
That is still wrong. Please add the packages directly to the fhsenv. |
Can you drop the reformat change? There's likely going to be a treewide format at some point, and it's going to cause merge conflicts on other changes. |
nixos/modules/programs/steam.nix
Outdated
description = '' | ||
Font packages to use in Steam. | ||
|
||
Defaults to system fonts, but could be overridden to use other fonts — useful for users who would like to customize CJK fonts used in Steam. According to the [upstream issue](https://github.com/ValveSoftware/steam-for-linux/issues/10422#issuecomment-1944396010), steam only follows the fontconfig in user's home. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, small nitpicks: "Steam" should be capitalized, and "fontconfig" isn't entirely accurate. Maybe just remove that sentence entirely?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, my English is poor. But I think we do need to notice users somewhere.
The Steam's behavior is irregular(not read system-side fontconfig). Users may not notice that. They may not use home-manager
or these things to config user-side fontconfig, and just believe that steam don't follows fontconfig at all. Then they may use varity kinds of hack to fix it in a worse way.
For example, introducing the whole fonts.packages
to Steam without user-side fontconfig seems to broken the Japanese if they install a 「草书」font, or something even weirder happens in other languages.
related discussion: #302862 (comment)
CJK fonts and display are indeed a very difficult problem. Apart from the speakers of the language themselves, even we don't know how to satisfy each other, or what problems the fonts we use will cause for each other.
All right, let's merge it and we can iterate later. Thanks! |
Actually the current version doesn't pass EditorConfig. Please fix that. |
Re-tested on my computer, all looks good |
Apologize, fixed |
extraPackages
, fix CJK fonts on clientextraPackages
fontPackages
, fix CJK fonts on client
Successfully created backport PR for |
This caused a build failure for me:
probably caused by my config:
Which adds
|
I found it a history of 17 years not changed…… Do we really need to use it like these today in 2024...... CC @edolstra |
Description of changes
programs.steam.extraPackages
to add to the Steam environment.config.fonts.packages
toextraPackages
to fix all Chinese and Japanese text in the Steam interface display as boxes ("tofu"). As we use the existing fonts on the system, this avoids closure impact. It was first came up by nixos/steam: support using system fonts in Steam interface #302591 that reverted by Revert "nixos/steam: ensure Steam picks up font packages" #302748Add dependencies required by gamescope, to fix undefined symbols in X11 session. Came up by @BillHuang2001 in Packaging Request: GameScope #162562 (comment) .- fix steam: gamescope fails to launch when used from within steam #214275nixos/modules/programs/steam.nix
bynixfmt-rfc-style
programs.steam.fontPackages
, just let user to choose whatever font they like, to end argue in nixos/steam: include fonts from system #302862This PR has tested on my machine.
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)CC:
Add a 👍 reaction to pull requests you find important.