Font problems

Hi all,
since a couple weeks I am experiencing a problem in Yast: fonts are displaying garbled.
Today I had the same problem in Kate, so I tried to change the font used for the editor part.
The font looking garbled (in Kate) was Oxygen; I changed it to “Source Code Pro” and all is well now.
I still have the problem in Yast however (see screenshot).

http://s0.uploads.im/t/tM5NS.png](http://uploads.im/tM5NS.png)

Anybody else seeing this?

Bye
Cris

Only Kate? Not other Qt5/KF5 applications?
Konsole should use the same (monospace) font as Kate.

I still have the problem in Yast however (see screenshot).

YaST runs as root, so you’d have to change the font settings for root:

kdesu systemsettings5

But you seem to be missing the icons too. Probably that’s what causes the problem (the “buttons” seem to be too small for the text).
Try reinstalling yast2-branding-openSUSE and yast2-qt-branding-openSUSE.

Anybody else seeing this?

Oxygen works fine here, as do Kate5 and YaST with Oxygen as font. But I’m running 13.2, not Tumbleweed.

Yes, that’s the strange thing.
Previously only Yast was giving me this issue (probably due to the missing icons?).
But today I had the problem with Kate too. Other programs are fine.

Done, still no joy.
But maybe I should be doing a logoff/logon?
I’ll try it as soon as I can (too many things open now).

Cris

Should not be necessary, and I doubt that will help.

Does /usr/share/YaST2/theme/current/icons exist?
Does it point to an existing folder?

ls -l /usr/share/YaST2/theme/current

Maybe try to delete root’s .cache (/root/.cache) directory, but I’m not sure whether Qt5 even uses that.
Or try cleaning /tmp and /var/tmp.

Do you get error messages/warnings when you run yast2 in a terminal window? (switch to root with “su -” first)

Does it maybe help if you set a different icon theme for root?

Hi
Not sure if it’s related, but had a minor issue in GNOME with the screen (slider?) fonts when the screensaver was on. I had to install yast2-fonts and set to hindsight and the subpixel hinting to rgb. This cleaned up YaST fonts as well.

Yes, it does. It points to /usr/share/icons/hicolor.

Now this is weird!
If I do a ‘su -’ from the cli and then launch yast2, fonts and icons are perfectly fine.
But if I launch ‘kdesu yast2’ from the cli, icons does not show and fonts are garbled.

Does this give you some clue about what’s happening?

Cris

OK, I think I have something more.

If I use ‘su -’ to become root and then launch yast2 everything is fine.

If I just use ‘su’ to become root and then launch yast2, here is what I get:


Icon theme "breeze" not found.
kf5.kiconthemes: Couldn't find current icon theme, falling back to default.
Icon theme "oxygen" not found.
Error: standard icon theme "oxygen" not found!
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::setCompositionMode: Painter not active
QPainter::end: Painter not active, aborted
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::setCompositionMode: Painter not active
QPainter::end: Painter not active, aborted
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::setCompositionMode: Painter not active
QPainter::end: Painter not active, aborted
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::setCompositionMode: Painter not active
QPainter::end: Painter not active, aborted
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::setCompositionMode: Painter not active
QPainter::end: Painter not active, aborted
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::setCompositionMode: Painter not active
QPainter::end: Painter not active, aborted
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::setCompositionMode: Painter not active
QPainter::end: Painter not active, aborted
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::setCompositionMode: Painter not active
QPainter::end: Painter not active, aborted
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::setCompositionMode: Painter not active
QPainter::end: Painter not active, aborted
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::setCompositionMode: Painter not active
QPainter::end: Painter not active, aborted
QPainter::begin: Paint device returned engine == 0, type: 3
QPainter::setCompositionMode: Painter not active
QPainter::end: Painter not active, aborted

Must be something related to the environment of the root user (or, rather, something missing in my environment?).
Gonna investigate some more.

Cris

Yes, if you use “su -” it runs in a complete root environment, it doesn’t even detect the user’s KDE session. Using “su” inherits certain things from the user’s environment.

What strikes me as odd in your output are the messages about those icon themes that are not found.
Do you have either breeze5-icons or oxygen-icon-theme installed (preferably both)?

If yes, try to verify that no files are missing, e.g.:

rpm -V breeze5-icons

Yes, it is very strange.
However, everything seems to be correctly in place:

cristiano@xmper8q3:~> sudo zypper search breeze5-icons oxygen-icon-theme
Lettura dei dati del repository in corso...
Lettura dei pacchetti installati in corso...

S | Nome                       | Sommario                                  | Tipo
--+----------------------------+-------------------------------------------+----------
i | breeze5-icons              | Plasma Desktop artwork, styles and assets | pacchetto
i | oxygen-icon-theme          | Tema di icone Oxygen                      | pacchetto
i | oxygen-icon-theme-large    | Tema di icone Oxygen                      | pacchetto
  | oxygen-icon-theme-scalable | Tema di icone Oxygen                      | pacchetto
cristiano@xmper8q3:~> sudo rpm -V breeze5-icons
cristiano@xmper8q3:~> sudo rpm -V oxygen-icon-theme
cristiano@xmper8q3:~>

I tried installing oxygen-icon-theme-scalable too, but that made no difference.

Cris

What about this: if I launch yast2 from the cli without using sudo or su, I get no error and the icons are there!!

http://s0.uploads.im/t/8nSGO.png](http://uploads.im/8nSGO.png)

Even more weird…

Cris

Yes, that’s weird indeed.
I was actually suspecting some user setting meanwhile and suggesting to try a fresh user account.
But if it works when run as user, then this is unlikely to be a problem.

Maybe try to completely wipeout the content of /root as a test? (move it to a different folder to not loose all of root’s settings)

OOC, are you using the default su for kdesu, or have you switched it to sudo? (by changing kdesurc)

Not that I know of. How do I verify?

Cris

Well, su is the default. If you changed it (and you would have to manually edit a config file by hand for that), you should know. :wink:

I had another idea meanwhile, which I somehow didn’t think of earlier:
Do you maybe have qtct installed? (package libqt5-qtct in openSUSE)
This has caused problems like missing icons in Qt5 applications (or even crashes) for other users in the past, as it overrides KF5’s settings.

If so, remove it.

No qtct unfortunately (or, rather, fortunately):

cristiano@xmper8q3:~> zypper search qtct
Lettura dei dati del repository in corso...
Lettura dei pacchetti installati in corso...

S | Nome                    | Sommario                                  | Tipo
--+-------------------------+-------------------------------------------+----------
  | libqt5-qtct             | Qt5 Configuration Tool                    | pacchetto
  | libqt5-qtct-debuginfo   | Debug information for package libqt5-qtct | pacchetto
  | libqt5-qtct-debugsource | Debug sources for package libqt5-qtct     | pacchetto

Cris

I think I have found the root cause of my problem, though I still do not exactly understand what is happening.

I was led to the right path by this warning that I got today while doing a “zypper dup”:

Note that '/usr/share' is not in the search path
 set by the XDG_DATA_HOME and XDG_DATA_DIRS
 environment variables, so applications may not
 be able to find it until you set them. The
 directories currently searched are:
 

 - /root/.local/share
 - /opt/kf5/share/

If I open a console with my account, I have these environment variables:

XDG_CONFIG_DIRS=/opt/kf5/etc/xdg:/etc/xdg
XDG_DATA_DIRS=/opt/kf5/share:/usr/share

It would seem that the warning is incorrect.
But to run “zypper dup” I have to use “sudo”, so here is what I get when I run “sudo env|grep -i xdg”:

XDG_CONFIG_DIRS=/opt/kf5/etc/xdg/
XDG_DATA_DIRS=/opt/kf5/share/

On the other hand, if I do a “su -” and then issue “env|grep -i xdg” I get, again:

XDG_CONFIG_DIRS=/opt/kf5/etc/xdg:/etc/xdg
XDG_DATA_DIRS=/opt/kf5/share:/usr/share

This is not what I would expect: I thought that by using “sudo” (or “su”) the new shell would inherit the environment variables of my user, while using “su -” the new shell should use root’s environment variables.
However, here it seems my system is behaving the other way around.

BTW, I did a “su” and then I fixed the XDG* variables to appear as they are in my user account.
Then I started yast and -voila!- the icons are there.

I do not understand why the XDG* variables are not the same as those of my user account when I use “su” or “sudo”.
However, I have been able to fix this problem by editing /etc/environment.

Bye
Cris

Yes, and that’s why YaST works with “su -”.

kdesu (and “su” too maybe) probably has the wrong environment variables.
As the icons are in /usr/share/, they are not found if /usr/share/ is not in the XDG_DATA_DIRS path.

BTW, I did a “su” and then I fixed the XDG* variables to appear as they are in my user account.
Then I started yast and -voila!- the icons are there.

I do not understand why the XDG* variables are not the same as those of my user account when I use “su” or “sudo”.
However, I have been able to fix this problem by editing /etc/environment.

Well, I guess the main question is where this /opt/kf5/ stuff comes from. Where and how do you set it?

The variables are normally set in /etc/profile.d/xdg-environment.sh, maybe something overwrites them on your system.
Maybe grep recursively for XDG_DATA_DIRS in /etc and all user shell start files like ~/.profile and ~/bashrc (in particular als in /root, i.e. root’s home directory).