diff options
author | Khaled Hosny <khaledhosny@eglug.org> | 2013-05-03 23:39:19 +0200 |
---|---|---|
committer | Khaled Hosny <khaledhosny@eglug.org> | 2013-05-03 23:39:19 +0200 |
commit | 405dc9d241f617853c77e60b0b0d41c36b5af33d (patch) | |
tree | cf01843bcd4e4475424a47ed8d9a653bd1af0f99 /vcl/generic | |
parent | a80ae494533f3be2009d623478ff57e16bcc8be7 (diff) |
[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
Diffstat (limited to 'vcl/generic')
-rw-r--r-- | vcl/generic/glyphs/gcach_layout.cxx | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/vcl/generic/glyphs/gcach_layout.cxx b/vcl/generic/glyphs/gcach_layout.cxx index fa04dca995ee..fab66ac23920 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; } |