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)
Formula appears small (12 points)
Formula should appear big (60 points)
User Profile Reset: Yes
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
Kindly attach an image with error
Created attachment 141029 [details]
Video showing a file in Impress, saving it as pptx and opening in PowerPoint, which shows the bug
Created attachment 141030 [details]
Presentation file with a large (120 point) formula (odp)
Created attachment 141031 [details]
Same presentation file but converted by LO to pptx. Opens in PowerPoint with a small font.
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?
Windows 10 Home 64-bit en-US with
Version: 184.108.40.206.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
Created attachment 141038 [details]
Same presentation file, after correcting the font size inside MS Office
Please compare the file:
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:
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.
(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.
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.
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 220.127.116.11 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.