Kaydet (Commit) 405dc9d2 authored tarafından Khaled Hosny's avatar Khaled Hosny

[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
üst a80ae494
...@@ -176,7 +176,22 @@ void ServerFontLayout::ApplyDXArray(ImplLayoutArgs& rArgs) ...@@ -176,7 +176,22 @@ void ServerFontLayout::ApplyDXArray(ImplLayoutArgs& rArgs)
long nDelta = 0; long nDelta = 0;
for (i = 0; i < m_GlyphItems.size(); ++i) 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].mnNewWidth = pNewGlyphWidths[i];
m_GlyphItems[i].maLinearPos.X() += nDelta; m_GlyphItems[i].maLinearPos.X() += nDelta;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment