http://bugs.winehq.org/show_bug.cgi?id=22996
Summary: Altium Designer print preview displays inverted text in schematic views Product: Wine Version: 1.2-rc2 Platform: x86 OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: gdi32 AssignedTo: wine-bugs@winehq.org ReportedBy: johnvoltz@gmail.com
Created an attachment (id=28487) --> (http://bugs.winehq.org/attachment.cgi?id=28487) Screenshot
The print preview function in Altium Designer displays inverted (Y axis) text when viewing the print preview for a schematic diagram.
http://bugs.winehq.org/show_bug.cgi?id=22996
Dmitry Timoshkov dmitry@codeweavers.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Component|gdi32 |-unknown
http://bugs.winehq.org/show_bug.cgi?id=22996
Wylda wylda@volny.cz changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |wylda@volny.cz
--- Comment #1 from Wylda wylda@volny.cz 2010-06-10 04:00:13 ---
Confirming. I also tried whether this is a regression, but first version, where app runs for me is wine-1.1.36, which also shows upside down text in print preview exactly like 1.2-rc2-250-g950919.
http://bugs.winehq.org/show_bug.cgi?id=22996
Wylda wylda@volny.cz changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed|0 |1
--- Comment #2 from Wylda wylda@volny.cz 2010-06-15 15:05:07 ---
Confirming per my retest.
http://bugs.winehq.org/show_bug.cgi?id=22996
A. Kochetkov al.kochet@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |al.kochet@gmail.com
--- Comment #3 from A. Kochetkov al.kochet@gmail.com 2011-02-07 23:50:44 CST --- Patch was sent: http://www.winehq.org/pipermail/wine-patches/2011-February/098653.html
http://bugs.winehq.org/show_bug.cgi?id=22996
Konstantin Kondratyuk kondratyuk@etersoft.ru changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |kondratyuk@etersoft.ru
http://bugs.winehq.org/show_bug.cgi?id=22996
john.voltz@gmail.com john.voltz@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |john.voltz@gmail.com
--- Comment #4 from john.voltz@gmail.com john.voltz@gmail.com 2011-02-10 07:41:00 CST --- (In reply to comment #3)
Patch was sent: http://www.winehq.org/pipermail/wine-patches/2011-February/098653.html
There is still one problem after your patch. Vertically aligned text is flipped on the Y axis. Thanks for the patch, it's almost perfect!
http://bugs.winehq.org/show_bug.cgi?id=22996
--- Comment #5 from john.voltz@gmail.com john.voltz@gmail.com 2011-02-10 07:44:40 CST --- Created an attachment (id=33226) --> (http://bugs.winehq.org/attachment.cgi?id=33226) Screenshot after the patch
http://bugs.winehq.org/show_bug.cgi?id=22996
--- Comment #6 from A. Kochetkov al.kochet@gmail.com 2011-02-12 06:47:47 CST --- Created an attachment (id=33256) --> (http://bugs.winehq.org/attachment.cgi?id=33256) Patch to change font orientation in compatible mode
After this patch applied text orientation should be correct. John, could you please test?
http://bugs.winehq.org/show_bug.cgi?id=22996
--- Comment #7 from A. Kochetkov al.kochet@gmail.com 2011-02-12 07:26:26 CST --- This two patches is invalid. Error is during metafile creation. You may open print preview window, save preview as metafile and open it under windows to see the bug.
http://bugs.winehq.org/show_bug.cgi?id=22996
A. Kochetkov al.kochet@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Attachment #33256|0 |1 is obsolete| |
http://bugs.winehq.org/show_bug.cgi?id=22996
--- Comment #8 from A. Kochetkov al.kochet@gmail.com 2011-02-21 13:21:46 CST --- Created an attachment (id=33390) --> (http://bugs.winehq.org/attachment.cgi?id=33390) Metafiles with different exScale, eyScale scale factors for testing.
http://bugs.winehq.org/show_bug.cgi?id=22996
--- Comment #9 from A. Kochetkov al.kochet@gmail.com 2011-02-21 14:15:28 CST --- Created an attachment (id=33391) --> (http://bugs.winehq.org/attachment.cgi?id=33391) Patch
I found the following solution. Could you, please, take a look at it. It looks like a hack for me, but it works for Altium Designer. The patch changes the world transform the same manner as WineEngCreateFontInstance. Then, if necessary, it changes the font escapement.
According to the metafiles attached, the text is displayed in the correct position, but inverted. This means that the rotations and transformations are correct. Lacks only the scale factors exScale, eyScale to be applied to the glyphs before the other transformations.
I tried to find a function similar to CreateFontIndirect, taking exScale, eyScale (or similar) as parameters and tried to change world transform matrix without success.
Any help or advice will be really appreciated. Thank, you.
http://bugs.winehq.org/show_bug.cgi?id=22996
--- Comment #10 from Dmitry Timoshkov dmitry@codeweavers.com 2011-02-22 00:53:43 CST --- (In reply to comment #9)
I found the following solution. Could you, please, take a look at it. It looks like a hack for me, but it works for Altium Designer. The patch changes the world transform the same manner as WineEngCreateFontInstance. Then, if necessary, it changes the font escapement.
This patch looks really like a hack to me. I'd expect font rotation/scaling work same way for metafiles and normal GDI text output, so the fix should be not metafile specific.
http://bugs.winehq.org/show_bug.cgi?id=22996
--- Comment #11 from A. Kochetkov al.kochet@gmail.com 2011-02-22 01:38:12 CST --- (In reply to comment #10)
This patch looks really like a hack to me. I'd expect font rotation/scaling work same way for metafiles and normal GDI text output, so the fix should be not metafile specific.
Thank you for your time. For now, metafiles produced under wine looks like screenshot under windows (also see emf1x1.emf in the attachment). I sended another patch http://source.winehq.org/patches/data/71490 to fix that problem.
http://bugs.winehq.org/show_bug.cgi?id=22996
--- Comment #12 from A. Kochetkov al.kochet@gmail.com 2011-02-22 17:30:37 CST --- Created an attachment (id=33410) --> (http://bugs.winehq.org/attachment.cgi?id=33410) Test, which reproduces the bug (with source)
http://bugs.winehq.org/show_bug.cgi?id=22996
--- Comment #13 from A. Kochetkov al.kochet@gmail.com 2011-02-22 18:03:11 CST --- Created an attachment (id=33412) --> (http://bugs.winehq.org/attachment.cgi?id=33412) Screenshots of the test
Dmitry Timoshkov was right about the font escapement. This is very similar to Bug 16391. But the inversion of the text, most likely a problem playing the metafile and is similar to Bug 22753. I have a draft of a test for font escapement. He draws a letter without the transformation and stores the bitmap using BitBlt and GetDIBits. The test then change font escapement, once again draws the letter, read a new bitmap and compares it with the original. How such a test may be useful for Wine?
http://bugs.winehq.org/show_bug.cgi?id=22996
--- Comment #14 from Dmitry Timoshkov dmitry@codeweavers.com 2011-02-22 21:48:06 CST --- (In reply to comment #13)
I have a draft of a test for font escapement. He draws a letter without the transformation and stores the bitmap using BitBlt and GetDIBits. The test then change font escapement, once again draws the letter, read a new bitmap and compares it with the original. How such a test may be useful for Wine?
Testing bitmap contents is not useful since it may differ across platforms. Though you may try to test actual text extents returned by GetTextExtentPoint, GetOutlineTextMetrics or GetGlyphOutline, or simply point to a visual test application which shows the problem if formal testing is not possible.
http://bugs.winehq.org/show_bug.cgi?id=22996
--- Comment #15 from Dmitry Timoshkov dmitry@codeweavers.com 2011-02-22 21:56:57 CST --- (In reply to comment #12)
Created an attachment (id=33410)
--> (http://bugs.winehq.org/attachment.cgi?id=33410) [details]
Test, which reproduces the bug (with source)
This is a really good test. It would be also useful to test lfClipPrecision == CLIP_LH_ANGLES since MSDN claims that
"When this value is used, the rotation for all fonts depends on whether the orientation of the coordinate system is left-handed or right-handed.
If not used, device fonts always rotate counterclockwise, but the rotation of other fonts is dependent on the orientation of the coordinate system."
http://bugs.winehq.org/show_bug.cgi?id=22996
--- Comment #16 from Dmitry Timoshkov dmitry@codeweavers.com 2011-02-24 04:24:12 CST --- The following two patches fix the text rotation bugs in GDI and EMF modes in the attached test application, what remains to be fixed is a correct text base line calculation:
http://www.winehq.org/pipermail/wine-patches/2011-February/099231.html http://www.winehq.org/pipermail/wine-patches/2011-February/099232.html
http://bugs.winehq.org/show_bug.cgi?id=22996
--- Comment #17 from john.voltz@gmail.com john.voltz@gmail.com 2011-02-24 07:28:41 CST --- Created an attachment (id=33433) --> (http://bugs.winehq.org/attachment.cgi?id=33433) Screenshot after the latest patch
(In reply to comment #16)
The following two patches fix the text rotation bugs in GDI and EMF modes in the attached test application, what remains to be fixed is a correct text base line calculation:
http://www.winehq.org/pipermail/wine-patches/2011-February/099231.html http://www.winehq.org/pipermail/wine-patches/2011-February/099232.html
I tried those patches, they screw up the actual schematic view. See attached. The print preview looks pretty good except the horizontal position of the text is shifted on vertically aligned text.
http://bugs.winehq.org/show_bug.cgi?id=22996
--- Comment #18 from A. Kochetkov al.kochet@gmail.com 2011-02-24 15:18:40 CST --- Created an attachment (id=33435) --> (http://bugs.winehq.org/attachment.cgi?id=33435) Test v2
Test implements axis, graphics mode and layout switching. Shows error in the text base line calculation.
Another solution for glyph orientation was sent: http://www.winehq.org/pipermail/wine-patches/2011-February/099255.html
Dmitry, John, thank you for your interest in the bug fixing.
http://bugs.winehq.org/show_bug.cgi?id=22996
--- Comment #19 from A. Kochetkov al.kochet@gmail.com 2011-02-24 17:55:39 CST --- Patch to fix text baseline calculation in compatible mode: http://www.winehq.org/pipermail/wine-patches/2011-February/099267.html
Dmitry, what test should I add to the test application?
http://bugs.winehq.org/show_bug.cgi?id=22996
--- Comment #20 from Dmitry Timoshkov dmitry@codeweavers.com 2011-02-25 03:07:56 CST --- (In reply to comment #18)
Another solution for glyph orientation was sent: http://www.winehq.org/pipermail/wine-patches/2011-February/099255.html
winex11.drv has its own font cache, orientation flag should be also added there.
http://bugs.winehq.org/show_bug.cgi?id=22996
--- Comment #21 from Dmitry Timoshkov dmitry@codeweavers.com 2011-02-25 03:09:16 CST --- (In reply to comment #19)
Patch to fix text baseline calculation in compatible mode: http://www.winehq.org/pipermail/wine-patches/2011-February/099267.html
Dmitry, what test should I add to the test application?
You're impressive :) If you feel brave enough I'd add escapement support as well.
http://bugs.winehq.org/show_bug.cgi?id=22996
--- Comment #22 from A. Kochetkov al.kochet@gmail.com 2011-02-28 17:23:37 CST --- Created an attachment (id=33485) --> (http://bugs.winehq.org/attachment.cgi?id=33485) This figure shows the effect of the patch on the orientation of the glyphs.
This figure shows the effect of the patch (try 3) on the orientation of the glyphs and text output. The patch affects modes with inverse axes.
http://bugs.winehq.org/show_bug.cgi?id=22996
--- Comment #23 from A. Kochetkov al.kochet@gmail.com 2011-02-28 17:24:31 CST --- Created an attachment (id=33486) --> (http://bugs.winehq.org/attachment.cgi?id=33486) This figure shows the effect of the patch on the orientation of the glyphs (RTL layout).
http://bugs.winehq.org/show_bug.cgi?id=22996
--- Comment #24 from A. Kochetkov al.kochet@gmail.com 2011-02-28 17:31:14 CST --- (From update of attachment 33486) Patch (try 3): http://source.winehq.org/patches/data/71785
Patch (try 2) to fix baseline calculation: http://source.winehq.org/patches/data/71667
http://bugs.winehq.org/show_bug.cgi?id=22996
--- Comment #25 from Dmitry Timoshkov dmitry@codeweavers.com 2011-03-01 04:37:31 CST --- (In reply to comment #24)
(From update of attachment 33486 [details]) Patch (try 3): http://source.winehq.org/patches/data/71785
This patch is an improvement comparing with current text rotation, but still there are things which remain broken.
1. 1x1 vs. -1x-1 and 1x-1 vs. -1x1 axis mapping modes should be equal in both GDI and EMF modes, but GDI mode is broken, probably this should be investigated and fixed first.
2. perhaps you are right that the y-axis direction is most likely the source of the different interpretation of the text rotation direction (clock-wise or counter clock-wise), but that needs more tests, in particular with different mapping modes, since they have different default setup for the y-axis direction (top to bottom or bottom to top).
http://bugs.winehq.org/show_bug.cgi?id=22996
--- Comment #26 from John Voltz john.voltz@gmail.com 2011-03-01 08:16:27 CST --- (In reply to comment #24)
(From update of attachment 33486 [details]) Patch (try 3): http://source.winehq.org/patches/data/71785
Patch (try 2) to fix baseline calculation: http://source.winehq.org/patches/data/71667
PERFECT!
As far as this bug is concerned, those 2 patches seem to have fixed it 100%.
Thanks Alexander!
http://bugs.winehq.org/show_bug.cgi?id=22996
--- Comment #27 from Wylda wylda@volny.cz 2011-06-21 04:53:36 CDT ---
http://source.winehq.org/patches/data/71785 http://source.winehq.org/patches/data/71667
As far as this bug is concerned, those 2 patches seem to have fixed it 100%.
Were these patches merged? Can we close this bug report?
http://bugs.winehq.org/show_bug.cgi?id=22996
Dmitry Timoshkov dmitry@baikal.ru changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |slash@ac.auone-net.jp
--- Comment #28 from Dmitry Timoshkov dmitry@baikal.ru 2011-12-12 05:00:24 CST --- *** Bug 29332 has been marked as a duplicate of this bug. ***
http://bugs.winehq.org/show_bug.cgi?id=22996
Alistair Leslie-Hughes leslie_alistair@hotmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |leslie_alistair@hotmail.com
http://bugs.winehq.org/show_bug.cgi?id=22996
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED
--- Comment #29 from Alexandre Julliard julliard@winehq.org 2012-02-16 13:17:42 CST --- The patches are in now.
http://bugs.winehq.org/show_bug.cgi?id=22996
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #30 from Alexandre Julliard julliard@winehq.org 2012-02-17 13:51:08 CST --- Closing bugs fixed in 1.4-rc4.