Bug 116749 - Font size and font of Formula object are not kept when displaying the OLE object in Microsoft Word or Powerpoint, OOXML and ODF formated documents
Summary: Font size and font of Formula object are not kept when displaying the OLE obj...
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: filters and storage (show other bugs)
Version:
(earliest affected)
5.4.6.2 release
Hardware: x86-64 (AMD64) All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: interoperability
Keywords: filter:docx, filter:pptx
Depends on:
Blocks: DOCX-Formula PPTX-Equations
  Show dependency treegraph
 
Reported: 2018-04-02 13:24 UTC by Shimi Chen
Modified: 2023-01-26 03:23 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
Video showing a file in Impress, saving it as pptx and opening in PowerPoint, which shows the bug (3.34 MB, video/ogg)
2018-04-02 14:04 UTC, Shimi Chen
Details
Presentation file with a large (120 point) formula (odp) (14.84 KB, application/vnd.oasis.opendocument.presentation)
2018-04-02 14:06 UTC, Shimi Chen
Details
Same presentation file but converted by LO to pptx. Opens in PowerPoint with a small font. (20.48 KB, application/wps-office.pptx)
2018-04-02 14:08 UTC, Shimi Chen
Details
Same presentation file, after correcting the font size inside MS Office (37.95 KB, application/wps-office.pptx)
2018-04-02 17:49 UTC, Shimi Chen
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Shimi Chen 2018-04-02 13:24:42 UTC
Description:
When saving a docx/pptx (MSXML) file with a large (say 60-point) formula, the font size is not kept. When opening the generated MSXML file in LibreOffice it looks okay-ish (similar size to original odp/odt, but looks a bit different because it is a streched-out 12-point font). However, in MS Office, it just appears as a small 12-point formula.

Steps to Reproduce:
1. Open Writer or Impress
2. Enter some formula (Insert->Object->Formula...)
3. Change font size of the formula to a large value (such as 60)
4. File -> Save a copy...
5. Choose pptx or docx
6. Open the MSXML file in MS Office (tested both 2013 and Online)

Actual Results:  
Formula appears small (12 points)

Expected Results:
Formula should appear big (60 points)


Reproducible: Always


User Profile Reset: Yes



Additional Info:
Version: 6.0.2.1.0+
Build ID: 6.0.2-3
CPU threads: 8; OS: Linux 4.15; UI render: default; VCL: gtk3; 
Locale: en-GB (en_US.utf8); Calc: group


User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:59.0) Gecko/20100101 Firefox/59.0
Comment 1 subha 2018-04-02 13:35:12 UTC
@Shimi Chen
Kindly attach an image with error
Comment 2 Shimi Chen 2018-04-02 14:04:22 UTC
Created attachment 141029 [details]
Video showing a file in Impress, saving it as pptx and opening in PowerPoint, which shows the bug
Comment 3 Shimi Chen 2018-04-02 14:06:58 UTC
Created attachment 141030 [details]
Presentation file with a large (120 point) formula (odp)
Comment 4 Shimi Chen 2018-04-02 14:08:27 UTC
Created attachment 141031 [details]
Same presentation file but converted by LO to pptx. Opens in PowerPoint with a small font.
Comment 5 V Stuart Foote 2018-04-02 14:45:40 UTC
Confirming Office 2016 renders OLE formulas, *both* OOXML/ODF, created with LibreOffice at a smaller scale. Looks to always have a font substitution to Cambria Math at 18 pt. Yet even if in the LibreOffice OLE Formula edit I select Cambria/Cambria Math font at large pt. size--Office 2016 still opens it at fixed 18 pt.

LibreOffice opens either format with correct font and correct point size.

So, is this a OOXML incompatibility? Or a filter import default applied in MS Office and NOTOURBUG?

=-resting-=
Windows 10 Home 64-bit en-US with 

Version: 6.1.0.0.alpha0+ (x64)
Build ID: 655b9054bc265de377c3dc411e2ef40cdfd16dce
CPU threads: 4; OS: Windows 10.0; UI render: GL; 
TinderBox: Win-x86_64@42, Branch:master, Time: 2018-03-27_03:21:52
Locale: en-US (en_US); Calc: CL
Comment 6 Shimi Chen 2018-04-02 17:49:19 UTC
Created attachment 141038 [details]
Same presentation file, after correcting the font size inside MS Office

Please compare the file:
/ppt/slides/slide1.xml
In both this pptx archive and the pptx  archive created by LibreOffice (previous attachment).

MS Office seems to be using the "sz" argument to set the font size of the element (in this case sz=12000, so 100*PointSize), whereas LibreOffice does not use it at all in OOXML and instead just stretches out a 12-point font to a bigger box.

If you open the previous attachment in LibreOffice you can see that the font size in the (seemingly large) formula is in fact only 12, not 120. If you open the current attachment (created by MS Office) in LO, then it fails horribly (it shows 2 separate formulas with different sizes, one of which is identified as a formula with font size of 12 and the other looks like an image, and both are visually much larger than 12).

The "sz" argument seems to be documented as part of the OOXML format:
http://officeopenxml.com/WPtextFormatting.php

But I don't get why it is 12000, should be 240 if I'm reading the definition correctly. However, I don't actually know anything about OOXML, just thought i'd try to poke inside.
Comment 7 Regina Henschel 2018-04-02 21:26:46 UTC
(In reply to V Stuart Foote from comment #5)
> Confirming Office 2016 renders OLE formulas, *both* OOXML/ODF, created with
> LibreOffice at a smaller scale.
Considering OOXML and ODF mixes independent problems: (A) font size in MathML in OpenDocument format, and (B) import/export equations from/to OOXML.

(A)
Currently LibreOffice stores these information in settings.xml. That produces similar problems in storing to flat file format, see bug 76900 and bug 63642. If it is only about font size, then attribute mathsize="120pt" or attribute style="font-size:120pt;" can be used on the root <math> element. That would have the advantage, that export to MathMl (.mml) would get it correct too. For embedded formulas enlarging the rendering via frame size should work too.  Unfortunately MS Office reads none of the solutions correctly.

(B)
As far as I see, OMML (the equation part of OOXML) does not have a distinct element or attribute for font-size in equations. But MS Office uses the common sz attribute of type ST_TextFontSize, which is indeed "hundredths of a point". (chapter 20.1.10.68 in ISO/IEC 29500-1:2026(E)). It adds a "rPr" element with "sz" attribute to each math element if needed. LibreOffice should write this attribute too.

I suggest to focus this issue on error B.
Comment 8 QA Administrators 2019-11-06 03:31:19 UTC Comment hidden (obsolete)
Comment 9 Regina Henschel 2019-11-06 12:34:54 UTC
Fontsize is not written in a way to docx, that MS Office can use it.
Tested with Version: 6.4.0.0.alpha1+ (x64)
Build ID: 7c6226bee72805db7f0e567ca9f06c786a7d0da2
CPU threads: 8; OS: Windows 10.0 Build 18362; UI render: default; VCL: win; 
Locale: de-DE (en_US); UI-Language: en-US
Calc: threaded
Comment 10 QA Administrators 2023-01-26 03:23:27 UTC
Dear Shimi Chen,

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/

If the bug is present, please leave a comment that includes the information from Help - About LibreOffice.
 
If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice.

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not 
appropriate in this case)


If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:
1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug
3. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to 'inherited from OOo';
4b. If the bug was not present in 3.3 - add 'regression' to keyword


Feel free to come ask questions or to say hello in our QA chat: https://web.libera.chat/?settings=#libreoffice-qa

Thank you for helping us make LibreOffice even better for everyone!

Warm Regards,
QA Team

MassPing-UntouchedBug