[Libreoffice-commits] core.git: vcl/generic

Khaled Hosny khaledhosny at eglug.org
Fri May 3 15:00:03 PDT 2013


 vcl/generic/glyphs/gcach_layout.cxx |   17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

New commits:
commit 405dc9d241f617853c77e60b0b0d41c36b5af33d
Author: Khaled Hosny <khaledhosny at eglug.org>
Date:   Fri May 3 23:39:19 2013 +0200

    [harfbuzz] Fix placement of multi-glyph clusters
    
    Calculate the delta based on the whole cluster width no just the first
    glyph.
    
    This whole ApplyDXArray() business is completely flawed, it is just
    trying to second guess information we already had, and then workaround
    all bugs it is introducing.
    
    Change-Id: I5f719d7addcb89c9d5662b48ca7cf55cd388b41e

diff --git a/vcl/generic/glyphs/gcach_layout.cxx b/vcl/generic/glyphs/gcach_layout.cxx
index fa04dca..fab66ac 100644
--- a/vcl/generic/glyphs/gcach_layout.cxx
+++ b/vcl/generic/glyphs/gcach_layout.cxx
@@ -176,7 +176,22 @@ void ServerFontLayout::ApplyDXArray(ImplLayoutArgs& rArgs)
         long nDelta = 0;
         for (i = 0; i < m_GlyphItems.size(); ++i)
         {
-            nDelta += pNewGlyphWidths[i] - m_GlyphItems[i].mnNewWidth;
+            if (m_GlyphItems[i].IsClusterStart())
+            {
+                // calculate original and adjusted cluster width
+                int nOldClusterWidth = m_GlyphItems[i].mnNewWidth;
+                int nNewClusterWidth = pNewGlyphWidths[i];
+                size_t j;
+                for (j = i; ++j < m_GlyphItems.size(); )
+                {
+                    if (m_GlyphItems[j].IsClusterStart())
+                        break;
+                    if (!m_GlyphItems[j].IsDiacritic()) // #i99367# ignore diacritics
+                        nOldClusterWidth += m_GlyphItems[j].mnNewWidth;
+                    nNewClusterWidth += pNewGlyphWidths[j];
+                }
+                nDelta += nNewClusterWidth - nOldClusterWidth;
+            }
             m_GlyphItems[i].mnNewWidth = pNewGlyphWidths[i];
             m_GlyphItems[i].maLinearPos.X() += nDelta;
         }


More information about the Libreoffice-commits mailing list