Apache OpenOffice (AOO) Bugzilla – Issue 100522
180° rotated text inText Field crippled in PDF export
Last modified: 2009-07-20 16:37:21 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.
Created attachment 61145 [details] Rotated Text (odt)
Created attachment 61146 [details] Rotated Text (pdf)
I see the same result running OOO310_m7 downloaded from OO.org
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)]"
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.
pl->hdu: please have a look
@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); }
Set target to 3.1 Regression to 3.0 and 3.01
That fix would increase every PDF file containing text enormously, therefore I strongly suggest not to fix it this way.
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
understood. This seems like a much nicer workaround.
Applied in CWS ooo31gsl7
@hi: please verify in CWS ooo31gsl7
Verified in CWS ooo31gsl7= OK
Still ok in OOo3.1RC1
Verifying: The test document is exported correctly in OOO310m11. Ok in 310m14(Build:9409) and 300m52(Build:9411) also.