How to add ttf font files to LibreOffice on Linux?

I have a particular ttf file (Binner Gothic) which I once put in ‘C://Windows/Fonts’ … but now I use Ubuntu Linux and I can’t find an obvious place to put it! ‘/usr/share/fonts/truetype/openoffice/’ looked good until I saw its contents - just 'opens___.ttf’

Having read the two responses below, I tried each, but neither caused ‘Binner Gothic’
to appear in the selection dropdown, nor was the font recognised by a document saved with BG. Neither folder existed, and therefore each was empty. Where are the other fonts stored?

just for fun I’ve google for binner gothic.ttf download and doubleclick →→install

the file is now in

/home/karolus/.local/share/fonts

and after restarting Libre the Font is available under Name binner
(all this on LinuxMint ( a distribution close to ubuntu ))

It is important to restart LibreOffice (specially if LibreOffice QuickStarter is enabled)

move it into /home/<you>/.local/share/fonts/

This is the correct answer for recent versions of Ubuntu. .fonts has been deprecated for a while, IIRC.

The easiest way to do this is to create “.fonts” folder in your home direcoty (eg. /home/your_account_name/.fonts/") and just copy your fonts there.

1 Like

I have a dual-boot machine. Here’s what I did:
1/ Set my Windows drives to auto-mount. I followed the directions at

choosing the visual way (GUI). Reboot is required at this point.
2/ I navigated to my windows folder (C:\Windows), and created a link to the fonts folder. I moved that link into my Ubuntu home folder, and renamed the link to .fonts
Now all my windows fonts are available in LibreOffice (Ubuntu)

I used this link to assist with the installation… it may or may not help you but thought I share.

tl;dr:

  1. put ttf-file in Fontconfig-recognised dir
  2. run fc-cache from terminal

LibreOffice uses the fonts that the Operating System (OS) tells it are available for use. Therefore, to “Add fonts to LO”, what you need to do is to “Add fonts to the OS”. There are two ways to do this under Linux, only one of which (the 2nd) applies to your situation:

  1. The Easy Way: if available, use your distro Repository
  2. The Manual Way: install by hand

Easy: Install Via Repository

ttf-mscorefonts-installer is a classic example. Microsoft (M$) have open-sourced all the fonts available in their original versions of Windows (11 fonts in 30 versions). Very useful, especially if you distribute files between Linux & M$. Available within every distribution. Use standard techniques to install (I use Synaptic). Auto-puts everything in the right place.

Not So Easy: Install By Hand

Arch-Linux::Fontconfig : Font configuration
Debian wiki::fonts
(remote) (local): file:///usr/share/doc/fontconfig/fontconfig-user.html (Devuan-3)

FontConfig

Fontconfig-2.13.1 is the system/binary that controls all modern aspects of font maintenance & usage. You will never deal with it directly, but instead may use one of many small Apps directly related to it.

There are many aspects (such as always replacing a call for one font with supply of a different font) NOT dealt with here. That includes setting up Fontconfig.

  1. Font Paths
    There are two locations where Fontconfig expects to locate font-files:–
    /usr/share/fonts (global access)
    ~/.local/share/fonts (local access only; ~/.fonts/ is deprecated)
  2. Font Cache
    Fontconfig needs to cache the contents & make them accessible to programs.

So, there are only two steps necessary to manually add a font to Linux. Hah! Do you really think that it is going to be that easy? Well, maybe.

Font Path

There are supposed to be just two places for Fontconfig to find then cache a font, depending on whether you want every user to have access to it (global) or just one (local):

  • Global: /usr/share/fonts
  • Local: ~/.local/share/fonts

It would be wonderful if this were true, but of course it is not. The structure of the Fontconfig configuration matrix means that there are large numbers of ways to introduce extra paths. fc-list may discover where they are (beware the number of results; unoccupied dirs not revealed); fc-cache will show all possible dirs (using “erase all existing caches, then rescan … verbosely” option):

$ fc-list | wc -l   
595   
$ fc-list 'Webdings'   
/usr/share/fonts/truetype/msttcorefonts/Webdings.ttf: Webdings:style=Regular,Normal,obyčejné,Standard,Κανονικά,Normaali,Normál,Normale,Standaard,Normalny,Обычный,Normálne,Navadno,Arrunta

$ sudo fc-cache -rv
/home/user/.local/share/fonts: skipping, no such directory
/home/user/.fonts: skipping, no such directory
/root/.local/share/fonts: skipping, no such directory
/root/.fonts: skipping, no such directory
/usr/local/share/fonts: caching, new cache contents: 0 fonts, 0 dirs
/usr/share/fonts: caching, new cache contents: 0 fonts, 9 dirs
/usr/X11R6/lib/X11/fonts: skipping, no such directory
/home/user/.cache/fontconfig: cleaning cache directory
/home/user/.fontconfig: not cleaning non-existent cache directory
/var/cache/fontconfig: cleaning cache directory
/root/.cache/fontconfig: not cleaning non-existent cache directory
/root/.fontconfig: not cleaning non-existent cache directory
fc-cache: succeeded

From this point on, Fontconfig auto-provides the font-cache to all programs that may require them without any further user-action required.

On Ubuntu 22.04, LibreOffice 7.5, ~/.local/share/fonts/ did not work for me,

I copied all ttf files to /usr/local/share/fonts/ (requires privileges) and the fonts showed up in the application.

I noticed there is also /usr/share/fonts/, but I do not know the implication of the different directories.

You may copy or install the font in this folder - then the font is available to each app of each user. When copying (recommended) you have to use root rights (sudo; pkexec).
Don’t forget to refresh the font cache or logout/login or shutdown/restart your machine. - HTH