Back Original

LibreOffice on Arch doesn't install fallback fonts by default

aka 'No, page size and layout should and generally do not change between versions of LibreOffice or underlying platform'

a post in hopes I can save someone else some hours of fruitless googling

Was getting involved in a new project which happens to generate .docx files this week and came across a conundrum. The file, as opened on my machine using a recent version of LibreOffice from the Arch official repos, had a single line on a new page. Basically, it looked like it was having that issue I always have on resumes: where no matter what I do, I have a single sentence on the next page.

After checking with a main contributor, this seemed to be a "my machine" issue, not something the team had encountered before, and other contributors were using LibreOffice on Windows. We went down a few different potential routes before realizing that it was clearly a default fonts issue.

On Windows, the default system fault is Calibri, so contributors who had created this document in LibreOffice on Windows had set the document's font to Calibri. Calibri is not a free font, so it does not get bundled with any Linux software. However, there is an alternative free font that was intended as a drop in alternative for Calibri, called Carlito.

When a font is not available on a system, LibreOffice goes to a set of user-defined fallbacks; essentially, users get to decide what graceful degradation looks like for themselves. This is pretty well documented, see above link. What is perhaps a little more difficult to determine via brief Google is that there's a set of built in fallback fonts that come pre-installed, hard-coded in the source here.

Ordinarily this shouldn't need documenting because these fonts all come bundled with LibreOffice! You should get this for free (har har). However, on Arch, these are separate packages which the user must install separately and at their discretion.

So, confusingly: if you don't have Carlito or Calibri in your system fonts, you'll likely see something very off-looking when opening a document generated from a Windows user's LibreOffice install. If you DO have Carlito installed, LibreOffice will silently use that as a hard-coded fallback font (alongside a few others) without any need to set this within your user-level fallback font preferences AND without any clear indication in preferences/settings that this fallback case is handled by default. If you have a keen enough eye and a distinct enough default font installed to tell your system font from Calibri/Carlito this is probably obvious immediately. But if all you see is an otherwise well-formatted page with a single line inexplicably-and-not-reproducible-between-machines-edly on the next page, perhaps it's a bit more of a headache :)