Issue 100522 - 180° rotated text inText Field crippled in PDF export
Summary: 180° rotated text inText Field crippled in PDF export
Status: CLOSED FIXED
Alias: None
Product: gsl
Classification: Code
Component: code (show other issues)
Version: OOO310m4
Hardware: Other All
: P3 Trivial (vote)
Target Milestone: OOo 3.1
Assignee: h.ilter
QA Contact: issues@gsl
URL:
Keywords: oooqa, regression
Depends on:
Blocks: 95459 95768
  Show dependency tree
 
Reported: 2009-03-24 15:53 UTC by epate
Modified: 2009-07-20 16:37 UTC (History)
3 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
Rotated Text (odt) (8.18 KB, application/vnd.oasis.opendocument.text)
2009-03-24 15:54 UTC, epate
no flags Details
Rotated Text (pdf) (44.18 KB, application/pdf)
2009-03-24 15:54 UTC, epate
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description epate 2009-03-24 15:53:11 UTC
There appears to be a bug in 000310m4 (from Fedora rawhide version
3.1.0-4.1.fc11) with rotated text exported to PDF. A simple text entry rotated
180 degrees looks fine in OO but is out of the box in the PDF. As you can see
from the attached PDF, the same text rotated 179 degrees looks perfect in the PDF.
Comment 1 epate 2009-03-24 15:54:15 UTC
Created attachment 61145 [details]
Rotated Text (odt)
Comment 2 epate 2009-03-24 15:54:51 UTC
Created attachment 61146 [details]
Rotated Text (pdf)
Comment 3 Joe Smith 2009-03-24 17:00:40 UTC
I see the same result running OOO310_m7 downloaded from OO.org
Comment 4 Rainer Bielefeld 2009-03-25 09:41:37 UTC
I checked with "Ooo Dev 3.2.0 multilingual version German UI WIN XP: [DEV300m44
(Build 9395)]" and can confirm the reported effect for RotatedText.odt.

Works fine with "Ooo 3.0.1 (DE) Multilingual version GERMAN UI WIN XP:
[OOO300m15 (Build 9379)]" 
Comment 5 Rainer Bielefeld 2009-03-25 13:19:29 UTC
Draw also is affected.

Not only test in text fields, also text in graphic elements, shapes ...
Same effect if object has been flipped vertically
It looks as if each character has been rotated separately.
Comment 6 philipp.lohmann 2009-03-25 13:26:04 UTC
pl->hdu: please have a look
Comment 7 hdu@apache.org 2009-03-25 15:08:39 UTC
@pl: the problem has a similar root cause to issue 87686. This problem in this issue is in your method PDFWriterImpl::drawHorizontalGlyphs() where multiple glyphs get merge to reduce the PDF file size. 
Until this gets properly fixed disabling the buggy merging is a reasonable workaround:

--- source/gdi/pdfwriter_impl.cxx       (revision 269829)
+++ source/gdi/pdfwriter_impl.cxx      (HDU's working copy)
@@ -6623,7 +6623,9 @@ PDFWriterImpl::drawHorizontalGlyphs(
     for( size_t i = 1; i < rGlyphs.size(); i++ )
     {
+#if 0
         if( rGlyphs[i].m_nMappedFontId != rGlyphs[i-1].m_nMappedFontId ||
             rGlyphs[i].m_aPos.Y() != rGlyphs[i-1].m_aPos.Y() )
+#endif
         {
             aRunEnds.push_back(i);
         }
Comment 8 h.ilter 2009-03-25 15:38:27 UTC
Set target to 3.1
Regression to 3.0 and 3.01
Comment 9 philipp.lohmann 2009-03-25 15:39:28 UTC
That fix would increase every PDF file containing text enormously, therefore I
strongly suggest not to fix it this way.
Comment 10 hdu@apache.org 2009-03-25 16:02:23 UTC
Here is plan B, which fixes the problem too and which doesn't increase the file size.
It is still only a workaround though which is needed until i87686 gets fixed.
The root cause was that the glyph-positions already contain the text-rotation. So the fTheoreticalGlyphWidth got calculated wrongly.

--- source/gdi/pdfwriter_impl.cxx       (revision 270007)
+++ source/gdi/pdfwriter_impl.cxx       (HDU's working copy)
@@ -6681,2 +6681,3 @@ PDFWriterImpl::drawHorizontalGlyphs(
             // check for adjustment
             double fTheoreticalGlyphWidth = rGlyphs[nPos].m_aPos.X() - rGlyphs[nPos-1].m_aPos.X();
+            fTheoreticalGlyphWidth = fabs( fTheoreticalGlyphWidth ); // #i100522# workaround
Comment 11 philipp.lohmann 2009-03-25 16:11:06 UTC
understood. This seems like a much nicer workaround.
Comment 12 hdu@apache.org 2009-03-25 16:14:27 UTC
Applied in CWS ooo31gsl7
Comment 13 hdu@apache.org 2009-03-25 16:57:46 UTC
@hi: please verify in CWS ooo31gsl7
Comment 14 h.ilter 2009-03-26 10:01:53 UTC
Verified in CWS ooo31gsl7= OK
Comment 15 h.ilter 2009-04-24 12:16:49 UTC
Still ok in OOo3.1RC1
Comment 16 Joe Smith 2009-07-20 16:37:21 UTC
Verifying: The test document is exported correctly in OOO310m11.

Ok in 310m14(Build:9409) and 300m52(Build:9411) also.