MSO created DOCX attachment 165503 [details] from (dumpyard) bug 131381 opens EMF image with wrong text, as compared with MSO in attachment 165504 [details] . DOCX is old format, but similar if resaved in MSO. Didn't open in LO 3.5. Similar from 3.6 to 7.1+ for me. Test in Windows 7 OpenGL and GDI (with and without OpenGL) for older LO 6.4 and Skia and GDI in LO 7.1+. Reported added different comparison with MSO as attachment 166332 [details]. I don't know how he gets that.
Reproduced in Version: 7.1.0.0.alpha0+ Build ID: a9976a958b2857e308c6598532151878615bfd9f CPU threads: 4; OS: Linux 5.7; UI render: default; VCL: gtk3 Locale: en-US (en_US.UTF-8); UI: en-US Calc: threaded
Created attachment 167142 [details] EMF Fileopen DOCX is not important. Also if EMF inserted in new Writer.
Created attachment 167176 [details] Logs from importing emf file
The root cause of wrongly displayed text is lack of implementation of ETO_GLYPH_INDEX option from EMR_EXTTEXTOUTW record. ETO_GLYPH_INDEX bit indicates that the codes for characters in an output text string are actually indexes of the character glyphs in a TrueType font. Glyph indexes are font-specific, so to display the correct characters on playback, the font that is used MUST be identical to the font used to generate the indexes. Generally it is not possible to get right character from Unicode, and it should be taken directly from TrueType font index. More information: https://social.msdn.microsoft.com/Forums/windowsdesktop/en-US/5c88ddaf-5dbe-4f81-9c0d-83785798d500/how-to-get-right-unicode-character-when-exttextoutw-called-with-etoglyphindex-set-in-fuoptions?forum=windowssdk I found also some useful implementation on Qt side, which could be helpful: https://bugreports.qt.io/browse/QTBUG-40683
Just for the record, on pc Debian x86-64 with master sources updated today, I noticed these logs: warn:emfio:8686:8686:emfio/source/reader/emfreader.cxx:1927: SJ: ETO_PDY || ETO_GLYPH_INDEX in EMF warn:drawinglayer.emf:8686:8686:drawinglayer/source/tools/emfphelperdata.cxx:1773: EMF+ TODO SetPixelOffsetMode warn:drawinglayer.emf:8686:8686:drawinglayer/source/tools/emfphelperdata.cxx:1760: EMF+ TODO SetAntiAliasMode warn:drawinglayer.emf:8686:8686:drawinglayer/source/tools/emfphelperdata.cxx:1767: EMF+ TODO InterpolationMode
More information: https://docs.microsoft.com/en-us/typography/opentype/spec/cmap