OpenOffice.org fonts too big in XFCE

UI fonts of OpenOffice.org Writer and XFCE thunar are really not the same

... years of seeing this ugly font and being force to scale the OpenOffice.org UI display to 80%.

I just found the solution!

All his related to a X settings: Xft.dpi. People are suggesting around to set it to 96 or something like that. I just decide to use the one i can find xdpyinfo (does it make sense?) and send the result to X settings using xrbd.

Here is the script $HOME/bin/xfce4-xft.sh:

#!/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

Copy/paste/chmod a+x this file.

And then add a file $HOME/.config/autostart/xfce4-xft.desktop to autostart the previous script:

[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=XFCE-XFT
Comment=Fix XFCE Xft.dpi settings
Exec=/home/gildor/bin/xfce4-xft.sh
StartupNotify=false
Terminal=false
Hidden=false

(replace /home/gildor/ by your own home directory)

Thats it. Your Xft.dpi will be fixed depending on the configuration of your X server. This allow you to have a laptop and a desktop with different screen resolution.

I am waiting the email from bugzilla.xfce.org to submit this script to XFCE bug tracking.

Enjoy.

Update:

Following the comment of this entry, another better solution is to use openoffice.org-gtk which works out-of-the-box with a clean UI. I don't even have to force OO to gnome style.

Thanks to Dan Callahan, Vasilis and Corsac for their suggestion.

Comments

1. On Saturday, April 5 2008, 02:07 by smc

Hi,

the whole script can be simplified to (without linebreaks):

echo "Xft.dpi: $(xdpyinfo | grep resolution | sed "s/.* \\([0-9][0-9]*\\)x.*/\\1/")" | xrdb -merge -

2. On Saturday, April 5 2008, 06:59 by Dan Callahan

Have you tried using openoffice.org-gtk and setting OOO_FORCE_DESKTOP=gnome in your environment?

That'll give you nice, clean GTK widgets which should also scale to the same size as other app fonts.

3. On Saturday, April 5 2008, 08:58 by Vasilis

You could also use the GTK+ widgets: install the openoffice.org-gtk package and if they are not used by default under XFCE set the environment variable OOO_FORCE_DESKTOP to "gnome".

4. On Saturday, April 5 2008, 12:38 by Moritz Heiber

You know you can achieve the same by just adding the following to your ~/.Xdefaults file:

Xft.dpi:<yourvalue>

No scripts involved, no need to query anything.

5. On Saturday, April 5 2008, 12:44 by Corsac

molly.corsac.net/~corsac/...

Maybe you want to install the gtk thing for openoffice?

6. On Tuesday, April 8 2008, 10:27 by Geo

Thanks, work for KDE too.

7. On Tuesday, April 8 2008, 15:39 by gildor

Geo: Thanks, work for KDE too.

Please consider other alternatives like openoffice.org-gtk, my script is a hack... i.e. not the best way to solve the problem (but maybe you are referring to this in your comment)

8. On Thursday, April 24 2008, 23:37 by Amit

For the menu fonts, I simply went to

Tools > Options > Openoffice.org > View

Change the scaling to 85% (or whatever you prefer)

9. On Wednesday, September 3 2008, 20:29 by Ferri64

Installing openoffice-gtk in KDE solved my issue in my computer too.

They posted on the same topic

Trackback URL : http://sylvain.le-gall.net/blog/index.php?trackback/40

This post's comments feed