NixOS / nixpkgs

Nix Packages collection & NixOS
MIT License
17.01k stars 13.36k forks source link

Installing KDE Plasma overrides user defined defaultFonts #157018

Closed AlyamanMas closed 5 days ago

AlyamanMas commented 2 years ago

Issue

So, I have my own custom set default fonts with fonts.fontconfig.defaultFonts, but since I installed plasma with services.xserver.desktopManager.plasma5.enable = true it has very annoyingly overridden them. I believe this should be changed as the whole point of setting fonts.fontconfig.defaultFonts in your configuration is to change default fonts, without anything overriding them.

I have determined that the issue lies here https://github.com/NixOS/nixpkgs/blob/d0947df00682c44dfa65c53299b63cb52757378b/nixos/modules/services/x11/desktop-managers/plasma5.nix#L377-L382

MarekPasnikowski commented 2 years ago

Do you have the KDE fonts explicitly set to "serif" "sans serif" and "monospace"? Konsole also has its own font configuration separated from the globals.

mainrs commented 2 years ago

I think it's more about expectations vs. reality. By default KDE does not use the fonts specified in the above configuration. But once they're set to the serif, sans serif and monospace, it works a expected.

I had also expected that KDE would use the fonts in fonts.fontconfig.defaultFonts to be honest.

MarekPasnikowski commented 2 years ago

I had also expected that KDE would use the fonts in fonts.fontconfig.defaultFonts to be honest.

KDE upstream would disagree with you, as FontConfig could be set to atrocious defaults in some random distributions. It would be up to NixOS maintainers to change the default.

mainrs commented 2 years ago

I had also expected that KDE would use the fonts in fonts.fontconfig.defaultFonts to be honest.

KDE upstream would disagree with you, as FontConfig could be set to atrocious defaults in some random distributions. It would be up to NixOS maintainers to change the default.

Wouldn't a simple mkDefault fix the issue? In that case users are responsible for setting wrong or bad fonts themselves. And if none is set, the same behaviour as of today would be kept.

MarekPasnikowski commented 2 years ago

I had also expected that KDE would use the fonts in fonts.fontconfig.defaultFonts to be honest.

KDE upstream would disagree with you, as FontConfig could be set to atrocious defaults in some random distributions. It would be up to NixOS maintainers to change the default.

Wouldn't a simple mkDefault fix the issue? In that case users are responsible for setting wrong or bad fonts themselves. And if none is set, the same behaviour as of today would be kept.

I am just clarifying the misconception that upstream should follow the Fontconfig default. I find the current defaults satisfactory.

AlyamanMas commented 2 years ago

Do you have the KDE fonts explicitly set to "serif" "sans serif" and "monospace"? Konsole also has its own font configuration separated from the globals.

It's not about KDE fonts, it's about system-wide fonts. For example $ fc-match 'monospace' always returns Hack-Regular.ttf: "Hack" "Regular" after installing KDE, and every app configured to use the system monospace font will now use Hack despite what defaults fonts I set in my configuration.nix. The whole point of setting fonts.fontconfig.defaultFonts in system configuration is to change system-wide fonts like monospace and installing KDE breaks that.

jansol commented 12 months ago

To add to this, KDE also does not appear to honor the global sub-pixel antialiasing settings. These can of course be fixed on a per-user basis via System Settings, but I have yet to find out how to get that setting to stick on SDDM and the Plasma screenlocker.

FWIW my monitor has a funny pixel layout with W,R,G,B laid out in a diamond pattern so any subpixel antialiasing looks distranctingly awful.

SuperSandro2000 commented 5 days ago

KDE wants to manage the user fonts settings and does so. I don't think we should change the upstream code to honor our system settings at all times as that would just create another issue where people's kde don't settings are not honored. Closing as won't fix.