Issue 103400 - PDF horizontal layout bug when glyphs are out of order
Summary: PDF horizontal layout bug when glyphs are out of order
Status: CLOSED DUPLICATE of issue 102603
Alias: None
Product: gsl
Classification: Code
Component: code (show other issues)
Version: DEV300m49
Hardware: All All
: P3 Trivial (vote)
Target Milestone: ---
Assignee: devel
QA Contact: issues@gsl
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-07-08 06:20 UTC by devel
Modified: 2009-07-10 12:06 UTC (History)
2 users (show)

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


Attachments
file showing bad PDF rendering (11.16 KB, application/vnd.oasis.opendocument.text)
2009-07-08 07:19 UTC, devel
no flags Details
bad rendering (5.95 KB, application/pdf)
2009-07-08 07:21 UTC, devel
no flags Details
correct rendering (5.95 KB, application/pdf)
2009-07-08 07:23 UTC, devel
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description devel 2009-07-08 06:20:43 UTC
Some glyphs in a PDF export are displaced with Burmese text using the Padauk font.

The fix for i100522 uses an abs to fix the problem with 180 degree rotated text.
This assumes that the glyphs are strictly in left to right order. However, the
abs also takes affect when you have a negative advance between two glyphs with
zero rotation causing incorrect positioning. A better fix would be to invert the
sign of the correction only in the case where the angle is really 180 (PI).


Index: vcl/source/gdi/pdfwriter_impl.cxx
===================================================================
--- vcl/source/gdi/pdfwriter_impl.cxx	(revision 272475)
+++ vcl/source/gdi/pdfwriter_impl.cxx	(working copy)
@@ -6680,7 +6680,9 @@
             appendHex( rGlyphs[nPos].m_nMappedGlyphId, aUnkernedLine );
             // check for adjustment
             double fTheoreticalGlyphWidth = rGlyphs[nPos].m_aPos.X() -
rGlyphs[nPos-1].m_aPos.X();
-            fTheoreticalGlyphWidth = fabs( fTheoreticalGlyphWidth ); //
#i100522# workaround until #i87686# gets fixed
+            // #i100522# workaround until #i87686# gets fixed
+            if (fAngle > M_PI - 0.005 && fAngle < M_PI + 0.005)
+                fTheoreticalGlyphWidth = -fTheoreticalGlyphWidth;
             fTheoreticalGlyphWidth = 1000.0 * fTheoreticalGlyphWidth / fXScale
/ double(nPixelFontHeight);
             sal_Int32 nAdjustment = rGlyphs[nPos-1].m_nNativeWidth -
sal_Int32(fTheoreticalGlyphWidth+0.5);
             if( nAdjustment != 0 )
Comment 1 devel 2009-07-08 07:19:38 UTC
Created attachment 63422 [details]
file showing bad PDF rendering
Comment 2 devel 2009-07-08 07:21:40 UTC
Created attachment 63423 [details]
bad rendering
Comment 3 devel 2009-07-08 07:23:04 UTC
Created attachment 63424 [details]
correct rendering
Comment 4 hdu@apache.org 2009-07-08 08:16:38 UTC
Most probably a duplicate to issue 102603 (fixed in ooo311gsl04 => OOO310_m15/DEV300_m52).

*** This issue has been marked as a duplicate of 102603 ***
Comment 5 hdu@apache.org 2009-07-10 12:05:49 UTC
Verified by private mail from issue submitter.
Comment 6 hdu@apache.org 2009-07-10 12:06:11 UTC
Closing resolved issue.