LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices


Reply
  Search this Thread
Old 02-24-2009, 05:57 PM   #1
Blackhole
LQ Newbie
 
Registered: May 2007
Location: Black Forest or West Sussex
Distribution: Xubuntu @ DELL Latitude D620
Posts: 15

Rep: Reputation: 0
Fonts in GTK-apps look bad when started from within KDE and not from console


Hi guys,

I've followed this guide and modified my fonts via the xml-files in /etc/fonts.
Everything worked perfectly and the fonts in both my QT- and my GTK-applications look exactly as I want them to look.

Now the problem. When I boot into console mode (run level 3), add a GTK-app like for example Firefox to my .xinitrc and do a "startx", the fonts look great.
However when I boot into KDE (run level 5) and start Firefox (or any other GTK-app) from within KDE, the fonts look absolutely rubbish.

Here's a comparison:

Firefox started from console:
http://omploader.org/vMWFsdg

Firefox started from within KDE:
http://omploader.org/vMWFsdw

In my KDE appearance settings I've set "Use anti-aliasing" to "System Settings" and "Force Fonts DPI" to "disabled".
I have neither a ".fonts.conf" nor a ".gtkrc" in my home directory that could interfere.

My screen is set up correctly via xorg.conf:
Code:
schorsch@archie:~$ xdpyinfo | grep -E "(dim|resol)"
  dimensions:    1440x900 pixels (381x238 millimeters)
  resolution:    96x96 dots per inch
schorsch@archie:~$
I'm using KDE 4.2 on an Arch Linux box.

Does anybody know, what the problem might be? How can KDE screw up my GTK-apps? I always thought the KDE settings would only write to .fonts.conf in my home directory. Does it have some dubious way to mess with my fonts?

TIA,
Blackhole

Last edited by Blackhole; 02-24-2009 at 06:00 PM.
 
Old 02-25-2009, 07:25 AM   #2
SilverBear2006
Member
 
Registered: Oct 2006
Location: Great Lakes region, North America
Distribution: Mepis 7.0, Mepis 8.0, ArchLinux, Pardus 2008, Kubuntu 8.04, Ubuntu 8.10
Posts: 69

Rep: Reputation: 16
Hi, Blackhole.

If you choose runlevel 5 and KDE, then KDE is your desktop environment. You may need to install the fonts in KDE. Find the "Control Center" in the KMenu, then go to System Administration > Font Installer
If you enter your root password and do it in Administrator mode, all users logging into KDE will have benefit of the installed fonts.
 
Old 02-25-2009, 07:33 AM   #3
Blackhole
LQ Newbie
 
Registered: May 2007
Location: Black Forest or West Sussex
Distribution: Xubuntu @ DELL Latitude D620
Posts: 15

Original Poster
Rep: Reputation: 0
Well, I have installed the fonts via the Arch Linux package manager (pacman) and I can use all the fonts in KDE. I don't think that's the problem. In particular it works fine with all my Qt-apps. So the fonts are installed properly.
But thank you for the tipp. Do you have any other advice?
 
Old 02-25-2009, 09:42 AM   #4
SilverBear2006
Member
 
Registered: Oct 2006
Location: Great Lakes region, North America
Distribution: Mepis 7.0, Mepis 8.0, ArchLinux, Pardus 2008, Kubuntu 8.04, Ubuntu 8.10
Posts: 69

Rep: Reputation: 16
userChrome.css

Quote:
Originally Posted by Blackhole View Post
Well, I have installed the fonts via the Arch Linux package manager (pacman) and I can use all the fonts in KDE. I don't think that's the problem. In particular it works fine with all my Qt-apps. So the fonts are installed properly.
But thank you for the tipp. Do you have any other advice?
I see your point: KDE already has access to the fonts.

Try editing --or creating a userChrome.css file in this directory:
/home/silverbear/.mozilla/firefox/vute79sh.default/chrome

Obviously substitute your own username and whatever profile codename you have instead of "vute79sh.default"

If there isn't a userChrome.css file in that directory, you can edit the existing userChrome-example.css file and save it as userChrome.css

Add an entry thus:
Code:
menu {
font-family : "exactname_of_font"  !important ;
}
For the font-family line by "exactname_of_font" I mean copy the name of the installed font, and put it in quote marks, and after a whitespace type
!important

You may need to also put a line for font size, like so:


Code:
menu {
font-family : "exactname_of_font"  !important ;
font-size : 15pt !important ;
}
This is standard CSS, so you must include everything inside the opening & closing {} brackets of menu. And each line must have a colon ( : ) between the item and the value. And each line must end with a semicolon ( ; ).

This can't permanently hurt anything, and if tweaking it doesn't work out well, delete the file.

Obviously, if userChrome.css already exists, back it up in a safe location before screwing with it.

Good Luck, Archer! One way or another we can do this.
BTW, in a shameless plug for rep, I say: click my "Thanks" button if this works for you.
 
Old 02-25-2009, 01:56 PM   #5
Blackhole
LQ Newbie
 
Registered: May 2007
Location: Black Forest or West Sussex
Distribution: Xubuntu @ DELL Latitude D620
Posts: 15

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by SilverBear2006 View Post
Good Luck, Archer! One way or another we can do this.
BTW, in a shameless plug for rep, I say: click my "Thanks" button if this works for you.
I'll do that when we come up with a working solution. ;-) However you misunderstood my initial problem. I was having problems with ALL gtk-apps, not only with firefox. So the css-file wouldn't have helped.

After reinstalling some fonts and doing a "fc-cache -f", the GTK-Apps look fine now. I don't know what the problem actually was.

However I still have the same problem with Firefox's web site rendering, which brings me to SilverBear's advice...
Nevertheless I'm hesitating to follow your advice, for two reasons:

1.) Like said: the fonts / web site rendering is perfect when I start Firefox from console in run level 3. I don't want to fiddle with Firefox files for now, as long as I don't know why it works from console but not from KDE.

Do you understand what I mean? It works, but somehow KDE screws it up. So Firefox's settings must be correct, otherwise it would look ugly from console, too.
Does that make sense to you?

2.) The CSS-file only affects the Firefox GUI-elements and not the web site rendering if I'm not mistaken. Please, correct me on that.


Are there any KDE files that could interfere with GTK-font rendering and/or Firefox font rendering?

How do font settings in .Xresources and .XProfile interact with settings in /etc/fonts and/or ~/.fonts.conf? What's the difference, which one is responsible for what and which one overrules which when it comes to anti-aliasing and such?

Last edited by Blackhole; 02-25-2009 at 02:10 PM.
 
Old 02-25-2009, 06:03 PM   #6
SilverBear2006
Member
 
Registered: Oct 2006
Location: Great Lakes region, North America
Distribution: Mepis 7.0, Mepis 8.0, ArchLinux, Pardus 2008, Kubuntu 8.04, Ubuntu 8.10
Posts: 69

Rep: Reputation: 16
Quote:
Originally Posted by Blackhole View Post
I'll do that when we come up with a working solution. ;-) However you misunderstood my initial problem. I was having problems with ALL gtk-apps, not only with firefox. So the css-file wouldn't have helped.

After reinstalling some fonts and doing a "fc-cache -f", the GTK-Apps look fine now. I don't know what the problem actually was.

However I still have the same problem with Firefox's web site rendering, which brings me to SilverBear's advice...
Nevertheless I'm hesitating to follow your advice, for two reasons:

1.) Like said: the fonts / web site rendering is perfect when I start Firefox from console in run level 3. I don't want to fiddle with Firefox files for now, as long as I don't know why it works from console but not from KDE.

Do you understand what I mean? It works, but somehow KDE screws it up. So Firefox's settings must be correct, otherwise it would look ugly from console, too.
Does that make sense to you?

2.) The CSS-file only affects the Firefox GUI-elements and not the web site rendering if I'm not mistaken. Please, correct me on that.


Are there any KDE files that could interfere with GTK-font rendering and/or Firefox font rendering?

How do font settings in .Xresources and .XProfile interact with settings in /etc/fonts and/or ~/.fonts.conf? What's the difference, which one is responsible for what and which one overrules which when it comes to anti-aliasing and such?
You're right: I misunderstood the scope of the problem.
Some thoughts:
Quote:
2.) The CSS-file only affects the Firefox GUI-elements and not the web site rendering if I'm not mistaken. Please, correct me on that.
That CSS is for the GUI, yes. You should be able to set website rendering via Edit > Preferences > Content > Fonts & Colors > Advanced, or via CSS in userContent.css.

But, yes, it sounds like it is KDE screwing things up.
Try creating another user, and see if when logging into KDE as that user you get the same problem.

If the problem disappears, that would mean some KDE config file in your /home/regular_user directory is causing the problem.
See also:
http://bbs.archlinux.org/viewtopic.php?id=61431
http://www.mozilla.org/unix/dpi.html
http://floatingsun.net/2007/11/01/in...omment-page-1/

I'm running out of ideas, as I'm still a KDE 3.5.10 user, and you probably have KDE 4 if you're using Arch.
 
Old 02-26-2009, 07:31 AM   #7
Blackhole
LQ Newbie
 
Registered: May 2007
Location: Black Forest or West Sussex
Distribution: Xubuntu @ DELL Latitude D620
Posts: 15

Original Poster
Rep: Reputation: 0
OK, we're coming closer here. Thanks for the hint about creating a virgin user and try it with that one, SilverBear.

Here's the result.

Firefox rendering under my user account:

http://omploader.org/vMWF2Zg
http://omploader.org/vMWF2Zw

Firefox rendering under the virgin user account:

http://omploader.org/vMWF2aQ
http://omploader.org/vMWF2aA

I've checked the font settings in KDE and FF. They are identical under both accounts! No .font.conf in the virgin user's home directory either.

I also tried to delet the directory ~/.mozilla/firefox under my user account and tried again with a virgin Firefox. Didn't improve anything.

How could KDE screw up the FF-font-rendering under my account???

Last edited by Blackhole; 02-26-2009 at 07:33 AM.
 
Old 02-26-2009, 07:38 AM   #8
wsduvall
Member
 
Registered: Aug 2006
Posts: 92

Rep: Reputation: 16
Is there a .fonts or .fontsconfig folder? Also, are you experiencing this problem in Arch or Ubuntu?

Last edited by wsduvall; 02-26-2009 at 07:40 AM.
 
Old 02-26-2009, 08:04 AM   #9
Blackhole
LQ Newbie
 
Registered: May 2007
Location: Black Forest or West Sussex
Distribution: Xubuntu @ DELL Latitude D620
Posts: 15

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by wsduvall View Post
Is there a .fonts or .fontsconfig folder? Also, are you experiencing this problem in Arch or Ubuntu?
I've deleted .fontconfig several times, but it didn't help. There is no .fonts.

The problem occurs under Arch Linux with KDE 4.2

The content of my home folder is:
Code:
total 360
drwx------ 39 schorsch schorsch   4096 26. Feb 15:02 .
drwxr-xr-x  4 root     root       4096 26. Feb 14:03 ..
-rw-------  1 schorsch schorsch      0 21. Feb 14:10 .ICEauthority
drwx------  3 schorsch schorsch   4096 23. Feb 00:34 .Skype
-rw-------  1 schorsch schorsch    210 26. Feb 14:43 .Xauthority
drwx------  3 schorsch schorsch   4096 16. Feb 18:07 .adobe
-rw-r--r--  1 schorsch schorsch    149 18. Feb 19:18 .appletviewer
drwxr-xr-x 12 schorsch schorsch   4096 19. Feb 09:03 .azureus
-rw-------  1 schorsch schorsch  20673 26. Feb 14:43 .bash_history
-rw-r--r--  1 schorsch schorsch      7 15. Feb 23:07 .bash_logout
-rw-r--r--  1 schorsch schorsch     47 15. Feb 16:29 .bash_profile
-rw-r--r--  1 schorsch schorsch    176 22. Feb 13:50 .bashrc
drwxr-xr-x 11 schorsch schorsch   4096 22. Feb 22:30 .config
drwx------  3 schorsch schorsch   4096 16. Feb 09:25 .dbus
drwxr-xr-x  4 schorsch schorsch   4096 21. Feb 23:00 .designer
-rw-------  1 schorsch schorsch     22 22. Feb 22:02 .dmrc
drwxr-xr-x  3 schorsch schorsch   4096 16. Feb 18:11 .dvdcss
drwxr-xr-x  2 schorsch schorsch   4096 17. Feb 01:25 .etracer
drwxr-xr-x  2 schorsch schorsch   4096 17. Feb 01:20 .frozen-bubble
drwx------  3 schorsch schorsch   4096 26. Feb 14:50 .gconf
drwx------  2 schorsch schorsch   4096 26. Feb 14:57 .gconfd
drwx------  4 schorsch schorsch   4096 17. Feb 13:51 .gegl-0.0
drwxr-xr-x 22 schorsch schorsch   4096 25. Feb 20:42 .gimp-2.6
drwx------  3 schorsch schorsch   4096 21. Feb 22:36 .gnupg
drwxr-xr-x  2 schorsch schorsch   4096 22. Feb 16:10 .gstreamer-0.10
-rw-r--r--  1 schorsch schorsch     61 22. Feb 11:22 .gtk-bookmarks
-rw-r--r--  1 schorsch schorsch    331 25. Feb 21:49 .gtkrc-2.0-kde4
-rw-r--r--  1 schorsch schorsch    331 25. Feb 21:49 .gtkrc2.0
drwx------  2 schorsch schorsch   4096 16. Feb 11:26 .icedteaplugin
drwxr-xr-x  2 schorsch schorsch   4096 25. Feb 21:44 .icons
drwxr-xr-x  3 schorsch schorsch   4096 18. Feb 19:02 .java
drwx------  3 schorsch schorsch   4096 16. Feb 18:10 .kde
drwx------  6 schorsch schorsch   4096 20. Feb 10:00 .kde4
drwx------  3 schorsch schorsch   4096 16. Feb 10:04 .local
drwx------  3 schorsch schorsch   4096 16. Feb 18:07 .macromedia
drwx------  5 schorsch schorsch   4096 25. Feb 21:44 .mozilla
drwxr-xr-x  2 schorsch schorsch   4096 19. Feb 08:10 .mplayer
-rw-r--r--  1 schorsch schorsch   1103 23. Feb 15:21 .nvidia-settings-rc
drwxr-xr-x  3 schorsch schorsch   4096 17. Feb 13:51 .openoffice.org
drwx------  9 schorsch schorsch   4096 19. Feb 09:54 .opera
drwxr-xr-x  3 schorsch schorsch   4096 18. Feb 23:32 .qbittorrent
drwxr-xr-x  2 schorsch schorsch   4096 16. Feb 18:10 .qt
-rw-------  1 schorsch schorsch    332 17. Feb 14:07 .recently-used
-rw-------  1 schorsch schorsch   8892 19. Feb 21:50 .recently-used.xbel
drwxr-xr-x  2 schorsch schorsch   4096 22. Feb 16:01 .themes
drwx------  4 schorsch schorsch   4096 16. Feb 16:39 .thumbnails
drwx------  3 schorsch schorsch   4096 16. Feb 22:03 .thunderbird
-rw-------  1 root     root        626 22. Feb 13:48 .viminfo
drwxr-x---  7 schorsch schorsch   4096 16. Feb 15:45 .wesnoth
drwxr-xr-x  2 schorsch schorsch   4096 19. Feb 18:29 .xine
-rwxr-xr-x  1 schorsch schorsch    237 26. Feb 11:41 .xinitrc
-rw-------  1 schorsch schorsch 113207 26. Feb 15:02 .xsession-errors
drwxr-xr-x  3 schorsch schorsch   4096 25. Feb 21:37 Desktop
drwxr-xr-x  7 schorsch schorsch   4096 25. Feb 07:53 Downloads
drwxr-xr-x  4 schorsch schorsch   4096 25. Feb 00:34 MyStuff
drwxr-xr-x  3 schorsch schorsch   4096 22. Feb 13:42 builds
-rw-r--r--  1 schorsch schorsch      0 26. Feb 15:02 forum_output.txt
Both .gtkrc2.0 and .gtkrc-2.0-kde4 have the content:
Code:
# This file was written by KDE
# You can edit it in the KDE control center, under "GTK Styles and Fonts"

include "/usr/share/themes/kde4-oxygen/gtk-2.0/gtkrc"
include "/etc/gtk-2.0/gtkrc"

style "user-font"
{
	font_name="Sans Serif"
}
widget_class "*" style "user-font"

gtk-theme-name="kde4-oxygen"
gtk-font-name="Sans Serif 10"
 
Old 02-26-2009, 05:38 PM   #10
Blackhole
LQ Newbie
 
Registered: May 2007
Location: Black Forest or West Sussex
Distribution: Xubuntu @ DELL Latitude D620
Posts: 15

Original Poster
Rep: Reputation: 0
Solved it. I manually renamed the files under ~/.kde4 and kept rebooting KDE until I found the guilty one. What a time consuming nightmare!

It was "~/.kde4/share/config/kdeglobals"!

I don't know why redundant information is stored in this evil file, but apparently the font settings in there had not been updated and were therefor messing up my font settings.

I renamed the file, restarted KDE, fonts were fine. Rename again, restart, fonts were ugly. Then I deleted the file and ever since I've been a happy bunny. ^^
 
Old 02-27-2009, 09:10 AM   #11
SilverBear2006
Member
 
Registered: Oct 2006
Location: Great Lakes region, North America
Distribution: Mepis 7.0, Mepis 8.0, ArchLinux, Pardus 2008, Kubuntu 8.04, Ubuntu 8.10
Posts: 69

Rep: Reputation: 16
Quote:
Originally Posted by Blackhole View Post
Solved it. I manually renamed the files under ~/.kde4 and kept rebooting KDE until I found the guilty one. What a time consuming nightmare!

It was "~/.kde4/share/config/kdeglobals"!

I don't know why redundant information is stored in this evil file, but apparently the font settings in there had not been updated and were therefor messing up my font settings.

I renamed the file, restarted KDE, fonts were fine. Rename again, restart, fonts were ugly. Then I deleted the file and ever since I've been a happy bunny. ^^

GREAT!
I've seen your exchange with folks on http://forum.kde.org about this file, and I have to agree that I don't understand it either.

To be honest, I quit using KDE on Arch when Arch changed over to KDE4 by default. Now that KDE4.2 is out I think I may try it again. As much as I have preferred KDE 3.5x, that is the past, not the future of KDE. So I need to learn the new system sometime. I still have Mepis 8 with KDE 3.5.10 to boot if I want the stable version.

Blackhole, I just have some lingering doubts that deleting ~/.kde4/share/config/kdeglobals is the right thing to do. Might it not screw something else up, a program that needs it? If not now, sometime in the future?

So I can maybe learn what went wrong this time, I have one more question:
Did you install KDE before the gtk fonts, or did you install the fonts first?

thanks,
SilverBear
 
Old 02-27-2009, 11:07 AM   #12
Blackhole
LQ Newbie
 
Registered: May 2007
Location: Black Forest or West Sussex
Distribution: Xubuntu @ DELL Latitude D620
Posts: 15

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by SilverBear2006 View Post

GREAT!
I've seen your exchange with folks on http://forum.kde.org about this file, and I have to agree that I don't understand it either.
Aaaaah, a virtual stalker. :P
For all those who are interested in the related thread. here we go: klick me

Quote:
Originally Posted by SilverBear2006 View Post
To be honest, I quit using KDE on Arch when Arch changed over to KDE4 by default. Now that KDE4.2 is out I think I may try it again. As much as I have preferred KDE 3.5x, that is the past, not the future of KDE. So I need to learn the new system sometime. I still have Mepis 8 with KDE 3.5.10 to boot if I want the stable version.
I really like KDE 4.2. To me it really seems productive. No more beta-testing flavour to it anymore.
May I ask what WM/DE you're using under Arch?

Quote:
Originally Posted by SilverBear2006 View Post
Blackhole, I just have some lingering doubts that deleting ~/.kde4/share/config/kdeglobals is the right thing to do. Might it not screw something else up, a program that needs it? If not now, sometime in the future?
I agree. I could have only remove the few lines about my font settings. However now that I know what it is, I could start from scratch and wipe my user directory completely. So far I've only been playing with the settings. But I feel comfortable enough now to make the move to Linux.

Quote:
Originally Posted by SilverBear2006 View Post
So I can maybe learn what went wrong this time, I have one more question:
Did you install KDE before the gtk fonts, or did you install the fonts first?
I installed all my fonts before I installed KDE. I don't know what happened there. The only font that I added afterwards was the Tomaha font from Windows as it doesn't come with the MS font package in Arch.

Still that shouldn't have caused the problem as the screwed up settings were mostly about anti-aliasing and not so much about the chosen font itself.

Take care,
Blackhole

P.S.: For you patience, I hit the "thanks" button. ;-)
 
Old 02-27-2009, 12:59 PM   #13
wsduvall
Member
 
Registered: Aug 2006
Posts: 92

Rep: Reputation: 16
Are you using the KDEMod version of KDE? If so, you can check on there forum as well. You might also consider switching, but I'm not sure how thats done...
 
Old 02-27-2009, 03:45 PM   #14
Blackhole
LQ Newbie
 
Registered: May 2007
Location: Black Forest or West Sussex
Distribution: Xubuntu @ DELL Latitude D620
Posts: 15

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by wsduvall View Post
Are you using the KDEMod version of KDE? If so, you can check on there forum as well. You might also consider switching, but I'm not sure how thats done...
Nah, it's working beautifully now. I'm not running KDEMod and I haven't considered it yet. Thanks for the tipp, though. ^^
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
GTK 1 apps Fonts problems on KDE tpe SUSE / openSUSE 0 05-11-2005 12:41 PM
Non-readable fonts in GTK apps Clojster Debian 2 12-05-2004 04:11 AM
How to set Gtk fonts apps running on KDE ? nooky59 Mandriva 3 04-09-2004 09:12 AM
GTK apps fonts size too big in Debian hstang Linux - General 0 05-13-2003 10:34 PM
using custom fonts for console apps Beav Linux - General 1 09-28-2002 10:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop

All times are GMT -5. The time now is 09:03 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration