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

Alexandre Julliard julliard at winehq.org
Wed Feb 20 14:01:14 CST 2013


Module: wine
Branch: master
Commit: 5e5d8d215b60c83d3919711c17a73fa719b6bb41
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=5e5d8d215b60c83d3919711c17a73fa719b6bb41

Author: Huw Davies <huw at codeweavers.com>
Date:   Wed Feb 20 09:51:10 2013 +0000

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

---

 dlls/usp10/usp10.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/dlls/usp10/usp10.c b/dlls/usp10/usp10.c
index 8bfe156..5287556 100644
--- a/dlls/usp10/usp10.c
+++ b/dlls/usp10/usp10.c
@@ -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;




More information about the wine-cvs mailing list