! 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 !
Xft.dpi should be set even if it use "default value"
Status:
RESOLVED: WONTFIX
Product:
Xfce-mcs
Component:
General

Comments

Description Sylvain Le Gall 2008-04-04 22:23:32 CEST
If Xft.dpi is not set, some application behave in a strange way (in my example, OpenOffice display font that are too big compared to Thunar).

The solution is to set Xft.dpi using X default value. 

Here us my little script to do that:

#!/bin/sh

xrdb -query Xft.dpi | grep Xft.dpi > /dev/null && exit 0
RESOLUTION=`xdpyinfo | grep resolution | sed "s/.* \\([0-9][0-9]*\\)x.*/\\1/"`
TMP=`mktemp`
trap "rm -f $TMP" EXIT
echo "Xft.dpi: $RESOLUTION" > $TMP
xrdb -merge $TMP
Comment 1 Sylvain Le Gall 2008-04-04 22:24:37 CEST
Created attachment 1578 
Solution to always set Xft.dpi
Comment 2 Brian J. Tarricone (not reading bugmail) 2008-04-04 23:01:30 CEST
Shouldn't openoffice just be fixed?

If we force the default to be used, this should be done in the UI plugin in C code, not in a shell script.  And no, that doesn't mean shelling out to xdpyinfo.  gdk_screen_get_width/height() and gdk_screen_get_width/height_mm() should be used... but what about xinerama/xrandr-1.2 setups?  Meh.  Well, current UI plugin doesn't handle different DPIs on different screens anyway...
Comment 3 Yves-Alexis Perez editbugs 2008-04-05 08:54:15 CEST
(In reply to comment #0)
> If Xft.dpi is not set, some application behave in a strange way (in my example,
> OpenOffice display font that are too big compared to Thunar).

I can't reproduce this here. Fonts are ok in OpenOffice (at “system default” of 125dpi). Could you provide a screenshot?
> 
> The solution is to set Xft.dpi using X default value. 

I'm against this, this is too error-prone.

Cheers,
Comment 4 Sylvain Le Gall 2008-04-05 12:00:25 CEST
Take a look at my blog:

http://le-gall.net/sylvain+violaine/blog/index.php?2008/04/05/41-openofficeorg-fonts-too-big-in-xfce

There is a screenshot.
Comment 5 Sylvain Le Gall 2008-04-05 12:03:55 CEST
FYI, i don't want the shell script to be used in xfce. This should be a really bad solution. I do prefer to find a clean way to do it in Xfce (through GTK/C/anything which is well integrated with xfce).

The shell script is just here to show that there some possible solution -- and give real programmer a hint on how to fix this correctly.
Comment 6 Yves-Alexis Perez editbugs 2008-04-05 12:07:09 CEST
(In reply to comment #4)
> Take a look at my blog:
> 
> http://le-gall.net/sylvain+violaine/blog/index.php?2008/04/05/41-openofficeorg-fonts-too-big-in-xfce

Yes I saw it and commented there, posting a screenshot from my install. I don't know if this is fixed by openoffice 2.4.0 or if it's because I have the gtk thing installed (wich you seems not to have), but I don't have any problem, without any forced dpi setting.

Comment 7 Moritz Heiber editbugs 2008-04-05 12:08:39 CEST
As I posted on your blog already .. the easiest way of settings the DPI value is to add it to your ~/.Xdefaults:

Xft.dpi:<yourvalue> # in my case 75

Apart from that, OpenOffice showing "huge" fonts is most likely not related to anything but an OpenOffice bug.

PS: You do know you can set your DPI values through the UI preferences, right?

Comment 8 Sylvain Le Gall 2008-04-05 12:31:20 CEST
Corsac: oo-gtk fix the whole thing and seems to be a good solution

Moritz: the problem is that i used a laptop and a desktop computer with the same settings -> they don't have the same DPI value, i would have prefer to have a good default set than to force it.
Comment 9 Sylvain Le Gall 2008-04-05 12:53:25 CEST
Having a little discussion with Corsac, lead me to think it is better not to set the Xft.dpi.

This is done in Gnome/KDE but it is mainly for legacy (at a time this was better to always set it).

Using oo-gtk is a better solution for this problem.

Big thank to the XFCE team 
The bug should be closed or set as a duplicate of 3164.
Comment 10 Brian J. Tarricone (not reading bugmail) 2008-04-05 14:48:50 CEST
Marking wontfix, then.

Bug #3984

Reported by:
Sylvain Le Gall
Reported on: 2008-04-04
Last modified on: 2009-07-15

People

Assignee:
Xfce Bug Triage
CC List:
1 user

Version

Attachments

Solution to always set Xft.dpi (235 bytes, text/x-sh)
2008-04-04 22:24 CEST , Sylvain Le Gall
no flags

Additional information