Bug 138797 - Impress OTP file grows hugely embedding fonts
Summary: Impress OTP file grows hugely embedding fonts
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Impress (show other bugs)
Version:
(earliest affected)
6.4.6.2 release
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: Fonts-Embedded
  Show dependency treegraph
 
Reported: 2020-12-10 11:46 UTC by Gabriele Ponzo
Modified: 2023-03-27 13:46 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gabriele Ponzo 2020-12-10 11:46:42 UTC
Description:
A template passes from 11KB to more than 36MB just selecting the font embedding option. Does LO embed ALL the system's fonts?

I'm not sure it is a bug :)

Steps to Reproduce:
1. Open Impress (choosing a blank template if asked)
2. Write some dummy text and Save the file
3. Go to Menu "File -> Properties", Tab "Font"
4. Check "Embed fonts in the document" and click "OK"
5. Save the file with a different name
6. Open the folder and compare sizes

Actual Results:
In my PC file size passes from 11.4KB to 36.4MB

Expected Results:
I'd expect a grow comparable to the size of all fonts "mentioned" in the file, even if not used. Something less than 1MB in this case.


Reproducible: Always


User Profile Reset: No



Additional Info:
Version: 6.4.6.2
Build ID: 1:6.4.6-0ubuntu0.20.04.1
CPU threads: 8; OS: Linux 5.4; UI render: default; VCL: gtk3; 
Locale: it-IT (it_IT.UTF-8); UI-Language: en-GB
Calc: threaded
Comment 1 Julien Nabet 2020-12-10 20:09:31 UTC
I think it's the same root cause that tdf#137247
see also https://bugs.documentfoundation.org/show_bug.cgi?id=137247#c2

The pb is once you begin to enable this option it will keep on growing at each saving.

Mike: any thoughts here or any idea who may help here?
Comment 2 Mike Kaganski 2020-12-11 06:56:17 UTC
(In reply to Julien Nabet from comment #1)
> Mike: any thoughts here or any idea who may help here?

In Writer, unchecking this gives the expected result. I would start with debugging the difference; maybe the m_bTryToEmbedFonts gets "true" somehow when the option is unchecked in the form? maybe the properties do not modify the correct setting (e.g., affect an embedded document instead of main ODB)?
Comment 3 Julien Nabet 2020-12-11 18:28:30 UTC
Thank you Mike for your feedback.
With Writer, no pb at all indeed.
With Impress, when looping with embedded fonts enabled->embedded fonts disabled->embedded fonts enabled, it takes 1 or 2 bytes each time so there's a pb but not as much as tdf#137247, I'm gonna compare.
Comment 4 Julien Nabet 2020-12-13 09:47:04 UTC
Gabriele: re reading your bugs, I think it's perhaps not a bug. 

On pc Debian x86-64 with LO Debian package 7.0.3.1, an Impress file containing just "Hello" is 12kB with fonts embedded, it's 3.7mB
With just "Used fonts only",it's 3mB

On Win10 with LO 6.4.7 and no specific fonts a file which just contains "Hello" is 12kB with fonts embedded, it's 815kB, idem with "Used fonts only".

In both cases, I used by default template.

I don't know how LO chooses the fonts to use and I suppose it depends on if you install specific fonts on your system but you can check "Only embed fonts that are used in documents".


About the tests, I had made after increasing of 1 byte after some saves, at a moment, it goes down again.
Comment 5 Julien Nabet 2020-12-23 08:15:57 UTC
It seems ok here so since I can't help more here=>uncc myself.
Comment 6 Gabriele Ponzo 2020-12-23 10:23:14 UTC
(In reply to Julien Nabet from comment #4)
> Gabriele: re reading your bugs, I think it's perhaps not a bug. 
> 
> On pc Debian x86-64 with LO Debian package 7.0.3.1, an Impress file
> containing just "Hello" is 12kB with fonts embedded, it's 3.7mB
> With just "Used fonts only",it's 3mB
> 
> On Win10 with LO 6.4.7 and no specific fonts a file which just contains
> "Hello" is 12kB with fonts embedded, it's 815kB, idem with "Used fonts only".
> 
> In both cases, I used by default template.
> 
> I don't know how LO chooses the fonts to use and I suppose it depends on if
> you install specific fonts on your system but you can check "Only embed
> fonts that are used in documents".
> 
> 
> About the tests, I had made after increasing of 1 byte after some saves, at
> a moment, it goes down again.

Well, I did some further test too.
I created (again) a imple file with just "hello" and saved in 3 ways and then I uncompressed them to see what was inside:
1. regular: no Fonts folder
2. embed fonts: a Fonts folder is present as follows
740K Font_DejaVu_Sans_1.ttf
690K Font_DejaVu_Sans_2.ttf
822K Font_FreeSans_1.ttf
449K Font_FreeSans_2.ttf
400K Font_Liberation_Sans_1.ttf
403K Font_Liberation_Sans_2.ttf
404K Font_Liberation_Sans_3.ttf
398K Font_Liberation_Sans_4.ttf
381K Font_Liberation_Serif_1.ttf
358K Font_Liberation_Serif_2.ttf
364K Font_Liberation_Serif_3.ttf
364K Font_Liberation_Serif_4.ttf
 20M Font_Noto_Sans_CJK_SC_1.ttf   <-- THIS FONT IS 20M!!!
 20M Font_Noto_Sans_CJK_SC_2.ttf   <-- THIS FONT IS 20M!!!
So the mystery is explained in those 2 fonts
3. embed just used fonts: NO FONTS FOLDER! Nor any ttf in the whole branch.
And this is a(nother) bug, since it should include at least one font (Liberation Sans in my case).

So the point is: probably the behaviour of embed-all is correct, but I don't know if it worths a consideration about the possibility to add another (nested) option such as "exclude CJK fonts"...

About the emed-just-used not working please tell me if I should file another bug.
Comment 7 BogdanB 2021-01-20 17:53:53 UTC
First file - 11 kb
Second file - 36,7 MB

Tested with
Version: 7.0.4.2
Build ID: dcf040e67528d9187c66b2379df5ea4407429775
CPU threads: 4; OS: Linux 5.8; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded

The same tested with
Version: 7.2.0.0.alpha0+ / LibreOffice Community
Build ID: 4e1294b7d6f8de981147f15d4ca1b4e4853249eb
CPU threads: 4; OS: Linux 5.8; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded
Comment 8 QA Administrators 2023-01-21 03:23:57 UTC Comment hidden (obsolete)
Comment 9 BogdanB 2023-01-21 20:13:05 UTC
In the dbg version, I'm getting these messages:

warn:xmloff:201398:201398:xmloff/source/style/impastpl.cxx:379: Adding duplicate family graphic with mismatching mapper ! P25SvXMLExportPropertyMapper 28XMLShapeExportPropertyMapper
warn:xmloff:201398:201398:xmloff/source/style/impastpl.cxx:379: Adding duplicate family presentation with mismatching mapper ! P25SvXMLExportPropertyMapper 28XMLShapeExportPropertyMapper
warn:xmloff:201398:201398:xmloff/source/style/impastpl.cxx:379: Adding duplicate family graphic with mismatching mapper ! P25SvXMLExportPropertyMapper 28XMLShapeExportPropertyMapper
warn:xmloff:201398:201398:xmloff/source/style/impastpl.cxx:379: Adding duplicate family presentation with mismatching mapper ! P25SvXMLExportPropertyMapper 28XMLShapeExportPropertyMapper
warn:xmloff:201398:201398:xmloff/source/style/impastpl.cxx:379: Adding duplicate family graphic with mismatching mapper ! P25SvXMLExportPropertyMapper 28XMLShapeExportPropertyMapper
warn:xmloff:201398:201398:xmloff/source/style/impastpl.cxx:379: Adding duplicate family presentation with mismatching mapper ! P25SvXMLExportPropertyMapper 28XMLShapeExportPropertyMapper
warn:legacy.osl:201398:201398:sd/source/core/stlsheet.cxx:1184: SvxShape::GetAnyForItem() Returnvalue has wrong Type!
warn:legacy.osl:201398:201398:sd/source/core/stlsheet.cxx:1184: SvxShape::GetAnyForItem() Returnvalue has wrong Type!
warn:legacy.osl:201398:201398:sd/source/core/stlsheet.cxx:1184: SvxShape::GetAnyForItem() Returnvalue has wrong Type!
warn:legacy.osl:201398:201398:sd/source/core/stlsheet.cxx:1184: SvxShape::GetAnyForItem() Returnvalue has wrong Type!
warn:legacy.osl:201398:201398:sd/source/core/stlsheet.cxx:1184: SvxShape::GetAnyForItem() Returnvalue has wrong Type!
warn:legacy.osl:201398:201398:sd/source/core/stlsheet.cxx:1184: SvxShape::GetAnyForItem() Returnvalue has wrong Type!
warn:legacy.osl:201398:201398:sd/source/core/stlsheet.cxx:1184: SvxShape::GetAnyForItem() Returnvalue has wrong Type!
warn:legacy.osl:201398:201398:sd/source/core/stlsheet.cxx:1184: SvxShape::GetAnyForItem() Returnvalue has wrong Type!
warn:legacy.osl:201398:201398:sd/source/core/stlsheet.cxx:1184: SvxShape::GetAnyForItem() Returnvalue has wrong Type!
warn:legacy.osl:201398:201398:sd/source/core/stlsheet.cxx:1184: SvxShape::GetAnyForItem() Returnvalue has wrong Type!
warn:legacy.osl:201398:201398:sd/source/core/stlsheet.cxx:1184: SvxShape::GetAnyForItem() Returnvalue has wrong Type!
warn:legacy.osl:201398:201398:sd/source/core/stlsheet.cxx:1184: SvxShape::GetAnyForItem() Returnvalue has wrong Type!
warn:legacy.osl:201398:201398:sd/source/core/stlsheet.cxx:1184: SvxShape::GetAnyForItem() Returnvalue has wrong Type!
warn:editeng:201398:201398:editeng/source/uno/unofield.cxx:375: Id service unknown: 11
warn:editeng:201398:201398:editeng/source/uno/unofield.cxx:375: Id service unknown: 13
warn:editeng:201398:201398:editeng/source/uno/unofield.cxx:375: Id service unknown: 12
warn:editeng:201398:201398:editeng/source/uno/unofield.cxx:375: Id service unknown: 2
warn:editeng:201398:201398:editeng/source/uno/unofield.cxx:375: Id service unknown: 13
warn:editeng:201398:201398:editeng/source/uno/unofield.cxx:375: Id service unknown: 12
warn:editeng:201398:201398:editeng/source/uno/unofield.cxx:375: Id service unknown: 2
warn:editeng:201398:201398:editeng/source/uno/unofield.cxx:375: Id service unknown: 11
warn:editeng:201398:201398:editeng/source/uno/unofield.cxx:375: Id service unknown: 13
warn:editeng:201398:201398:editeng/source/uno/unofield.cxx:375: Id service unknown: 12
warn:editeng:201398:201398:editeng/source/uno/unofield.cxx:375: Id service unknown: 2
warn:editeng:201398:201398:editeng/source/uno/unofield.cxx:375: Id service unknown: 11
warn:editeng:201398:201398:editeng/source/uno/unofield.cxx:375: Id service unknown: 13
warn:editeng:201398:201398:editeng/source/uno/unofield.cxx:375: Id service unknown: 12
warn:editeng:201398:201398:editeng/source/uno/unofield.cxx:375: Id service unknown: 2
warn:editeng:201398:201398:editeng/source/uno/unofield.cxx:375: Id service unknown: 13
warn:editeng:201398:201398:editeng/source/uno/unofield.cxx:375: Id service unknown: 12
warn:editeng:201398:201398:editeng/source/uno/unofield.cxx:375: Id service unknown: 2
warn:editeng:201398:201398:editeng/source/uno/unofield.cxx:375: Id service unknown: 11
warn:editeng:201398:201398:editeng/source/uno/unofield.cxx:375: Id service unknown: 13
warn:editeng:201398:201398:editeng/source/uno/unofield.cxx:375: Id service unknown: 12
warn:editeng:201398:201398:editeng/source/uno/unofield.cxx:375: Id service unknown: 2
warn:xmloff:201398:201398:xmloff/source/style/impastpl.cxx:379: Adding duplicate family graphic with mismatching mapper ! P25SvXMLExportPropertyMapper 28XMLShapeExportPropertyMapper
warn:xmloff:201398:201398:xmloff/source/style/impastpl.cxx:379: Adding duplicate family presentation with mismatching mapper ! P25SvXMLExportPropertyMapper 28XMLShapeExportPropertyMapper
warn:xmloff:201398:201398:xmloff/source/style/impastpl.cxx:379: Adding duplicate family graphic with mismatching mapper ! P25SvXMLExportPropertyMapper 28XMLShapeExportPropertyMapper
warn:xmloff:201398:201398:xmloff/source/style/impastpl.cxx:379: Adding duplicate family presentation with mismatching mapper ! P25SvXMLExportPropertyMapper 28XMLShapeExportPropertyMapper
warn:xmloff:201398:201398:xmloff/source/style/impastpl.cxx:379: Adding duplicate family graphic with mismatching mapper ! P25SvXMLExportPropertyMapper 28XMLShapeExportPropertyMapper
warn:xmloff:201398:201398:xmloff/source/style/impastpl.cxx:379: Adding duplicate family presentation with mismatching mapper ! P25SvXMLExportPropertyMapper 28XMLShapeExportPropertyMapper

Version: 7.6.0.0.alpha0+ (X86_64) / LibreOffice Community
Build ID: 24c9373409dda957ad6e1f1b4e3ec6c7135ecf1a
CPU threads: 16; OS: Linux 5.15; UI render: default; VCL: gtk3
Locale: ro-RO (ro_RO.UTF-8); UI: en-US
Calc: threaded