! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
add UI to tweak xft dpi for people with broken drivers
Status:
RESOLVED: FIXED
Product:
Xfce-mcs
Component:
Plugins

Comments

Description Andrew Smith 2007-04-20 01:47:59 CEST
User-Agent:       Mozilla/5.0 (X11; U; Linux i686; fr; rv:1.8.1.1) Gecko/20061208 Firefox/2.0.0.1
Build Identifier: 

Please see http://forum.xfce.org/index.php?topic=3312.0 for a description of the problem, I'm having trouble describing exactly what's wrong.

All I can say for sure is that the range between the smallest and the biggest fonts in my apps increased significantly after upgrading xfce from 4.4.0 to 4.4.1

I cannot use my system like this. If there is no solution I will have to downgrade xfce.

Reproducible: Always

Steps to Reproduce:
1. use xfce 4.4.0 happily
2. upgrade to xfce 4.4.1
3. be very annoyed at the tiny fonts in apps like thunar and terminal
4. increase the font size in the xfce preferences
5. be even more annoyed to find that apps like firefox now have hge fonts
Comment 1 Olivier Fourdan editbugs 2007-04-20 08:33:26 CEST
Forcing the DPI was removed, and that's on purpose. The environment should not force an arbitrary DPI value.

The DPI of the screen should be automatically computed by the X server, based on the actual screen size (taken from the monitor information using DCC) and the resolution used.

If the fonts appear too small, that might be because:

1) You set the font too small, increase its size using Xfce settings.
2) You monitor doesn't report the correct screen size, you can fix the size in millimeters in xorg.conf
3) The Xserver fails to retrieve the monitor size because the monitor is too old

Either way, this is not a bug in Xfce. If you really want to have a fixed DPI, you still can force a value yourself in one of the startup scripts, or from Xorg command line.
Comment 2 Olivier Fourdan editbugs 2007-04-20 08:36:25 CEST
As for Firefox, this link may be of some help:

http://www.mozilla.org/unix/dpi.html
Comment 3 Olivier Fourdan editbugs 2007-04-20 09:58:44 CEST
As a simple workaround for your problem, open a terminal and copy/paste the following command:

    echo "Xft.dpi: 96" >> ~/.Xresources

Then logout/login again, you'll have the DPI  to 96 as before.
Comment 4 Olivier Fourdan editbugs 2007-04-20 21:20:30 CEST
Seems that several open source drivers (ati, nv, etc. ) are not able to read DCC and compute screen size.

Some distribution force the DPI to work arround this problem while others don't.

Therefore, I'll put back the default DPI as before.
Comment 5 Olivier Fourdan editbugs 2007-04-20 21:21:06 CEST
Revision 25618 reintroduce the default Xft value.
Comment 6 Andrew Smith 2007-04-21 01:11:36 CEST
Thank you. I am indeed using the open source ati drivers.

I take it this update won't be available until the next version?
Comment 7 Jakub Moc 2007-05-25 12:40:49 CEST
(In reply to comment #5)
> Revision 25618 reintroduce the default Xft value.

Sorry, but this is wrong. It breaks everyone with native DPI != 96. If your native DPI (grep DPI /var/log/Xorg.0.log or whatever) is smaller than the default value of 96, you get too big fonts. If you native DPI is higher, you get too small fonts.

Confirmed with both xf86-video-nv and nVidia binary drivers 
(1.0.9631 and 1.0.9755) on several boxes. So, I'd agree w/ the statement in Comment #1 - this is none of Xfce business to solve, fix the drivers.
Comment 8 Samuli Suominen 2007-05-25 12:45:12 CEST
(In reply to comment #5)
> Revision 25618 reintroduce the default Xft value.
> 

It also breaks -intel users so it's not about open or closed ones.. this change breaks everyone with non-default-dpi-of-96.

Comment #1 seems right.
Comment 9 Andrew Smith 2007-05-25 13:44:42 CEST
Is there no way to make it work for everybody? A something in a config file? If it's the driver's fault I'd definitely be willing to mess around with a config file to get it fixed for myself.

Please don't just break it - it's not just me and not just my card that are affected, it's a lot of users and it's impossible to use XFCE with the font sizes messed up.

If there are bugs about removing forcing the DPI, would someone cc me on them please?
Comment 10 Jakub Moc 2007-05-25 13:49:41 CEST
(In reply to comment #9)
> Is there no way to make it work for everybody? 

Sure there is... file a bug w/ bugs.freedesktop.org and get your driver fixed ;) 

> A something in a config file? 

It already is in a config file (see /etc/xdg/xfce4/Xft.xrdb) - but having this uncommented by default makes more harm than good. No reason to break users of drivers that are not broken.
Comment 11 Andrew Smith 2007-05-25 14:14:27 CEST
I don't have an /etc/xdg/xfce4/Xft.xrdb The directory is there but not the file.
Comment 12 Jakub Moc 2007-05-25 14:24:30 CEST
(In reply to comment #11)
> I don't have an /etc/xdg/xfce4/Xft.xrdb The directory is there but not the
> file.

You won't have that file unless you've applied the r25618 patch. See Comment #3.
Comment 13 Olivier Fourdan editbugs 2007-05-25 14:36:49 CEST
(In reply to comment #7)
> Sorry, but this is wrong. It breaks everyone with native DPI != 96. If your
> native DPI (grep DPI /var/log/Xorg.0.log or whatever) is smaller than the
> default value of 96, you get too big fonts. If you native DPI is higher, you
> get too small fonts.
> 
> Confirmed with both xf86-video-nv and nVidia binary drivers 
> (1.0.9631 and 1.0.9755) on several boxes. So, I'd agree w/ the statement in
> Comment #1 - this is none of Xfce business to solve, fix the drivers.

Well, it's impossible to make everybody happy here... It's either one way or another. Since a lot of people are complaining, I simply choose to revert to the old behavior and give a bit more times for the drivers to be updated or fixed.
Comment 14 Jakub Moc 2007-05-25 14:42:58 CEST
(In reply to comment #13)

Anyone using a broken driver can use the solution in Comment #3 to work around it (and they'd better find out the *real* DPI value before, instead of blindly sticking 96 there). 

Breaking all other users doesn't make much sense. As said, this is not XFCE bug; no reason to have two broken things instead of one. :)

Comment 15 Olivier Fourdan editbugs 2007-05-25 15:19:14 CEST
> (In reply to comment #13)
> 
> Anyone using a broken driver can use the solution in Comment #3 to work around
> it (and they'd better find out the *real* DPI value before, instead of blindly
> sticking 96 there). 

But the same solution can be used to change the default 96dpi value if it's too much of a problem. 

How better is it to blindly use the (wrong) computed DPI value instead of setting a (more sensitive) value of 96dpi by default?
 
> Breaking all other users doesn't make much sense. As said, this is not XFCE
> bug; no reason to have two broken things instead of one. :)

People complain when removed, so it's back. You may choose to not install the file containing the default value so that the (wrong, for now) computed DPI applies, but I believe it should default to 96dpi in mainstream, just not to confuse users.

Once open source drivers in Xorg are able to provide a real DPI value, it'll be safe removing it.

Anyway, I doubt the is an Xfce specific issue, is it?
Comment 16 Jakub Moc 2007-05-25 15:36:04 CEST
(In reply to comment #15)
> But the same solution can be used to change the default 96dpi value if it's too
> much of a problem. 

> How better is it to blindly use the (wrong) computed DPI value instead of
> setting a (more sensitive) value of 96dpi by default?

Shrug... you are setting an arbitrarily picked-up value as default for everyone; how does this make sense? Or, how's 96dpi any more sensitive than a value (possibly) miscomputed by X server/drivers? It's definitely not any more sensitive for people w/ 75dpi or 135dpi or whatever else. (FWIW, I tested this on 3 boxes and couldn't find a single one where 96 would be a correct DPI settting.)

> People complain when removed, so it's back. You may choose to not install the
> file containing the default value so that the (wrong, for now) computed DPI
> applies, but I believe it should default to 96dpi in mainstream, just not to
> confuse users.

Well, users sure will be equally confused and file bugs about ill defaults when there's nothing wrong with their drivers and yet they get huge/tiny fonts.

Why not just leave this commented out with an appropriate comment about broken drivers - plus it would be useful to identify which ones are broken first, because none of the two mentioned in Comment #4 appear to suffer from this issue here, nor do nVidia proprietary drivers, nor does xf86-video-i810. There's no useful into wrt this in Comment #0, nor in the Xfce forum thread referred to there.
Comment 17 Samuli Suominen 2007-05-25 15:39:25 CEST
> Once open source drivers in Xorg are able to provide a real DPI value, it'll be
> safe removing it.

I can assure you xf86-video-ati, which is the driver bug reporter is using is setting DPI correctly. It's a race in his setup, or perhaps ancient installation.

> 
> Anyway, I doubt the is an Xfce specific issue, is it?
> 

You're right, it isn't. Thus Xfce shouldn't be forcing it.
Comment 18 Andrew Smith 2007-05-25 16:35:24 CEST
Is XFCE the only software affected by this issue? I suspect not, and as such, I have good reason to believe all the other software affected also defaults to 96dpi.

Are there bugs here complaining about the default dpi? If not, isn't it safer to use whatever was being used before?
Comment 19 Samuli Suominen 2007-05-25 16:40:47 CEST
(In reply to comment #18)
> Are there bugs here complaining about the default dpi? If not, isn't it safer
> to use whatever was being used before?
> 

I've added the patch used here in Gentoo for a day and it raised so much noise I had to remove it soon after that. Imagine people using DPIs like 75, or 135 and being forced to 96.. There is no sane default.
Comment 20 Andrew Smith 2007-05-25 16:45:51 CEST
Did you get those reports with 4.4.0?

Or am I wrong assuming that 96dpi was the default in 4.4.0? Was something else changed since to expose this problem?
Comment 21 Brian J. Tarricone (not reading bugmail) 2007-05-25 17:21:48 CEST
While the real solution here is to just fix the drivers, obviously that hasn't happened yet, and who knows when it will happen.

I agree that setting an arbitrary value isn't a good idea: for the people whose drivers are good, you're (probably) setting an incorrect value.  For the people whose drivers are bad, you're at least setting a sensible value, but it's still probably the wrong value.  So it's hard to say that forcing 96 dpi is a good idea when, in most cases, it's probably wrong.

I think the best solution here would be a tunable option in the User Interfaces settings panel.  The default should be "system default", where the dpi isn't set to anything; if the user wants, they can switch from the default to something custom, whether it's 75, 96, 100, or whatever.  This would also allow users to set the 'wrong' dpi if they want to for some reason (tweak font sizes of all apps that use xft to draw, not just gtk; make the font size settings seem more 'natural' to them, etc.).

I do think this is useful/important enough to add to 4.4 branch, even though it's sorta half-bug-fix, half-new-feature.  Olivier, are you ok with that?
Comment 22 Brian J. Tarricone (not reading bugmail) 2007-05-26 00:21:49 CEST
Created attachment 1156 
ui-plugin-add-dpi-setting.diff

Ok, this patch adds a DPI setting to the UI settings plugin.  It's a little more code than I'd hoped, but it should hopefully be pretty safe.  I definitely want to put this in trunk.  Olivier, what do you think about 4.4 branch as well?

(Note: we'll also need to revert the Xft.xrdb change in xfce-utils, though this new setting will work regardless, as long as you set it once.)
Comment 23 Brian J. Tarricone (not reading bugmail) 2007-05-26 00:30:32 CEST
Shit, nevermind.  That needs to be reworked.  Apparently everyone interprets 'Xft.dpi: 0' as 'ignore me and use the system default', except Terminal, which for some reason interprets it as 'make my fonts ridiculously tiny'.

Does anyone know how to use xrdb to just remove a single entry from the resources list?  The -remove option seems to remove everything no matter what I do.
Comment 24 Brian J. Tarricone (not reading bugmail) 2007-05-26 02:00:12 CEST
Created attachment 1157 
ui-plugin-add-dpi-setting-v2.diff

Ok, this one should work properly.  Thoughts?  Ok for trunk and 4.4?
Comment 25 Jakub Moc 2007-05-26 07:00:33 CEST
(In reply to comment #24)
> Created an attachment (id=1157) [details]
> ui-plugin-add-dpi-setting-v2.diff
> 
> Ok, this one should work properly.  Thoughts?  Ok for trunk and 4.4?

Looks really good; thanks. Would be nice to have in 4.4.2 ;)
Comment 26 Jakub Moc 2007-05-26 07:26:32 CEST
Oh, forgot one note here: "The smaller the number, the smaller your fonts will look." configuration hint isn't correct. As noted in Comment #7, the result is relative to the "native" DPI; i.e.:

- settting DPI to 100 when your native DPI is 75 will get you much bigger fonts, not smaller. 
- setting DPI to 100 when your native DPI is say 135 will get you way too small fonts. :)
Comment 27 Samuli Suominen 2007-05-26 07:38:18 CEST
(In reply to comment #24)
> Created an attachment (id=1157) [details]
> ui-plugin-add-dpi-setting-v2.diff
> 
> Ok, this one should work properly.  Thoughts?  Ok for trunk and 4.4?
> 

This works. Nice job, thanks..
Comment 28 Brian J. Tarricone (not reading bugmail) 2007-05-31 16:42:08 CEST
Ok, I just committed this to trunk.  You also need to update xfce-utils to latest trunk which removes the system fallback DPI of 96.

Let's see how well it works and if people have problems before thinking about putting it in 4.4.
Comment 29 Samuli Suominen 2007-05-31 16:50:53 CEST
(In reply to comment #28)
> Ok, I just committed this to trunk.  You also need to update xfce-utils to
> latest trunk which removes the system fallback DPI of 96.
> 
> Let's see how well it works and if people have problems before thinking about
> putting it in 4.4.
> 

After our forums, bugzilla and IRC was flooded with complains from users about messed up fontsize we applied this in Gentoo as xfce-mcs-plugins-4.4.1-r1 and it's default users in "testing" get now.

Feedback has been only positive. :-)
Comment 30 Brian J. Tarricone (not reading bugmail) 2007-06-01 16:50:56 CEST
(In reply to comment #29)

> After our forums, bugzilla and IRC was flooded with complains from users ...

Can you post links to the relevant bugs and forum threads?  I did a quick search but didn't find anything.
Comment 31 Samuli Suominen 2007-06-01 18:24:27 CEST
(In reply to comment #30)
> (In reply to comment #29)
> > After our forums, bugzilla and IRC was flooded with complains from users ...
> Can you post links to the relevant bugs and forum threads?  I did a quick
> search but didn't find anything.

Couple of links..

http://forums.gentoo.org/viewtopic-t-559774-highlight-xfce.html
http://forums.gentoo.org/viewtopic-t-560900-highlight-xfce.html
http://bugs.gentoo.org/show_bug.cgi?id=179301
Comment 32 Brian J. Tarricone (not reading bugmail) 2007-06-01 19:15:39 CEST
(In reply to comment #26)
> Oh, forgot one note here: "The smaller the number, the smaller your fonts will
> look." configuration hint isn't correct. As noted in Comment #7, the result is
> relative to the "native" DPI; i.e.:
> 
> - settting DPI to 100 when your native DPI is 75 will get you much bigger
> fonts, not smaller. 
> - setting DPI to 100 when your native DPI is say 135 will get you way too small
> fonts. :)

Did you actually try that?  My native DPI (well, what my X driver is setting, haven't checked if it's correct) is 100 dpi.  I set 75 dpi via this patch, and launched a new terminal ('Terminal --disable-server'), and the fonts got smaller.  I set DPI to 125, and they got larger.

I'm not really sure how the font size -> dpi -> pixels on screen conversion works, so I dunno if this makes logical sense or not; I just know what I see on-screen.

Comment 33 Brian J. Tarricone (not reading bugmail) 2007-11-01 05:22:34 CET
All right... feedback has been positive, so I've backported and committed this to the 4.4 branch.  Hopefully we can release 4.4.2 in a couple weeks (don't quote me on that, though...).

Bug #3164

Reported by:
Andrew Smith
Reported on: 2007-04-20
Last modified on: 2009-07-15

People

Assignee:
Xfce Bug Triage
CC List:
3 users

Version

Attachments

ui-plugin-add-dpi-setting.diff (13.07 KB, patch)
2007-05-26 00:21 CEST , Brian J. Tarricone (not reading bugmail)
no flags
ui-plugin-add-dpi-setting-v2.diff (14.33 KB, patch)
2007-05-26 02:00 CEST , Brian J. Tarricone (not reading bugmail)
no flags

Additional information