LibreOffice Fonts – Fix Missing Fonts Causing Layout Issues in Impress

debugfontslibreofficemicrosoft-powerpointwine

I have reported a LibreOffice Impress bug here. In that bug, the text of a slide went beyond the page margin

enter image description here

Although it looked fine in Microsoft PowerPoint

enter image description here

Now I cannot reproduce the bug anymore. LibreOffice Impress, the same version used to report the bug and also provided by Canonical, seems to display it correctly.

One major change that happened is that I installed wine. Is it possible that wine installed some fonts that were not originally present, and so when I reported the bug LibreOffice was resorting to some other alternative font?

Best Answer

I solved this issue.

I will post the solution here as I think it is important for people who comes from Windows and want a smooth experience with Linux.

The bug, which I reported here, is related to a missing font, "Calibri", a font by Microsoft which is missing on Ubuntu.

LibreOffice uses fontconfig to resolve fonts. If a font is missing, fontconfig will use a substitute font. LibreOffice will tell you that the font is missing and has been substituted by putting the font name in italics, but it will not tell you which font was used as a substitute. You can find it out by yourself using the command fc-match <FONTNAME>. By the default Kubuntu 20.10 installation, fontconfig will resolve the missing "Calibri" to "Noto Sans", an inappropriate substitution, which lead to this bug.

You have two options here:

  1. Install an open-source replacement for "Calibri". This open-source font is called "Carlito" and it is not installed by default. It is however available in the official repositories and you can install it by running:

    sudo apt-get install fonts-crosextra-carlito
    

    You can also issue sudo apt-get install fonts-crosextra-* to substitute for other Microsoft fonts.

  2. You can install the official "Calibri" font from Microsoft. To do so, I suggest you use fontist and follow the instructions here (disclaimer: I wrote those instructions).