Which font does Writer use when the selected one is missing?

As a year-long user of M$ Word, I’m used to the fonts Calibri and Cambria - the former for documents’ content and the latter for titles. However, in LibreOffice on OpenSuSE Leap 42.3, I don’t have them. Nonetheless, despite the default font being Liberation Serif, when I type Calibri in the Font field, my text turns to something that looks much better. It’s another sans serif font, of which I don’t know the name, because the word Calibri remains up in the Font field. So it seems like LibreOffice knows that Calibri is a sans-serif font, and defaults to a different sans-serif one. My question is, how can I check which font it is?

On the other hand, when I type Cambria, there comes something that looks nothing like it, but I guess I will have to install some extra fonts and go through them in order to find a replacement.

EDIT (ajlittoz)

Follow-on question for you wise developers who happen to read these Q&A

Where is located the substitution rule for Calibri and Cambria? Is it hard-coded in the source? Is it hidden in the advanced configuration? Are there other rules for yet other fonts?

From experimenting and comparison, it looks like Carlito is substituted for Calibri and Caladea for Cambria.

After that, I looked in Wikipedia (Crosscore fonts) which confirmed my observation.

If this answer helped you, please accept it by clicking the check mark :heavy_check_mark: to the left and, karma permitting, upvote it. If this resolves your problem, close the question, that will help other people with the same question.

The only way to check which font has been substituted is to export to PDF, and look at the fonts.
Beyond stupid … sigh … I need to move on now …

Where is located the substitution rule for Calibri and Cambria? Is it hard-coded in the source? Is it hidden in the advanced configuration? Are there other rules for yet other fonts?

UPDATE (2018-06-12)
Found the font substitutions in the Advanced Settings.
Search for “FontSubstitutions”
Then find your language code.
You will then see the substitutions for various styles and uses.


Yes, there are rules for many different fonts.
Where are the substitution rules located? See the following …

I have LO 6.0.3.2 running on Windows 7 x64.
The font substitution rules are located in the following file:
C:\Program Files\LibreOffice\share\registry\main.xcd
That is a compacted XML file which is huge, but only 284 lines long.
It is not human-readable in that format.

Use a code editor to PrettyPrint format the XML to make it easy to read.
Notepad++ (FOSS) has an XML Tools plug-in which will do this.
I used UltraEdit. Any code editor will do.
After formatting the file is now 52,853 lines long.

Search for “FontSubstitutions”
Line 41937 looks like this: <node oor:name="FontSubstitutions">
That line starts the Font Substitutions section.
Just look for Calibri (line 42593) and Cambria (line 42612).

calibri > carlito
cambria > caladea

Font Replacement Table
You can specify the replacements for any font in the Font Replacement Table.
Press Alt+F12 to open Options.
Then go to: LibreOffice > Fonts
Read the Help 3-4 times and it will make sense.

Thanks. I already use the Font Replacement Table. I assume it takes precedence over the buit-in rules.

For information, in Fedora, file is located in /usr/lib64/libreoffice/share/registry/main.xcd

Since it has strong influence on final result, is there a handy way to display the rules so that we are not surprised? In some collaborative situations, it may be necessary to use locally unavailable fonts but we need be warned about metrics diferences.

Yes, the Font Replacement Table takes precedence over the hidden default rules.
Thanks for the Fedora file location. Will add it to the LO Fonts Guide I am working on.
No, there is no easy way to display the rules. That is really dumb.
You are right this affects users everyday, causes annoying issues, and it is a black hole to users.
How does anyone even know if the rules are actually working as expected?
I plan on adding a summary to the Fonts Guide.
Diff. warnings? You’re funny.

Diff warning: I just meant some caveat somewhere (in your Fonts Guide?) to draw attention of casual user about potential unexpected results (supposing casual reads manuals, which I doubt often considering the depth of many questions here).

Hey, @LibreTraining, is your LO Fonts Guide now available to the public? I will love to learn from it!

1 Like