Issue 103400

Summary: PDF horizontal layout bug when glyphs are out of order
Product: gsl Reporter: devel
Component: codeAssignee: devel
Status: CLOSED DUPLICATE QA Contact: issues@gsl <issues>
Severity: Trivial    
Priority: P3 CC: hdu, issues
Version: DEV300m49   
Target Milestone: ---   
Hardware: All   
OS: All   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---
Attachments:
Description Flags
file showing bad PDF rendering
none
bad rendering
none
correct rendering none

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.