LibreOffice cannot print text and exported PDF are blank

LibreOffice cannot print text and exported PDF are blank

After recently upgrading a lab system to the latest Lubuntu 20.04 release, I could not get LibreOffice to print the text of any document and any PDF created within LibreOffice export produces a blank document (no text) with the exception of graphics or background colours (where applicable). This is also true with Print-to-File.

Note: I only see this issue with LibreOffice under Lubuntu 20.04. Running the same version of LibreOffice under Lubuntu 19.10 works as it should. I've also tested on other flavours of Linux (inc. RHEL 8.1, Debian 10) and the symptoms are not shown.

Errors

On the command-line we see the following during PDF creation from LibreOffice:

$ libreoffice --writer
"Error: Unknown font tag 'F1'"
"Error (198): No font in show/space"
"Error: Unknown font tag 'F1'"
"Error (207): No font in show/space"
"Error: Unknown font tag 'F1'"
"Error (217): No font in show"
"Error: Unknown font tag 'F1'"
"Error (223): No font in show"
"Error: Unknown font tag 'F1'"
"Error (229): No font in show"
"Error: Unknown font tag 'F1'"
"Error (198): No font in show/space"
"Error: Unknown font tag 'F1'"
"Error (207): No font in show/space"
"Error: Unknown font tag 'F1'"
"Error (217): No font in show"
"Error: Unknown font tag 'F1'"
"Error (223): No font in show"
"Error: Unknown font tag 'F1'"
"Error (229): No font in show"

And within the generated PDF documents themselves, we see entries like:

% CreateFontSubset failed for font "Liberation Serif" weight=5
% CreateFontSubset failed for font "Ariel" weight=5

Workaround

Defining the following environment variable solved my problem, although switching to print preview temporary blurs the image until a page refresh is performed (that is the only caveate I've found)

SAL_VCL_QT5_USE_CAIRO=true
  • via LUBUNTU MENU
    • Preferences
    • LXQt settings
    • Session settings
      • Click Environment (Advanced)
      • Click Add
      • Double click the empty variable name, and type SAL_VCL_QT5_USE_CAIRO, press Enter
      • Double click the Value field, and type true, press Enter
      • Click Close
      • Click OK to the dialog box
        Session Restart Required
        Some settings will not take effect until the next log in.
  • Logout and Log back in for the variable to take effect.

You can also test the variable on command-line. For example:

$ SAL_VCL_QT5_USE_CAIRO=true libreoffice --writer

To summarise

This seems to be an issue with a combination of Libreoffice 6.4x + QT5 + Cairo specifically on the Lubuntu 20.04 OS release. There are a number of bugs associated around it. Will update here when I see more.

[22-Apr-2021] According to __BUGID__ this issue is fixed with Libreoffice 7.0. After downloading and installing the latest release, I also confirm the issue is fixed :-D