2

I'm using the official LibreOffice package for Linux, version 7.0.1, and I've no idea how to change the font for the user interface (dialogs, menu, options, etc). I've been Googling for that for the past two years and nothing has come up unfortunately. It would be great if someone dug deep into the application and resolved this conundrum. It looks like LibreOffice uses some "default" fonts for Windows/Linux/Mac OS but again, it's not clear what the defaults are and how to override them. There's nothing in the options aside from the ability to enable/disable font antialiasing.

Someone who can read code can certainly figure it out but I won't attempt to comb through 1GB of sources: https://github.com/LibreOffice/core

I've found a file which seemingly describes default fonts but it's too much for me: https://github.com/LibreOffice/core/blob/master/officecfg/registry/data/org/openoffice/VCL.xcu

2
  • 1
    On my system (Fedora 31 \w Xfce), the UI font for LibreOffice is determined by the font selection in DE's appearance settings which apply to UI elements of most GUI applications running in the DE. – David Yockey Sep 6 '20 at 21:43
  • 1
    I'm talking about the official package, not a custom version from Fedora built with --without-fonts. – Artem S. Tashkinov Sep 6 '20 at 23:27
1
+100

The default fonts are specified in the registry. The source file is the one you found and the build system creates this one from it:

/opt/libreoffice7.0/share/registry/main.xcd

That is an XML file that you could edit directly in a text editor. Or you could format first, to make edition easier, and then edit and move it back.

$ xmllint --format /opt/libreoffice7.0/share/registry/main.xcd > /tmp/registry.xml

LibreOffice also as an override system, that allows a user to change registry values. The overriding in my system is ~./config/libreoffice/4/user/registrymodifications.xcu (the actual location might be system-dependent).

And you can do it from the user interface too. Go to File -> Options -> Advanced -> Open Expert Configuration. Then search for UI_SANS. There will be multiple matches, you want to change the one that corresponds to your locale if it is listed. LocalizedDefaultFonts['en'] is the one for English and for locales not listed.

You might add the font you want at the beginning of the list (separated by semicolons). For example, I added Humor Sans at the beginning, and this is how LibreOffice starts now:

enter image description here

There are other fonts, used in different parts of LibreOffice. You might explore those and see where they are used.

3
  • Great many thanks! I've successfully changed the font via "Advanced Configuration" -> UI_SANS. One last thing if you're still on it, is there a way to change the font size? The current font is just too small to my liking. – Artem S. Tashkinov Sep 29 '20 at 12:54
  • It was fun. About the size, I don't know, but maybe this can help you get there. – Eduardo Trápani Oct 1 '20 at 2:49
  • The official LO package ignores GTK settings. – Artem S. Tashkinov Oct 1 '20 at 11:13
-1

You should be able to set your preferred fonts and colors within the configuration tool of your Desktop Environment (DE). From the Arch Wiki:

  • If you use Cinnamon, use Themes tool (cinnamon-settings themes): go to System Settings > Themes.
  • If you use Enlightenment: go to Settings > All > Look > Application Theme.
  • If you use GNOME, use GNOME Tweaks (gnome-tweaks): install gnome-tweaks.
  • If you use MATE, use the Appearance Preferences tool (mate-appearance-properties): go to System > Settings > Appearance.
  • If you use Xfce, use the Appearance tool: go to Settings > Appearance.

However, in order for LibreOffice to adhere to the chosen GTK theme, you will have to install the libreoffice-gtk3 package.

Here is an example screenshot of LibreOffice running with a custom GTK configuration:

Screenshot of LibreOffice Writer with a dark GTK theme

Finally, a nice DE-independent way to set GTK themes is LXAppearance.

9
  • This doesn't work in no way shape or form. Arch Linux builds LibreOffice such a way it may respect your DE settings. This doesn't work for the official package. There's no -gtk3 package in the official distribution. There's only libobasis7.0-kde-integration-7.0.1.2-2.x86_64.rpm – Artem S. Tashkinov Sep 7 '20 at 19:21
  • What GUI toolkit is used in the official package then? QT? – Jaap Joris Vens Sep 8 '20 at 7:28
  • It takes roughly two minutes to download the package using a 20Mbit/s connection. You may as well do it if you really wanna help. – Artem S. Tashkinov Sep 8 '20 at 11:40
  • It's even faster to install LibreOffice with apt or yum :) – Jaap Joris Vens Sep 8 '20 at 11:59
  • Yes, except I want the untouched version right from the get go, without waiting for days and sometimes weeks for it to be pushed into updates. – Artem S. Tashkinov Sep 8 '20 at 14:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.