I think it is decided not by Ubuntu but by the program (LibreOffice, OpenOffice etc.). I could not see anything related to LibreOffice per se but OpenOffice has a nice wiki with some details on how this "Font Fallback" works. It might be applicable to LibreOffice also, in general.
I am reproducing some sections from the wiki below for clarify. It is hard to explain better than what is in the wiki, so better to read it from there:
What is Font Fallback in OpenOffice.org 2?
Font-Fallback kicks in whenever a font is requested that is not installed on the system. (Not installed means: not available to OOo).
OOo then tries to use a different font from the ones that OOo knows about that matches the requested one as close as possible.
How does Font Fallback work?
For font-fallback to produce satisfying results, OOo somehow has to know about similarities of fonts. OOo must know that it can for example substitute Helvetica in place of Arial, but not Comic Sans. This task is not as easy as it sounds, since many fonts exist and OOo cannot know about all of them.
OOo uses several ways to find a suitable replacement:
- Font alias information provided by the system (e.g., from a
fonts.dir
file)
- Hard-coded list of fallback-fonts, from
VCL.xcu
(tried first)
- Alternative font name spellings
- Font-attributes (e.g., does it have CJK-characters, is it a Symbol-font) or style (serif/non-serif, proportional/non-proportional)
if all that fails as well:
Not directly related but this TLDP document is a good read.
Best Answer
The image that you've included with your question shows that the name of the font is in italics. This means that the named font is not installed, and an automatically selected substitute has been used instead. If you hover the cursor over this italicised font name you may see a comment to this effect.
If you don't wish to install the missing font, you can edit the Style to specify a font that is installed (right-click within a paragraph, and choose 'Edit Paragraph Style...' from the bottom of the dropdown menu).
In Microsoft Office the same thing happens with missing fonts, but there's usually no indication that a font substitution has occurred.