[Libreoffice-bugs] [Bug 114738] New: EMF+ rendering problems

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Thu Dec 28 17:13:37 UTC 2017


https://bugs.documentfoundation.org/show_bug.cgi?id=114738

            Bug ID: 114738
           Summary: EMF+ rendering problems
           Product: LibreOffice
           Version: 5.4.4.2 release
          Hardware: All
                OS: Windows (All)
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: LibreOffice
          Assignee: libreoffice-bugs at lists.freedesktop.org
          Reporter: bugreporter70 at gmail.com

Created attachment 138713
  --> https://bugs.documentfoundation.org/attachment.cgi?id=138713&action=edit
Test EMF+ file in dual EMF/EMF+ format.

I'm a software developer and recently added transparency support to my app
using GDI+ which requires EMF+ for transparency support when exporting.

Although my EMF+ images appear fine in MS Office, they aren't rendered properly
in LibreOffice 5.4.4.2. I later installed 6.0 and although some issues were
fixed, some things were made much worse.

1. Prior to 6.0, rotated text was rendered as horizontal text. In 6.0, the
rotated text doesn't appear at all.

2. 5.4 properly renders colors with transparency. 6.0 renders colors with
transparency as totally opaque.

I've cobbled together some source code from MSDN that demonstrates the
problems. I was originally testing the code against 5.4 so some issues have
already been fixed in 6.0.

        Metafile metafile(L"test.emf", hdc, EmfTypeEmfPlusDual, NULL);
        {
                Graphics graphics(&metafile);
                SolidBrush solidBrush(Color(255, 0, 0, 255));
                SolidBrush transparentBrush(Color(128, 0, 0, 255)); // 6.0
renders as opaque
                Pen bluePen(Color(255, 0, 0, 255));
                Pen greenPen(Color(255, 0, 255, 0));

                // Issue #1: 5.4 can't render bezier spline. Fixed in 6.0
                graphics.DrawBezier(&bluePen, 30, 20, 80, 60, 120, 180, 140,
50);

                // Issue #2: 5.4 draws text but won't rotate it. 6.0 renders
nothing.
                // Add some text (drawn with antialiasing) to the metafile.
                FontFamily fontFamily(L"Arial");
                Gdiplus::Font font(&fontFamily, 24, FontStyleRegular,
UnitPixel);
                graphics.SetTextRenderingHint(TextRenderingHintAntiAlias);
                graphics.DrawString(L"Transparent Text", 16, &font, 
                        PointF(50.0f, 50.0f), &transparentBrush);
                graphics.RotateTransform(30.0f);
                graphics.DrawString(L"Rotated Text", 12, &font, 
                        PointF(50.0f, 50.0f), &solidBrush);
                graphics.ResetTransform() ;

                GraphicsPath clip;
                clip.AddRectangle(Rect(150, 10, 20, 50));
                graphics.SetClip(&clip);
                // Add an ellipse (drawn with antialiasing) to the metafile.
                graphics.SetSmoothingMode(SmoothingModeHighQuality);
                graphics.FillEllipse(&transparentBrush, Rect(150, 10, 25, 75));
                graphics.ResetClip();

                // Issue #3: 5.4 doesn't support ResetClip() so the following
will be clipped out. Fixed in 6.0.
                // Avoided problem by using Save/Restore of graphics state
instead.

                // Add a rectangle and an ellipse to the metafile.
                graphics.DrawRectangle(&greenPen, Rect(50, 10, 25, 75));
                graphics.DrawEllipse(&greenPen, Rect(100, 10, 25, 75));
        }

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20171228/afaeffd5/attachment-0001.html>


More information about the Libreoffice-bugs mailing list