Bug 83675 - embedded fonts are double and also non-used fonts are embedded - the used font is not embedded
Summary: embedded fonts are double and also non-used fonts are embedded - the used fon...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
4.3.1.2 release
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
: 113658 (view as bug list)
Depends on:
Blocks: Fonts-Embedded
  Show dependency treegraph
 
Reported: 2014-09-09 14:43 UTC by squeezechart
Modified: 2022-05-28 19:39 UTC (History)
7 users (show)

See Also:
Crash report or crash signature:


Attachments
SqueezeChart2014web.xlsx (770.19 KB, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet)
2014-09-09 14:43 UTC, squeezechart
Details
Demo of problem (9.32 MB, application/vnd.oasis.opendocument.text)
2018-06-19 23:09 UTC, Robert
Details
unused_font_not_removed_used_font_not_embedded.odt (63.39 KB, application/vnd.oasis.opendocument.text)
2022-05-28 19:36 UTC, libreuser
Details
used_fonts_embedded.odt (159.61 KB, application/vnd.oasis.opendocument.text)
2022-05-28 19:39 UTC, libreuser
Details

Note You need to log in before you can comment on or make changes to this bug.
Description squeezechart 2014-09-09 14:43:55 UTC
Created attachment 105986 [details]
SqueezeChart2014web.xlsx

If this spreadsheet is saved with fonts embedding enabled,
the following fonts are embedded twice:

* Arial (895.200 bytes)
* Arial bold (857.344 bytes)
* Arial bold italic (630.804 bytes)
* Arial italic (635.860 bytes)
* Calibri (812.488 bytes)

those fonts are embedded but not used in that document:

* Arial (895.200 bytes)
* Arial bold (857.344 bytes)
* Arial bold italic (630.804 bytes)
* Arial italic (635.860 bytes)
* Calibri (812.488 bytes)
* Calibri bold (849.956 bytes)
* Calibri bold italic (900.868 bytes)
* Calibri italic (854.732 bytes)

The font that is used in whole document is !not! embedded (Futura Lt BT)
Comment 1 Owen Genat (retired) 2014-09-14 13:58:18 UTC
(In reply to comment #0)
> If this spreadsheet is saved with fonts embedding enabled,

Presumably this is a reference to saving as ODS because File > Properties > Fonts tab > "Embed fonts in the document" option[1] only applies to this file format.

> those fonts are embedded but not used in that document:

Here is a quick grep of fonts used in the provided XLSX (contents of file extracted to xlsx/ directory):

$ grep --no-filename -ore "rFont[^/]*" xlsx/ | sort -u
rFont val="Arial"
rFont val="Futura Lt BT"
rFont val="Segoe UI"
rFont val="Tahoma"
$ grep --no-filename -ore "name val=[^/]*" xlsx/ | sort -u
name val="Arial"
name val="Calibri"
name val="Futura Lt BT"
name val="Segoe UI"
name val="Tahoma"
name val="WenQuanYi Zen Hei"

So both Arial and Calibri are listed as either used somewhere in the document or defined in a default style. Some of the other fonts (Segoe UI and Tahoma) seem to be used in comments.

> The font that is used in whole document is !not! embedded (Futura Lt BT)

I have tested saving the XLSX to ODS under GNU/Linux using v4.3.1.2 with the font embedding option turned on and this does indeed appear to be a problem. Fonts embedded:

- Liberation Sans
- Liberation Sans Bold
- Liberation Sans Italic
- Liberation Sans Bold Italic
- DejaVu Sans
- DejaVu Sans Bold
- FreeSans
- FreeSansOblique

Liberation Sans is the metric equivalent of Arial, so it will be a substitution (as I do not presently have Arial installed). The others I am unsure about and I am also not sure why the Futura Lt BT TTF font is not embedded (this I can confirm). Overall I feel this report is likely a duplicate of bug 65353. Platform set to All/All. Bug 65353 added to See Also list for now.

[1] This location may change, refer bug 64357.
Comment 2 Timur 2014-10-03 08:44:24 UTC Comment hidden (obsolete)
Comment 3 Adolfo Jayme Barrientos 2014-10-09 08:57:02 UTC
(In reply to squeezechart from comment #0)
> The font that is used in whole document is !not! embedded (Futura Lt BT)

Does that particular font have the embedding permission? If not, LibreOffice won’t embed it as it’d be illegal.

To check a font’s permissions, use this tool: https://www.microsoft.com/typography/property/fpedit.htm
Comment 4 Owen Genat (retired) 2014-10-10 11:03:08 UTC
(In reply to Adolfo Jayme from comment #3)
> (In reply to squeezechart from comment #0)
> > The font that is used in whole document is !not! embedded (Futura Lt BT)
> 
> Does that particular font have the embedding permission? If not, LibreOffice
> won’t embed it as it’d be illegal.

In my test (comment 1) the version of this TTF I used (v1.52 / 1993 from Bitstream) has, in FontForge, the Embeddable field set to "Editable Document" with both options No Subsetting and Only Embed Bitmaps unchecked. That would seem to imply it is possible to embed the version I tested with, yes? This may mean that at least in terms of this font not being embedded, this bug is confirmed. I can email the font Adolfo if that will assist.
Comment 5 mmolle 2014-10-11 15:17:51 UTC
I had the Problem with the font 'Segoe UI light'. All .ttf-Files of the Segoe UI family are marked 0x0008 (editable embedding, http://www.microsoft.com/typography/otspec/os2.htm#fst), and some segoeui?.ttf files are embedded, but not the segoeuil.ttf.

thx!
Comment 6 Rpnpif 2016-08-29 10:55:12 UTC
This annoying issue is confirmed by several users for two years at least.

It exists in Writer and Calc.

Regards.
Comment 7 Rpnpif 2016-08-29 10:57:09 UTC
This bug is to rely to #65353.
Comment 8 squeezechart 2016-09-20 12:47:58 UTC Comment hidden (obsolete)
Comment 9 madmalkav 2016-11-25 19:17:09 UTC
Another sample of file with not working embedded fonts:

https://github.com/madmalkav/apuntes-japones-EOI/blob/master/Apuntes%20de%20japones.odt

The file uses two fonts:

Yu Gothic UI Light, with font property embeddable set to Editable. This is a Windows 10 system font, also available for download here: https://www.microsoft.com/en-us/download/details.aspx?id=49114

KanjiStrokeOrders, with font property embeddable set to Installable. This is a free font downloadable from: http://www.nihilist.org.uk/

The problem have been verified in both LInux and Windows with different versions of LO 5.x , including last nightly.
Comment 10 squeezechart 2017-12-18 10:47:35 UTC Comment hidden (obsolete)
Comment 11 Buovjaga 2017-12-19 14:06:38 UTC
*** Bug 113658 has been marked as a duplicate of this bug. ***
Comment 12 Robert 2018-06-19 23:09:42 UTC
Created attachment 142943 [details]
Demo of problem

This demonstrates the problem. Fonts are set to be embedded, and the two fonts have installable for the embedding permission. Yet neither is in the font folder.
Comment 13 Robert 2018-06-19 23:16:58 UTC
Confirmed problem exists in LibreOffice Writer 5.4.4 and 5.4.7.2 (both x64). See attachment "Demo of problem". I added two lines, then manually (not with styles) changed the font of one line to Merriweather Light and the other line to Montserrat ExtraBold.

Both fonts were downloaded from FontSquirrel, both under the SIL Open Font License v1.10. I checked the embedding permissions on both fonts, and they are both installable.

If I open the saved file with 7-zip and look at the font folder, neither font is in there. They are not being embedded even though the embed fonts checkbox is checked.
Comment 14 QA Administrators 2019-06-20 02:50:55 UTC Comment hidden (obsolete)
Comment 15 squeezechart 2019-09-27 06:13:27 UTC Comment hidden (obsolete)
Comment 16 squeezechart 2020-11-23 09:25:11 UTC
still present in LibreOffice 7.1.0 alpha 1
Comment 17 libreuser 2022-05-28 19:36:46 UTC
Created attachment 180444 [details]
unused_font_not_removed_used_font_not_embedded.odt

I also hit the bug and spent hours to find a workaround or to fix my odt.

In a fresh document, my used font "Breitkopf FrakturUNZ1L" is embedded (except if only using it in an applied style - see bug 149348), but not in the document I edited.

I even completely cleared the complete document and removed the direct formatting of the one and only remaining empty paragraph. Surprisingly one font is still embedded despite it's now unused - "Alte DIN 1451 Mittelschrift".

The workaround I've done now is completely unfeasible for the average user and big documents - see below steps.
- Open document.
- Reformat document to only use styles.
- Close document.
- Open content.xml of the odt file and delete everything within the tags <office:automatic-styles> - except the ones having 'style:family="graphic"'.
- Open document.
- Add empty paragraph(s), each directly formatted with the required font.
- Save and close document. Fonts will now get embedded.
Comment 18 libreuser 2022-05-28 19:39:42 UTC
Created attachment 180445 [details]
used_fonts_embedded.odt