Created attachment 56202 [details] remove appending of the hard-coded font sizes (made against git checkout) This is about formulas in writer file which is being exported (saved as) microsoft word .doc file. The current conversion routines in starmath/ subdir append hard-coded font sizes ("size 12" to normal content, "size 8" to super- and subscripts etc.), regardless of what is set in LibreOffice formula editor's settings. That is, of course, completely wrong approach. This way formulas are, in fact, corrupted. There are many tickets for this issue filed in OOO bugzilla, by the way. One way of correcting this is proposed in a patch attached, pending the implementation of "completely correct" way of exporting font sizes in formulas to .doc (in ole streams attributes). This patch just removes the code which adds "size %d {" and corresponding "}". "Works for me", as now I'm able to export many-formulas document to word's .doc and not have to *edit* each and every of those, if something other than "size 12" is required (I still have to double-click each and every of those to correct the previews, but that's another problem, albeit related).
@ Michael Please, take look at this bug. Appears that it contains ready patch for fixing this bug.
@ Ivan Please, take look at this bug. Appears that it contains ready patch for fixing this bug.
sounds plausible, but i know ~nothing about WW8; Caolan, Cedric, Lubos: please take a look at the patch here
seeing as this is a patch to the import, I guess the problem is a round trip from .doc back to .doc again ? Can you attach a demo document which shows the problem that this fixes. Its been a very long time since I played with the MathType format.
Heh, since I am in the CC list... :) The patch looks a bit weird to me: it removes the support of the SIZE record of the MTEF. However, MTEF is the format I am not familiar with, I have just downloaded the specification and looking into it right now. :)
I'll attach a prepared and re-tested example tomorrow. And, like I said before, this patch is not a real solution, but a kludge, really. As I don't understand the starmath module too well myself, I've just removed ("hacked off") a provision for inserting the "size" tag, which is abused by export to Word Eq. editor AND import from Word Eq. editor routines. Personally, I can live without "size" tag (I'd rather have a global font size(s) changing control/dialog), but the effective corruption of formulas by insertion of "size 12", "size 8" is quite a PITA.
Created attachment 57967 [details] 10pt equivalent of ooo's "{a123} wideslash {b456}" made in word
Created attachment 57968 [details] 14pt equivalent of "{a123} wideslash {b456}" made in word
Created attachment 57969 [details] 10pt imported with 3.5.1rc1
Created attachment 57970 [details] 14pt imported with 3.5.1rc1
Created attachment 57971 [details] 10pt imported with patched 3.5.0
Created attachment 57972 [details] 14pt imported with patched 3.5.0
Okay, here come the examples. Two files contain an equivalent of "{a123} wideslash {b456}" prepared in Word 2003 eqaution editor. One was composed with font size set to 10pt, another — to 14 pt. Please note that the overall formula's font size in examples isn't actually included into mathtype equation elements, but is put into a position preceding the equation proper. This is deduced from the binary comparison results. Now, the import screens show where things go wrong in the mainstream LibO/OOO: 1) The formula's font size (10pt or 14pt in this case) is lost. The actual formula font size setting is in all cases 11pt (as set as default in local installation; dialog not shown), and so differs with what was actually set in Word file. This is, however, bearable. 2) What's worse, formulas get sprayed with «size 12» and «size 8» (these are arbitrary sizes taken from the array in the starmath/source/mathtype.cxx, in function MathType::Init()), which is completely unacceptable. Just imagine clearing those out in 100 formulas or so. P.S. As a side question, I notice that, e.g., CmathOOO extension is capable of composing the formula «on the run» and inserting it with font size and face taken from paragraph style. How difficult would it be to implement: 1) *optional* setting of font size and face in imported formulas to whatever was set in imported file (say, Times New Roman and 10pt); 2) batch changing of the font faces and sizes of all formulas in LibO/OOO document; optionally, do it like it's done in KDE fonts dialog (adjust face only, or size only, etc.)?
Restricted my LibreOffice hacking area
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.