Broken fonts in KDE (Kubuntu 14.10)

From time to time I experience a very strange bug: Fonts broken

Fonts are broken not only in Firefox, but in the whole KDE environment. What can I do to fix it?

UPDATE #1

Installed Kubuntu from scratch and got this bug on the second day of using it. But now it affects only Firefox.

UPDATE #2

Well, it's not only in Firefox =)


Based on the information available in your question this can be a very broad range of things. I am going to list the ones that come to mind!

  1. You have selected a custom system font file that does not adhere to standards. Solution: revert to the default system font or find another without bugs.
  2. The font file is corrupt. This is not likely since you say it occurs from time to time. Solution: Replace it with an original fetched online. Rebuild font caches.
  3. There is a version conflict in the chain of libraries that are responsible for rendering your fonts. Solution: sudo update; sudo upgrade; sudo reboot; usually does the trick. Also if you have a lot of PPAs installed, I would disable them together with software installed from them temporarily to see if the problem goes away.
  4. One of the font rendering libraries has a bug. This could manifest itself as some glyphs not being rendered properly like in your screen-shot. Solution: Reinstall font rendering packages.
  5. The font rendering library's cache is corrupt. Font rendering is an expensive/slow operation and it is customary to use caches of rendered bitmaps that are dynamically managed at run-time to speed this up. Should the memory or disk-space required for this cache not have sufficient security privileges, run out space, become corrupted due to hardware faults then this would make font rendering look ugly. Solution: Rebuild font caches with this: sudo fc-cache -srv; fc-cache -rv
  6. Hardware accelerated font rendering will rely on both the GPU and its driver. The GPU driver may have a bug or you are having hardware problems with your GPU that manifest themselves as errors in font rendering. Typically GPUs will start malfunctioning "a little" when they are under stress, overheat or in some cases when they don't receive enough power from the PSU. Solution: make sure your system is not overheating. Make sure your PSU is scaled to handle your GPU. There are utilities that can help you stress-test your GPU to see if this produces your problem.
  7. Memory chips have faults that manifest as memory corruptions. If this is the case you may also experience instability. If a memory chip gets just one bit wrong every 4 days this can manifest itself as really hard to track errors. Solution: run memtest86 or similar memory testing tools to verify that your chips are fine.
  8. Individual applications may have bugs that manifest themselves like your screen-shot. Especially applications that are text and font intense such as web-browsers. I have seen this myself in Firefox. At one time all letters were exchanged for small filled boxes. Solution: restart app or system if it happens seldom. Update software version if it happens often.
  9. Firmware bugs is a reality, especially in low end hardware. Also bugs in firmware are often masked over in the WINDOWS drivers. For Linux users this means we get to keep the firmware bugs for free. Solution: If you got your computer for cheaps, or it is from a vendor not known for it's focus on stability/Linux support then maybe you should start saving for a new system.

Hope at least some of this was of use. I really had a great time writing it!


Try This before shaking ur computers Nervous system!!

To get KDE to display GTK apps well, you really need the ~/.gtkrc-2.0-kde4 theming that kubuntu-default-settings adds. Installing this will likely change your bootup logo to Kubuntu's though, so expect that. (You will obviously need kcm-gtk as well.)

You get all those packages when you install Kubuntu, but if you're just trying to install minimum-level KDE packages you'll have to fix it yourself.

Whenever you change font settings in KDE, it first saves the changes in the normal KDE settings file ~/.kde/share/config/kdeglobals that all KDE and KDE settings-aware programs read, and then also saves basic font settings (autoaliasing, hinting etc) in ~/.fonts.conf, for apps that don't have good KDE integration. What I guess is happening here is that the .fonts.conf settings transfer to your GNOME session. So, delete or rename it.

Code:

$ mv ~/.fonts.conf ~/.fonts.conf.bak