LibreOffice not showing installed font on Linux

Here’s another quick one – although I have simply been lucky to find the answer so fast.

While having some documents going through corporate review, it was noted that the PDF and print versions wouldn’t show some parts using the expected fonts. Looking at the list of available fonts in Linux (via “fc-cat |grep NameOfMissingFont”), the font files were clearly included. But when checking the list of available fonts in LibreOffice writer, the fonts were nowhere to be found. Hence, although the template file for these documents referenced the correct fonts, LibreOffice substituted them “silently” by some other available fonts.

Searching the Internet I found references to standard directories, in which to add the files of new fonts. But in our case, the files were in a separate directory, outside the usual list of font directories (the effective name, from LO’s point of view, is “/opt/share/fonts”, which is an auto-mounted NFS-server-based location). And I saw no mention of how to add new directories to LibreOffice’s list.

Looking around in my user’s LibreOffice configuration directory, “grep” presented a file named “~/.libreoffice/3-suse/user/psprint/pspfontcache”, which listed some fonts and directory names, but none of our desired fonts. Falling for the “cache” part of the name, I simply moved that file to a different name and re-started LibreOffice. That file wasn’t actually current, anyhow: Despite tons of re-arrangements in various directory layouts during the past years, that file was still from 2012.

Hitting that file was a lucky punch, so to say, as after removing it the originally missing fonts immediately turned up in LibreOffice Writer’s list of available fonts, without any other action required.

Looking for details on that file, I came across an article describing the user configuration part of LibreOffice, giving the following statement on that “psprint” directory:

psprint: may contain a "driver" subfolder (which may be empty), a
"fontmetric" subfolder (which may be empty), and a "pspfontcache"
file (in which printer fonts are cached). The "psprint" folder may
be missing entirely. If it is present, it may be deleted without ill
effect. If it is deleted, it will not necessarily be recreated.

Maybe that paragraph should be amended with “If it is present, it may cause problems with modern Linux font cache implementation and ought to be removed.” 😉

This entry was posted in Linux. Bookmark the permalink.

Leave a Reply