[SOLVED] Root and system applications don't respect font settings

Please post suggestions for improvement of Cinnamon on:
https://github.com/linuxmint/Cinnamon
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
turambar
Level 1
Level 1
Posts: 11
Joined: Sun Nov 04, 2018 2:37 pm

[SOLVED] Root and system applications don't respect font settings

Post by turambar »

Hi. After upgrade from Linux Mint 18.3 to 19 i have a problem with font settings: In all system application e.g. notifications applet, menu, bottom bar and in all apps with root privilege e.g. Synaptic i have terrible ugly fonts with no anti-aliasing. In standard apps for example nemo, chrome etc fonts look exactly as I set in font settings. To better illustrate the problem I attach screenshot the same app in standard privilege (proper fonts appearance) and with root privilege (ugly fonts appearance). Does anyone have an idea how to solve the problem?
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
User avatar
trytip
Level 14
Level 14
Posts: 5367
Joined: Tue Jul 05, 2016 1:20 pm

Re: Root and system applications don't respect font settings

Post by trytip »

i honestly can't tell the different in the pictures, but then again my eye sight is getting older. if anything i think your root fonts look more antialiased than the non-root
but any way first thing to try is to refresh the font cache
delete ALL files in /var/cache/fontconfig/ and in .cache then open Terminal and run sudo fc-cache -f -v
Image
User avatar
Flemur
Level 20
Level 20
Posts: 10096
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Root and system applications don't respect font settings

Post by Flemur »

Linux fonts are a real mess - freedesktop.org strikes again.
But both your images show RGB anti-aliasing (no-root on the left, root on the right):
noroot_root.jpg
File names:
noroot_root2.jpg
It looks like the difference is in the "hinting", which can make the fonts look fatter/skinnier.

Each user might have this file
~/.config/fontconfig/fonts.conf
which can make the fonts look different for different users.
("~" = /root or /home/username)

Look for a prolix line that looks like:
<edit mode="assign" name="hintstyle"><const>hintslight</const></edit>


Edit: here's mine (user left, root right).
I set gray anti-aliasing (rgba=none) with (what I guess is) the system settings, then have "rgb" set in the fonts.conf file:
user_root.jpg
Just to make things interesting, I'm running fluxbox, and some - not all! - programs use the settings in ~/.xsettingsd (and the /usr/bin/xsettingsd demon/service)

Code: Select all

Xft/Hinting 1
Xft/HintStyle "hintslight"
Xft/RGBA "none"
# Xft/RGBA "rgb"
Last edited by Flemur on Tue Nov 06, 2018 10:17 am, edited 1 time in total.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
gm10

Re: Root and system applications don't respect font settings

Post by gm10 »

trytip wrote: Tue Nov 06, 2018 9:07 am i honestly can't tell the different in the pictures, but then again my eye sight is getting older. if anything i think your root fonts look more antialiased than the non-root
but any way first thing to try is to refresh the font cache
delete ALL files in /var/cache/fontconfig/ and in .cache then open Terminal and run sudo fc-cache -f -v
Heh, I'm not sure if we've got better or worse eyes:
Screenshot at 2018-11-06 14-38-27.png
Left side is admin, right side is regular. Same as you, I liked the left side better (at regular size), the extreme anti-aliasing on the right (regular user) isn't for me.

Anyway, I suppose depending on how you launch a root browser it might get launched under the root profile's anti-aliasing settings. Although I wasn't aware that you could have different settings applied on the same desktop. But hey, I can't see it, anyway, without a magnifying glass. :lol:

edit: huh, hadn't seen Flemur's post.
User avatar
trytip
Level 14
Level 14
Posts: 5367
Joined: Tue Jul 05, 2016 1:20 pm

Re: Root and system applications don't respect font settings

Post by trytip »

the fonts in mint19 have less hinting even though i have the same desktop and same font settings. also the cinnamon settings hinting doesn't work so when i am in mint19 i use xfce now.
mint19
Image

arch linux
Image

i use the same .fontconfig/fonts.conf in both arch and mint19 but in mint19 had to add 97 dpi to slightly boost fontsize. meh it's almost perfect, don't think i can get any better

Code: Select all

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
  <match target="font" >
    <edit mode="assign" name="autohint">  <bool>true</bool></edit>
    <edit mode="assign" name="hinting">   <bool>false</bool></edit>
    <edit mode="assign" name="lcdfilter"> <const>lcddefault</const></edit>
    <edit mode="assign" name="hintstyle"> <const>hintslight</const></edit>
    <edit mode="assign" name="antialias"> <bool>true</bool></edit>
    <edit mode="assign" name="rgba">      <const>rgb</const></edit>
  </match>

  <match target="font">
    <test name="pixelsize" qual="any" compare="more"><double>15</double></test>
    <edit mode="assign" name="lcdfilter"><const>lcdlight</const></edit>
    <edit mode="assign" name="hintstyle"><const>hintnone</const></edit>
  </match>

  <match target="font">
    <test name="weight" compare="more"><const>medium</const></test>
    <edit mode="assign" name="hintstyle"><const>hintnone</const></edit>
    <edit mode="assign" name="lcdfilter"><const>lcdlight</const></edit>
  </match>

  <match target="font">
    <test name="slant"  compare="not_eq"><double>0</double></test>
    <edit mode="assign" name="hintstyle"><const>hintnone</const></edit>
    <edit mode="assign" name="lcdfilter"><const>lcdlight</const></edit>
  </match>

  <match target="font">
    <edit name="antialias" mode="assign"><bool>true</bool></edit>
    <edit name="hinting" mode="assign"><bool>true</bool></edit>
    <edit name="hintstyle" mode="assign"><const>hintfull</const></edit>
    <edit name="lcdfilter" mode="assign"><const>lcddefault</const></edit>
    <edit name="rgba" mode="assign"><const>rgb</const></edit>
  </match>

  <match target="pattern">
    <edit name="dpi" mode="assign"><double>97</double></edit>
  </match>
</fontconfig>
Image
User avatar
Flemur
Level 20
Level 20
Posts: 10096
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Root and system applications don't respect font settings

Post by Flemur »

I copied
.config/fontconfig/fonts.conf
from user-home to /root and now the file browser fonts look the same for user and root.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
User avatar
trytip
Level 14
Level 14
Posts: 5367
Joined: Tue Jul 05, 2016 1:20 pm

Re: Root and system applications don't respect font settings

Post by trytip »

@Flemur
doing that will not affect anything. i don't have a fonts.conf in root and my root apps are the same as user

the only time you will need fonts.conf in root is if you logOFF your user then logIN as root , but i wouldn't advise anyone doing that unless you know how to not populate .config files
Image
gm10

Re: Root and system applications don't respect font settings

Post by gm10 »

I don't have a fonts.conf at all, I wasn't even sure that was still being read with dconf/gsettings the default now.
User avatar
trytip
Level 14
Level 14
Posts: 5367
Joined: Tue Jul 05, 2016 1:20 pm

Re: Root and system applications don't respect font settings

Post by trytip »

slowly i see more and more updates not touching my old config files that are spread all over the root and home. there's no way for me to know which are now obsolete , redundant or just conflicting. i keep the fonts.conf in case some apps need it. seems there a battle between GTK and QT desktops and they both want to do things their way.
didn't even know they already started working on GTK4 around 2016 who knows what mess that will bring when they decide to switch to that
Image
gm10

Re: Root and system applications don't respect font settings

Post by gm10 »

trytip wrote: Tue Nov 06, 2018 12:59 pm slowly i see more and more updates not touching my old config files that are spread all over the root and home. there's no way for me to know which are now obsolete , redundant or just conflicting. i keep the fonts.conf in case some apps need it. seems there a battle between GTK and QT desktops and they both want to do things their way.
didn't even know they already started working on GTK4 around 2016 who knows what mess that will bring when they decide to switch to that
I hear you. Frankly those config (and other) files all over the place is probably the thing I often find the most infuriating about about Linux systems. We've got GNOME's dconf as a Windows registry adjacent, freedesktop.orgs various attempts at some standardization, ~/.config as a mostly ignored idea and a reality of programs littering their stuff all over your system.

And the GTK vs QT thing will probably keep going in the direction that a number of desktops do it now by combining the both of them. GTK is way too inflexible about some things and GTK4 will be the same mess all over again as far as that goes, but it has the advantage of being built around a full desktop environment, whereas Qt is more general purpose. Therefore we'll see more of GTK/GNOME infrastructure with Qt GUI. Depends a bit on where the Wayland thing goes, too, although that is slightly stillborn tbh, I hope someone pushes the boundary a bit more instead.
User avatar
smurphos
Level 18
Level 18
Posts: 8498
Joined: Fri Sep 05, 2014 12:18 am
Location: Irish Brit in Portugal
Contact:

Re: Root and system applications don't respect font settings

Post by smurphos »

GTK 4 will coexist with GTK 3.x in the same way that 3.x currently coexists with GTK 2.x, so there isn't going to be immediate breakage when it gets to a stable release and most DE's will likely have a mix of GTK4, GTK3, GTK2 and QT apps. It will be a big headache for GTK themers who will need to maintain 3 to 4 different GTK themes in one theme package and developers will need to decide at what point they want to migrate their applications to GTK 4.
For custom Nemo actions, useful scripts for the Cinnamon desktop, and Cinnamox themes visit my Github pages.
turambar
Level 1
Level 1
Posts: 11
Joined: Sun Nov 04, 2018 2:37 pm

Re: Root and system applications don't respect font settings

Post by turambar »

1) sudo fc-cache -f -v doesn't cause any changes
2) In fact the problem is not in anti-aliasing but in the hinting.
3) In Linux Mint 19 there is no fontconfig folder in ~/.config
gm10

Re: Root and system applications don't respect font settings

Post by gm10 »

turambar wrote: Tue Nov 06, 2018 4:31 pm 3) In Linux Mint 19 there is no fontconfig folder in ~/.config
The folder is ~/.fontconfig.
turambar
Level 1
Level 1
Posts: 11
Joined: Sun Nov 04, 2018 2:37 pm

Re: Root and system applications don't respect font settings

Post by turambar »

Unfortunately in Linux Mint 19 (in my case, perhaps it is cause by upgrade from 18.3 to 19) there is no fontconfig folder in any location in home directory.
gm10

Re: Root and system applications don't respect font settings

Post by gm10 »

turambar wrote: Tue Nov 06, 2018 5:00 pm Unfortunately in Linux Mint 19 (in my case, perhaps it is cause by upgrade from 18.3 to 19) there is no fontconfig folder in any location in home directory.
I believe their suggestion was for you to create it along with the configuration file. As I said above, by default those settings are configured in the dconf database, that's why that folder wouldn't exist by default.
User avatar
Flemur
Level 20
Level 20
Posts: 10096
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

Re: Root and system applications don't respect font settings

Post by Flemur »

trytip wrote: Tue Nov 06, 2018 12:02 pm @Flemur
doing that [copying fonts.conf, I suppose] will not affect anything.
Well, it did affect anything. I checked. It's not theoretical. Now the root and user fonts are the same, and before copying they were different.

[/quote]i don't have a fonts.conf in root and my root apps are the same as user[/quote]
That makes sense.
the only time you will need fonts.conf in root is if you logOFF
I create the font config file because it improves the font rendering under 'wine'.
Please edit your original post title to include [SOLVED] if/when it is solved!
Your data and OS are backed up....right?
User avatar
trytip
Level 14
Level 14
Posts: 5367
Joined: Tue Jul 05, 2016 1:20 pm

Re: Root and system applications don't respect font settings

Post by trytip »

@Flemur i added it to root in case, thanx for reminder

@turambar
in your home directory create a folder call it .fontconfig then open it and create a blank text file name it fonts.conf
open the text file paste this in there:

Code: Select all

<?xml version='1.0'?>
<!DOCTYPE fontconfig SYSTEM 'fonts.dtd'>
<fontconfig>
  <match target="font" >
    <edit mode="assign" name="autohint">  <bool>true</bool></edit>
    <edit mode="assign" name="hinting">   <bool>false</bool></edit>
    <edit mode="assign" name="lcdfilter"> <const>lcddefault</const></edit>
    <edit mode="assign" name="hintstyle"> <const>hintslight</const></edit>
    <edit mode="assign" name="antialias"> <bool>true</bool></edit>
    <edit mode="assign" name="rgba">      <const>rgb</const></edit>
  </match>

  <match target="font">
    <test name="pixelsize" qual="any" compare="more"><double>15</double></test>
    <edit mode="assign" name="lcdfilter"><const>lcdlight</const></edit>
    <edit mode="assign" name="hintstyle"><const>hintnone</const></edit>
  </match>

  <match target="font">
    <test name="weight" compare="more"><const>medium</const></test>
    <edit mode="assign" name="hintstyle"><const>hintnone</const></edit>
    <edit mode="assign" name="lcdfilter"><const>lcdlight</const></edit>
  </match>

  <match target="font">
    <test name="slant"  compare="not_eq"><double>0</double></test>
    <edit mode="assign" name="hintstyle"><const>hintnone</const></edit>
    <edit mode="assign" name="lcdfilter"><const>lcdlight</const></edit>
  </match>

  <match target="font">
    <edit name="antialias" mode="assign"><bool>true</bool></edit>
    <edit name="hinting" mode="assign"><bool>true</bool></edit>
    <edit name="hintstyle" mode="assign"><const>hintfull</const></edit>
    <edit name="lcdfilter" mode="assign"><const>lcddefault</const></edit>
    <edit name="rgba" mode="assign"><const>rgb</const></edit>
  </match>

  <match target="pattern">
    <edit name="dpi" mode="assign"><double>97</double></edit>
  </match>
</fontconfig>
after saving .fontconfig/fonts.conf open Terminal and run sudo fc-cache -f -v loggOFF/ON you should have better fonts
Image
turambar
Level 1
Level 1
Posts: 11
Joined: Sun Nov 04, 2018 2:37 pm

Re: Root and system applications don't respect font settings

Post by turambar »

@trytip
Unfortunately, your solution doesn't affect root apps. I will try with fresh installation and we will see.
User avatar
trytip
Level 14
Level 14
Posts: 5367
Joined: Tue Jul 05, 2016 1:20 pm

Re: Root and system applications don't respect font settings

Post by trytip »

try copying the .fontconfig folder from your home directory to the/root/
Image
turambar
Level 1
Level 1
Posts: 11
Joined: Sun Nov 04, 2018 2:37 pm

Re: Root and system applications don't respect font settings

Post by turambar »

Still nothing changes.
Locked

Return to “Cinnamon”