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

Please post suggestions for improvement of Cinnamon here
https://github.com/linuxmint/Cinnamon
turambar
Level 1
Level 1
Posts: 7
Joined: Sun Nov 04, 2018 2:37 pm

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

Post by turambar » Tue Nov 06, 2018 7:25 am

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?
Attachments
nomo no root.png
nemo root.png
Last edited by turambar on Mon Nov 19, 2018 7:37 am, edited 1 time in total.

User avatar
trytip
Level 8
Level 8
Posts: 2476
Joined: Tue Jul 05, 2016 1:20 pm

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

Post by trytip » 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
Image

User avatar
Flemur
Level 16
Level 16
Posts: 6271
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

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

Post by Flemur » Tue Nov 06, 2018 9:35 am

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?
Mint 18.3 Xfce/fluxbox/pulse-less
Xubuntu 17.10/fluxbox/pulse-less

gm10
Level 13
Level 13
Posts: 4552
Joined: Thu Jun 21, 2018 5:11 pm

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

Post by gm10 » Tue Nov 06, 2018 9:41 am

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
Screenshot at 2018-11-06 14-38-27.png (8.93 KiB) Viewed 432 times
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 8
Level 8
Posts: 2476
Joined: Tue Jul 05, 2016 1:20 pm

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

Post by trytip » Tue Nov 06, 2018 10:27 am

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 16
Level 16
Posts: 6271
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

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

Post by Flemur » Tue Nov 06, 2018 11:04 am

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?
Mint 18.3 Xfce/fluxbox/pulse-less
Xubuntu 17.10/fluxbox/pulse-less

User avatar
trytip
Level 8
Level 8
Posts: 2476
Joined: Tue Jul 05, 2016 1:20 pm

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

Post by trytip » Tue Nov 06, 2018 12:02 pm

@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
Level 13
Level 13
Posts: 4552
Joined: Thu Jun 21, 2018 5:11 pm

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

Post by gm10 » Tue Nov 06, 2018 12:06 pm

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 8
Level 8
Posts: 2476
Joined: Tue Jul 05, 2016 1:20 pm

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

Post by trytip » 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
Image

gm10
Level 13
Level 13
Posts: 4552
Joined: Thu Jun 21, 2018 5:11 pm

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

Post by gm10 » Tue Nov 06, 2018 1:16 pm

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 8
Level 8
Posts: 2215
Joined: Fri Sep 05, 2014 12:18 am
Location: Britisher...

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

Post by smurphos » Tue Nov 06, 2018 2:17 pm

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.

turambar
Level 1
Level 1
Posts: 7
Joined: Sun Nov 04, 2018 2:37 pm

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

Post by turambar » Tue Nov 06, 2018 4:31 pm

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
Level 13
Level 13
Posts: 4552
Joined: Thu Jun 21, 2018 5:11 pm

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

Post by gm10 » Tue Nov 06, 2018 4:48 pm

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: 7
Joined: Sun Nov 04, 2018 2:37 pm

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

Post by turambar » 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.

gm10
Level 13
Level 13
Posts: 4552
Joined: Thu Jun 21, 2018 5:11 pm

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

Post by gm10 » Tue Nov 06, 2018 5:16 pm

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 16
Level 16
Posts: 6271
Joined: Mon Aug 20, 2012 9:41 pm
Location: Potemkin Village

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

Post by Flemur » Wed Nov 07, 2018 9:05 am

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?
Mint 18.3 Xfce/fluxbox/pulse-less
Xubuntu 17.10/fluxbox/pulse-less

User avatar
trytip
Level 8
Level 8
Posts: 2476
Joined: Tue Jul 05, 2016 1:20 pm

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

Post by trytip » Wed Nov 07, 2018 10:38 am

@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: 7
Joined: Sun Nov 04, 2018 2:37 pm

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

Post by turambar » Wed Nov 07, 2018 4:54 pm

@trytip
Unfortunately, your solution doesn't affect root apps. I will try with fresh installation and we will see.

User avatar
trytip
Level 8
Level 8
Posts: 2476
Joined: Tue Jul 05, 2016 1:20 pm

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

Post by trytip » Wed Nov 07, 2018 5:13 pm

try copying the .fontconfig folder from your home directory to the/root/
Image

turambar
Level 1
Level 1
Posts: 7
Joined: Sun Nov 04, 2018 2:37 pm

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

Post by turambar » Wed Nov 07, 2018 6:49 pm

Still nothing changes.

Post Reply

Return to “Cinnamon”