Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
Firefox+KDE Font/DPI issues. Tried EVERYTHING. No work.
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
jbinto
n00b
n00b


Joined: 21 Aug 2005
Posts: 74

PostPosted: Mon Feb 27, 2006 7:35 pm    Post subject: Firefox+KDE Font/DPI issues. Tried EVERYTHING. No work. Reply with quote

Forgive me if I overlook some stuff. I had the whole thing typed in and of course I closed Firefox to test something and forgot I hadn't submitted. Ugh.

Anyway, I had some trouble with font sizes when I installed KDE. Everything was really small.

I have a 32" LCD HDTV. This is the cause of my problems I would imagine, or is it QT? I use Gentoo with GTK/XFCE on my laptop and Gentoo with GTK/Enlightenment on another (rarely used) desktop. Now I'm taking the plunge into KDE, and I like it a lot so far, except for it's behaviour with Firefox.

When I got KDE, however, everything was way too small. I soon figured out it was a DPI issue and startx - --dpi 72 fixed everything.

Then I installed firefox.

No matter what combination of magic numbers I use, nothing works.

I know there are three ways to set DPI in Xorg:

  • startx - --dpi 72
  • DisplaySize X Y in xorg.conf
  • Xft.dpi: X in .Xresources


and there are three ways to set DPI in Firefox:

  • browser.display.screen_resolution in about:config
  • "Use system setting" in Appearance config
  • Minimum font size


So I fiddled and fussed with all of these settings, and NOTHING produces usable output from Firefox. The best I can do is startx - --dpi 72 which makes KDE look right, 72dpi in about:config which makes Firefox's MENUS look right, but the text is still WAY too small, and minimum font size of 18(!) to make things appear like they are 12pt. This works, until one visits a CSS heavy website, and then everything is out of proportion (images and text don't line up, for instance).

So I googled and searched and tried this:
http://www.mozilla.org/unix/dpi.html

Quote:
On some systems, setting DisplaySize first, and then setting Xft.dpi to match the reported DPI is required for proper results.


I ditched startx - --dpi and started finding a DisplaySize that made text look right. I settled on 464 263 (note that the actual display dimensions of my tv are 705mm by 400mm. That produces output even worse than without any dpi settings at all, about 40dpi according to xdpyinfo.) which xdpyinfo reports as 74x74. I put that info into .Xresources, merged it in with xrdb and launched Firefox with system settings and no minimum font.

Great, the menus look nice but not the text. Back to square one.

I fiddled with about:config values until my head was blue.

The tradeoff seems, you can have readable text that doesn't break CSS if you can settle for huge (48pt menus).

Or you can have menus that aren't ridiculously big and text that is unreadably small.

HOW do I get this to work? Every howto says change this thing, or change that thing, but damn, there's too many permutations! I'm really enjoying KDE so far but if I can't use firefox (Konqueror sucks, OK?) it's not worth it, back to a lightweight window manager and byebye Qt (which means byebye Amarok).

(Note that this may have nothing to do with KDE, I have not tested it in another WM on this PC, but somehow I doubt there'd be a problem if I was using GTK/gnome. Grrr.)

Here's a screenshot of the problem.
http://tinyurl.com/r3t9s

The above was taken with Xft.dpi set to 74, DisplaySize set to 464 263, and Firefox set to "use system settings" with minimum font size OFF.

I could go on and on with these screenshots and combinations, but then I'd become violent. Please help before someone gets hurt ;)
Back to top
View user's profile Send private message
My_World
Guru
Guru


Joined: 01 Sep 2003
Posts: 339
Location: Kalahari Desert

PostPosted: Tue Feb 28, 2006 7:59 pm    Post subject: Reply with quote

Have a look here:
http://gentoo-wiki.com/HOWTO_Xorg_and_Fonts

At the bottom is some KDE and Firefox/Thunderbird troubleshooting tips.

Shout if it doesn't help!
:D
_________________
"Ubuntu" - an African word meaning "Gentoo is too hard for me".
Back to top
View user's profile Send private message
jbinto
n00b
n00b


Joined: 21 Aug 2005
Posts: 74

PostPosted: Fri Mar 03, 2006 8:41 pm    Post subject: Reply with quote

Well, that did help me beautify my fonts (antialiasing) and bring some web-standards (Bitstream Vera Sans beats vanilla Sans) but that did not fix my PROPORTIONALITY problem.

At the very least, you now know my exact font configuration, as I copied those settings verbatim.

Current setup:
- KDE 3.5, Firefox 1.5, HDTV as only monitor at 1216x684 (16:9)
- startx modified to pass -dpi 72
- .Xresources has Xft.dpi: 72.0
- Firefox DPI configured to (guess it) 72

Current issues:
- Menus are still HUGE relative to the webpage body.
- On a website like last.fm, which has forced font size in some parts, but not others, the smaller fonts (eg 10pt 12pt) are unreadable, but the rest of the site is fine. Using ctrl-wheelup makes all the fonts bigger so I can read the forced small ones, but now the rest of the page is huge. Screenshot below.
- Proportionality is destroyed when using min font size. If "readable" is 16pt, and "unreadable" is 12pt, min font size forces 12pt to be scaled up to 16pt, so all proportion is killed as fonts are all now the same size when some fonts are meant to be smaller. Min font size is a dirty, hackish, bandaid solution and does not solve the underlying problems. Screenshot below.

If all the pages on the web were like Google, Gmail etc and didn't force sizes and used relative font sizes like +1 -1 and not 12pt 10pt, then this wouldn't be a problem. Get to any fancy CSS website and it all goes to hell. The main text tends to be readable with default font size of 16, but any menus, etc, are always way too small.

If I go and decrease the DPI in firefox (at one point I had it set to 60, so I could use 12pt fonts as 12pt fonts and not be forced to use 16pts) then the menus become triple the size while the text only double (for instance). Either ridiculously huge menus and readable text, or slightly too big menus and unreadable text. That's the tradeoff.

Here's what I'm going to do in this order:
- unmerge ~x86 firefox (1.5), try 1.07
- ditch KDE/Qt entirely, install xfce or *shudder* gnome
- hope for some useful response here

While I have always been an opponent of bloat and I never really liked the idea of KDE, I've been happy with it (especially amarok) until I started messing around in Firefox. I don't really rely on many GUI applications so I don't have any real experience crossbreeding KDE and GTK applications. For example, I don't use GIMP but I'd not be surprised if these same symptoms were exhibited there. This is probably a KDE/GTK problem rather than a firefox problem, but that doesn't make me feel any better.

On a related note, KDE's fonts were also unreadably small too until I started doing DisplaySize in xorg.conf and/or -dpi 72 at the startx level. Does Firefox not respect these settings?

Screenshots:

Last.fm without min font size (see top right corner, user info)
http://tinyurl.com/epna8

Last.fm with min font size (see top right corner has changed, but nothing else has!)
http://tinyurl.com/hlhm3

Also notice in these screenshots the relative size of the menus compared to the body text. That ratio is constant -- when I decrease DPI, those fonts get huger as the body text get slightly bigger.

Grrr!
Back to top
View user's profile Send private message
jbinto
n00b
n00b


Joined: 21 Aug 2005
Posts: 74

PostPosted: Fri Mar 03, 2006 9:28 pm    Post subject: Reply with quote

Update:

- Firefox 1.07 exhibits same symptoms.
- Using 96dpi, last.fm (and most of the web) is readable but the damn menus are still huge.
Back to top
View user's profile Send private message
.squid
n00b
n00b


Joined: 28 Feb 2006
Posts: 4

PostPosted: Fri Mar 03, 2006 9:31 pm    Post subject: Reply with quote

What happens when you set dpi to 38 (1216 / 32), leaving everything else at default settings ?
Back to top
View user's profile Send private message
jbinto
n00b
n00b


Joined: 21 Aug 2005
Posts: 74

PostPosted: Fri Mar 03, 2006 9:35 pm    Post subject: Reply with quote

Which one?

Firefox's?
.Xresource's?
startx -dpi argument?
Back to top
View user's profile Send private message
jbinto
n00b
n00b


Joined: 21 Aug 2005
Posts: 74

PostPosted: Fri Mar 03, 2006 9:39 pm    Post subject: Reply with quote

I'll assume you mean Firefox.

Default settings (deleted ~/.mozilla), 38 dpi.

The menus are unreadably small, the small text on the last.fm is even smaller, but all "normal" text is still normal.

What is the significance of divide by 32?


Last edited by jbinto on Fri Mar 03, 2006 9:39 pm; edited 1 time in total
Back to top
View user's profile Send private message
.squid
n00b
n00b


Joined: 28 Feb 2006
Posts: 4

PostPosted: Fri Mar 03, 2006 9:39 pm    Post subject: Reply with quote

Sorry, I meant startx --dpi 38 ... ?

BTW, firefox's menu/dialog font size can be fixed by creating a file .gtkrc-2.0 in ur home dir and putting there smth like
Code:
gtk-font-name = "Verdana 8"
Back to top
View user's profile Send private message
jbinto
n00b
n00b


Joined: 21 Aug 2005
Posts: 74

PostPosted: Fri Mar 03, 2006 9:43 pm    Post subject: Reply with quote

I'm fairly certain startx - --dpi 38 will make KDE in general unreadably small (or big, I can never remember). I've settled on 72dpi for X in general. Without dpi arguments it assumes something ridiculous and is too small.

Looking into that .gtkrc-2.0 file now. It seems it's the same as what's generated by the KDE GTK compatibility control centre thing.

I forgot to mention, in my effort to fix this, I installed gtk-engines-qt-0.6-r2 without really knowing what it does.
Back to top
View user's profile Send private message
jbinto
n00b
n00b


Joined: 21 Aug 2005
Posts: 74

PostPosted: Fri Mar 03, 2006 10:36 pm    Post subject: Reply with quote

Getting somewhere... I'd not say it's been solved but Yet Another Dirty Hack.

Firefox's MENUS respects .gtkrc-2.0, BUT it applies it's OWN DPI setting against it, NOT xorg's.
Firefox's TEXT only looks right with 96 DPI (Firefox dpi settings).

KDE/everything else only looks right with 72 DPI (startx dpi settings).

So, here's yet another tradeoff:

Firefox looks PERFECT with:
- startx - --dpi 72
- Verdana 8 in .gtkrc-2.0
- 96dpi in Firefox

But since _only_ Firefox uses 96 DPI, other GTK applications (mhwaveedit, the only other one I have atm) display Verdana 8 too small.

So here's the hack. I'm sure it will blow up in my face one day when Firefox fixes some bugs or when I use an older GTK application:

~/.gtkrc-2.0:
Code:

style "user-font"
{
font_name="Verdana 12"
}
widget_class "*" style "user-font"

gtk-font-name="Verdana 8"


Firefox only respects gtk-font-name. Verdana8@96DPI is readable.
mhwaveedit, my only other GTK application, respects font_name. Verdana12@72DPI is readable.

As soon as an application other than Firefox with it's proprietary DPI system starts using gtk-font-name, I'll be in trouble.

Is there any way in gtkrc-2.0 to set application specific settings?

Why the discrepancy? Does 72DPI mean something different to KDE than it does to Firefox? 96DPI is too big for KDE.
Back to top
View user's profile Send private message
jbinto
n00b
n00b


Joined: 21 Aug 2005
Posts: 74

PostPosted: Fri Mar 03, 2006 10:50 pm    Post subject: Reply with quote

[quote="jbinto"]Getting somewhere... I'd not say it's been solved but Yet Another Dirty Hack.

Firefox's MENUS respects .gtkrc-2.0, BUT it applies it's OWN DPI setting against it, NOT xorg's.
Firefox's TEXT only looks right with 96 DPI (Firefox dpi settings).

KDE/everything else only looks right with 72 DPI (startx dpi settings).

So, here's yet another tradeoff:

Firefox looks PERFECT with:
- startx - --dpi 72
- Verdana 8 in .gtkrc-2.0
- 96dpi in Firefox

But since _only_ Firefox uses 96 DPI, other GTK applications (mhwaveedit, the only other one I have atm) display Verdana 8 too small.

So here's the hack. I'm sure it will blow up in my face one day when Firefox fixes some bugs or when I use an older GTK application:

~/.gtkrc-2.0:
Code:

style "user-font"
{
font_name="Verdana 12"
}
widget_class "*" style "user-font"

gtk-font-name="Verdana 8"


Firefox only respects gtk-font-name. Verdana8@96DPI is readable.
mhwaveedit, my only other GTK application, respects font_name. Verdana12@72DPI is readable.

As soon as an application other than Firefox with it's proprietary DPI system starts using gtk-font-name, I'll be in trouble.

Is there any way in gtkrc-2.0 to set application specific settings?

Why the discrepancy? Does 72DPI mean something different to KDE than it does to Firefox? 96DPI is too big for KDE.

edit: Should I just go 96DPI and make each and every font in KDE smaller? Maybe this is the ultimate solution and maybe I just don't have a feel for these things, but I feel uneasy when a 14pt font is just.. so.. big. My intuition tells me you shouldn't be able to read a 14pt font from over 10 feet away, and that "big-type" starts around 24pt. No? I am, although, working on a huge screen, maybe that's why.
Back to top
View user's profile Send private message
Mandos
n00b
n00b


Joined: 30 Aug 2003
Posts: 16

PostPosted: Sat Mar 04, 2006 2:11 am    Post subject: Reply with quote

Fonts in Firefox have always been a problem for me too. As a matter of interest, if you haven't already done it
could you add to about:config a string labelled "font.size.unit" and give it a value of "pt".
Firefox by default specifies font sizes in pixels, which is affected by DPI settings (a ten pixel font looks
much larger on a 15 inch display at 800x600 resolution than it does displayed on a 1200DPI device such as
a laser printer (assuming a direct pixel:dot mapping)), a ten point font should be the same size regardless of
the DPI of the device if the software knows what it is rendering on DPIwise.
Back to top
View user's profile Send private message
omp
Retired Dev
Retired Dev


Joined: 10 Sep 2005
Posts: 1018
Location: Glendale, California

PostPosted: Sat Mar 04, 2006 2:50 am    Post subject: Reply with quote

jbinto wrote:
I forgot to mention, in my effort to fix this, I installed gtk-engines-qt-0.6-r2 without really knowing what it does.
It lets is a GTK+ engine that calls from Qt. In other words, you get to use your Qt theme in both Qt and GTK+ applications. (although some themes may be a bit buggy with GTK+ applications)
_________________
meow.
Back to top
View user's profile Send private message
evilspoons
n00b
n00b


Joined: 11 Nov 2005
Posts: 6
Location: Canada

PostPosted: Sat Mar 04, 2006 7:01 am    Post subject: Reply with quote

jbinto wrote:

edit: Should I just go 96DPI and make each and every font in KDE smaller? Maybe this is the ultimate solution and maybe I just don't have a feel for these things, but I feel uneasy when a 14pt font is just.. so.. big. My intuition tells me you shouldn't be able to read a 14pt font from over 10 feet away, and that "big-type" starts around 24pt. No? I am, although, working on a huge screen, maybe that's why.


I had very similar problems on my laptop. I ended up just forcing KDE's DPI to 96 on the startx in my display manager and reduced all the font sizes in the KDE control center. Looks great now.

Another program that's rather grouchy about font sizes is Openoffice. When I set DPI to 75 (which should be "correct" and displays the KDE fonts the right size) everything in Openoffice was microscopic... DPI at 96, it looks perfect!
Back to top
View user's profile Send private message
labba
Apprentice
Apprentice


Joined: 01 Oct 2004
Posts: 178
Location: 127.0.0.1

PostPosted: Sun Mar 12, 2006 4:22 pm    Post subject: Reply with quote

jbinto wrote:
Getting somewhere... I'd not say it's been solved but Yet Another Dirty Hack.

Firefox's MENUS respects .gtkrc-2.0, BUT it applies it's OWN DPI setting against it, NOT xorg's.
Firefox's TEXT only looks right with 96 DPI (Firefox dpi settings).

KDE/everything else only looks right with 72 DPI (startx dpi settings).

So, here's yet another tradeoff:

Firefox looks PERFECT with:
- startx - --dpi 72
- Verdana 8 in .gtkrc-2.0
- 96dpi in Firefox


I had similar problems and solved the menu fontsize problem with these .css hacks, so you don't have to "abuse" .gtkrc-2.0.
Back to top
View user's profile Send private message
hayalci
n00b
n00b


Joined: 18 Jul 2004
Posts: 44

PostPosted: Sat Jul 19, 2008 8:25 pm    Post subject: Reply with quote

The section in the wiki has been moved,

http://gentoo-wiki.com/HOWTO_Xorg_and_Fonts#KDE_Applications_Size_Problems

Somehow, '*' did not work for me, so I picked UI element names using DOM inspector and added to the wiki page.

[[ Bumping this old thread because It is returned on google's first page results. ]]
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum