OpenOffice.org fonts too big in XFCE
By gildor on Saturday, April 5 2008, 00:13 - Permalink
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
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 -
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.
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".
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.
molly.corsac.net/~corsac/...
Maybe you want to install the gtk thing for openoffice?
Thanks, work for KDE too.
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)
For the menu fonts, I simply went to
Tools > Options > Openoffice.org > View
Change the scaling to 85% (or whatever you prefer)
Installing openoffice-gtk in KDE solved my issue in my computer too.