Bug 107115 - Not installed font 'Calibri Light' rendered different (and wrong) on Ubuntu compared to Windows
Summary: Not installed font 'Calibri Light' rendered different (and wrong) on Ubuntu c...
Status: RESOLVED DUPLICATE of bug 64509
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.2.2.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Font-Rendering
  Show dependency treegraph
 
Reported: 2017-04-12 11:07 UTC by Cor Nouws
Modified: 2020-10-21 08:40 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
test docx with Calibri and Calibri Light (467.00 KB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2017-04-12 11:07 UTC, Cor Nouws
Details
same file from Word with fonts embedded (4.50 MB, application/vnd.openxmlformats-officedocument.wordprocessingml.document)
2017-04-12 11:11 UTC, Cor Nouws
Details
clip of test docx open in Writer 5.3.2.2 (176.94 KB, image/png)
2017-04-12 21:27 UTC, V Stuart Foote
Details
image with screenshot from rendering in Won7 and on Ubuntu (358.37 KB, image/png)
2017-04-14 08:31 UTC, Cor Nouws
Details
Example fontconfig config file (233 bytes, application/xml)
2020-09-01 06:53 UTC, NISZ LibreOffice Team
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Cor Nouws 2017-04-12 11:07:57 UTC
Created attachment 132515 [details]
test docx with Calibri and Calibri Light

Attaching a docx with some text in 'Calibri Light' and some in 'Calibri'
  (one line  'Calibri Light', one line 'Calibri' (both in text boxes)
   and again one line  'Calibri Light', one line 'Calibri'

The file also has a picture of how it looks in MsWord.

  > 'Calibri Light' is rendered wrong, too wide

The fonts are installed for the test.
  (calibri.ttf, calibrib.ttf, calibrii.ttf, calibriz.ttf)
Looking at Format Character, tab Font, LibreOffice claims the font is not installed..
Comment 1 Cor Nouws 2017-04-12 11:11:44 UTC
Created attachment 132517 [details]
same file from Word with fonts embedded
Comment 2 V Stuart Foote 2017-04-12 21:27:18 UTC
Created attachment 132529 [details]
clip of test docx open in Writer 5.3.2.2

No issues with this with 5.3.2.2 or a current master, the Calibri Light is rendered and shows in the Sidebar Properties deck. Same result with and without OpenGL rendering.

On Windows 8.1 Pro 64-bit en-US with
Version: 5.4.0.0.alpha0+ (x64)
Build ID: a94ef79826fdb52bcde2d0ee8b76da6df46962f2
CPU threads: 8; OS: Windows 6.29; UI render: default; 
TinderBox: Win-x86_64@62-TDF, Branch:MASTER, Time: 2017-04-11_11:00:05
Locale: en-US (en_US); Calc: CL
Comment 3 LibreTraining 2017-04-12 23:29:18 UTC
The file - Test_FontCalibriLight_ORIG_withFontsEmbedded.docx
does not appear to have Calibri Light embedded.

I opened the file in Windows 7 x64.
Calibri Light is included with Windows 8 so I do not have that font installed.

When I open the file Test_FontCalibriLight_ORIG_withFontsEmbedded.docx
and insert my cursor in the text which is supposed to be Light
the LibreOffice font list shows that font name in italics.

So according to LibreOffice that font is not available.
And the text all looks the same as in your screenshot image.

I extracted the DOCX file and there are 13 font files in there.
But obviously I cannot tell which is which.

It appears that for some reason LibreOffice is not seeing that embedded font.
If it is actually embedded.
You both have the font installed; I do not.

So for me this is confirmed.


Tested on:
Version: 5.3.2.2 (x64)
Build ID: 6cd4f1ef626f15116896b1d8e1398b56da0d0ee1
CPU Threads: 4; OS Version: Windows 6.1; UI Render: default; Layout Engine: new; 
Locale: en-US (en_US); Calc: group
Comment 4 LibreTraining 2017-04-13 02:38:08 UTC
(In reply to Cor Nouws from comment #0)

>   > 'Calibri Light' is rendered wrong, too wide
> 
> The fonts are installed for the test.
>   (calibri.ttf, calibrib.ttf, calibrii.ttf, calibriz.ttf)
> Looking at Format Character, tab Font, LibreOffice claims the font is not
> installed..

Are you sure you have Calibri Light installed properly?
The correct font files are:
 - calibril.ttf - Calibri Light
 - calibrili.ttf - Calibri Light Italics


I found that these fonts were supposedly installed in Windows 7 in a 2015 update.
But they did not appear in the font list in my Windows 7 control panel or font managers.
Re-installed the update - files are there, still not installed per Windows.
Used a font manager to install those font files.
Worked. 
Fonts now appear in Windows fonts manager, and my font manager apps, and LO.

Now that the fonts are installed properly ...
Both documents look like they should.

This tells me that
 - the fonts did not get embedded in the file properly, or
 - LibreOffice cannot read the embedded font file properly.

If the font file was embedded properly and LO works properly,
I should have been able to see the font before I got the font installed properly.
Comment 5 Cor Nouws 2017-04-13 06:52:39 UTC
(In reply to LibreTraining from comment #4)

> Are you sure you have Calibri Light installed properly?
> The correct font files are:
>  - calibril.ttf - Calibri Light
>  - calibrili.ttf - Calibri Light Italics

Will check that - maybe that is the problem.

> This tells me that
>  - the fonts did not get embedded in the file properly, or

That is strange too..

thanks for comments and suggestions so far,
Cor
Comment 6 LibreTraining 2017-04-13 13:43:24 UTC
(In reply to Cor Nouws from comment #5)
> (In reply to LibreTraining from comment #4)
> 
> > Are you sure you have Calibri Light installed properly?
> > The correct font files are:
> >  - calibril.ttf - Calibri Light
> >  - calibrili.ttf - Calibri Light Italics
> 
> Will check that - maybe that is the problem.
> 

Even if the files are there does not mean they are installed properly.
I had to use a font manager tool to get the fonts "registered" properly.

Check the fonts in the Windows Control Panel to assure that they appear there.
Comment 7 Adolfo Jayme Barrientos 2017-04-14 05:44:52 UTC
Also note that combining bold with Calibri Light might produce subpar rendering because the computer is “faking” the bold (the Calibri Light family isn’t linked to the earlier Calibri family, which contains four styles in two weights, Regular and Bold; Calibri Light, which is more recent, only contains Light and Light Italic).
Comment 8 Cor Nouws 2017-04-14 08:30:09 UTC
so it turns out that there is no Calibri Light on the system (Win 7 in VM, and so I'm not able to test it on my regular system too).

Nevertheless on Windows 7, LibreOffice 5.2.2.2 does the rendering fine, different from 5.2.2.2 on Ubuntu.

Will attach the screenshots
Comment 9 Cor Nouws 2017-04-14 08:31:12 UTC
Created attachment 132555 [details]
image with screenshot from rendering in Won7 and on Ubuntu
Comment 10 LibreTraining 2017-04-15 23:12:26 UTC
(In reply to Cor Nouws from comment #8)
> so it turns out that there is no Calibri Light on the system (Win 7 in VM,
> and so I'm not able to test it on my regular system too).
> 

I found these fonts were added to Win7 in an update.

An update is available to add the Calibri Light and Calibri Light Italic fonts to Windows 7 and Windows Server 2008 R2
https://support.microsoft.com/en-us/help/2761217/an-update-is-available-to-add-the-calibri-light-and-calibri-light-italic-fonts-to-windows-7-and-windows-server-2008-r2

This is the update download page:

Update for Windows 7 for x64-based Systems (KB2761217)
https://www.microsoft.com/en-us/download/details.aspx?id=35658


I found that update KB2761217 had been installed on my system back in 2015.
But the fonts did not appear in Windows or LO.
So I un-installed the update and then re-installed it.

It did copy the font files into the Fonts directory, but it did not register them with the OS.
So they were still not actually installed.

So I installed those font files and that did work.
Comment 11 Dave Crossland 2018-05-07 16:03:40 UTC Comment hidden (obsolete)
Comment 12 V Stuart Foote 2018-05-07 16:20:24 UTC Comment hidden (obsolete)
Comment 13 Jean-Baptiste Faure 2018-06-21 05:00:50 UTC
Reproducible for me with LibreOffice 6.1.0.0.beta2+ under Ubuntu 16.04 x86-64:
1/ C fonts from Microsoft are not installed on my system
2/ alternative fonts Caladea and Carlito are installed
3/ opening the docx file with fonts embedded LO claims that Calibri is available (expected) but that Calibri Light is not, which is not expected if this font is really embedded in the docx.

So it's clear that there is a problem with how LO recognize Calibri Light font and substitute it if needed.

Set status to NEW.

Best regards. JBF
Comment 14 LibreTraining 2018-07-09 22:59:59 UTC
I checked the font embedding permissions - same on regular and on light.
It is set to Editable.

I un-installed Calibri Light on my Windows 7 system to test.
Then opened your original DOCX in Word 2016.
It looks like your Win7/Ubuntu screenshots - bad.
When I remove the fake bold the font is still larger then the regular bold.
So even on Word 2016 the font does not seem to be embedded properly in the original Word file.
Comment 15 LibreTraining 2018-07-09 23:28:46 UTC
I created an ODT test document to test embedding all the Calibri fonts.
The document had sample text for all six of the font files.
1. Calibri
2. Calibri Bold
3. Calibri Italic
4. Calibri Bold Italic
5. Calibri Light
6. Calibri Light Italic

Saved the ODT with Embed Fonts.
Extracted the ODT(ZIP).
Used a FontRenamer application on the font files in the Fonts folder.

Result:
- Calibri Bold Italic.ttf
- Calibri Bold.ttf
- Calibri Italic.ttf
- Calibri.ttf
- Liberation Sans Bold Italic.ttf
- Liberation Sans Bold.ttf
- Liberation Sans Italic.ttf
- Liberation Sans.ttf
- Liberation Serif Bold Italic.ttf
- Liberation Serif Bold.ttf
- Liberation Serif Italic.ttf
- Liberation Serif.ttf

No Calibri Light fonts.
Should have had:
- Calibri Light.ttf
- Calibri Light Italic.ttf

I have done this before with free and commercial fonts embedded and it worked fine.

Something is very odd with those two fonts.
Comment 16 QA Administrators 2019-07-10 02:53:46 UTC Comment hidden (obsolete)
Comment 17 NISZ LibreOffice Team 2020-09-01 06:53:54 UTC
Created attachment 164949 [details]
Example fontconfig config file

This is not our bug.
In https://bugs.documentfoundation.org/show_bug.cgi?id=64509#c6 we could learn that font replacement on Linux happens in fontconfig. 
The configuration of fontconfig should include the replacement rule in attached example config (for short term testing, copy this file into /etc/fonts/conf.d ):

https://github.com/freedesktop/fontconfig/blob/master/conf.d/30-metric-aliases.conf

Also this replacement is not perfect, since there is yet no metric equivalent font for Calibri Light.
Replacing it with Carlito is only a 97% good solution, but way better than the current situation.
Comment 18 Timur 2020-10-20 13:57:15 UTC
Let's go to basics. Problem comes from proprietary font. Surely is not a solution to install in in Ubuntu. Rarely will someone purchase it there. 

In this concrete case, Calibri Light may be replaced with Carlito, but it will not look fine because Calibri looks like Carlito.
Or with some other font like Assistant Extra Light or Source Sans Pro Light that have closer look.

But we shouldn't have separate tickets for single font, so I set duplicate. 
Comment 17 is good and it can be like that, but I'd rather have in-built LO replacement table as I attached there my personal.

*** This bug has been marked as a duplicate of bug 64509 ***
Comment 19 NISZ LibreOffice Team 2020-10-21 08:25:00 UTC
Not a duplicate.

Timur: this is a non-Windows platform problem.

This font is part of the Windows platform since 8.1 (and 7 SPsomething), and the font replacement table is applied only on Windows.

So this problem needs to be fixed in fontconfig and not by extending the replacement table. Let's keep this open as a reminder for doing that.

(I still hope to get a bit of time to figure out how to push this to their gitlab...).
Comment 20 Timur 2020-10-21 08:40:31 UTC
Of course this is non-Windows. 
I stay with my comment: best would be that all those fonts, as seen in attachment 166544 [details] are properly replaced in fontconfig - but that should be reported to OS.
The font replacement table is not applied only on Windows, it's applied in Linux also. 
So this is as I wrote a duplicate of bug 64509 where all similar issues should be kept. 
Let's focus on that bug.

*** This bug has been marked as a duplicate of bug 64509 ***