Commit 5e5d8d21 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

usp10: Clusters are represented by glyph indices not character positions.

parent ab2eb34a
......@@ -2534,8 +2534,9 @@ HRESULT WINAPI ScriptCPtoX(int iCP,
if (check >= cChars && !iMaxPos)
{
for (check = clust; check < cChars; check++)
special_size += get_glyph_cluster_advance(piAdvance, psva, pwLogClust, cGlyphs, cChars, check, 1);
int glyph;
for (glyph = clust; glyph < cGlyphs; glyph++)
special_size += get_glyph_cluster_advance(piAdvance, psva, pwLogClust, cGlyphs, cChars, glyph, 1);
iSpecial = item;
special_size /= (cChars - item);
iPosX += special_size;
......@@ -2666,8 +2667,9 @@ HRESULT WINAPI ScriptXtoCP(int iX,
if (check >= cChars && direction > 0)
{
for (check = clust; check < cChars; check++)
special_size += get_glyph_cluster_advance(piAdvance, psva, pwLogClust, cGlyphs, cChars, check, direction);
int glyph;
for (glyph = clust; glyph < cGlyphs; glyph++)
special_size += get_glyph_cluster_advance(piAdvance, psva, pwLogClust, cGlyphs, cChars, glyph, direction);
iSpecial = item;
special_size /= (cChars - item);
iPosX += special_size;
......
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