Henri Verbeet : usp10: Take the script direction into account when applying OpenType features.
Module: wine Branch: master Commit: c94a5fd28c1a0009f4f6e968fc3bec624549e4b8 URL: http://source.winehq.org/git/wine.git/?a=commit;h=c94a5fd28c1a0009f4f6e968fc... Author: Henri Verbeet <hverbeet(a)codeweavers.com> Date: Thu Mar 2 09:38:41 2017 +0100 usp10: Take the script direction into account when applying OpenType features. As opposed to just looking at the run direction. Signed-off-by: Henri Verbeet <hverbeet(a)codeweavers.com> Signed-off-by: Aric Stewart <aric(a)codeweavers.com> Signed-off-by: Alexandre Julliard <julliard(a)winehq.org> --- dlls/usp10/shape.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/dlls/usp10/shape.c b/dlls/usp10/shape.c index 9e0addc..aa98366 100644 --- a/dlls/usp10/shape.c +++ b/dlls/usp10/shape.c @@ -751,6 +751,7 @@ static void UpdateClusters(int nextIndex, int changeCount, int write_dir, int ch return; else { + int cluster_dir = pwLogClust[0] < pwLogClust[chars-1] ? 1 : -1; int i; int target_glyph = nextIndex - write_dir; int target_index = -1; @@ -775,7 +776,7 @@ static void UpdateClusters(int nextIndex, int changeCount, int write_dir, int ch if (changeCount < 0) { /* merge glyphs */ - for(i = target_index; i < chars && i >= 0; i+=write_dir) + for (i = target_index; i < chars && i >= 0; i += cluster_dir) { if (pwLogClust[i] == target_glyph) continue; @@ -794,8 +795,8 @@ static void UpdateClusters(int nextIndex, int changeCount, int write_dir, int ch } } - /* renumber trailing indexes*/ - for(i = target_index; i < chars && i >= 0; i+=write_dir) + /* renumber trailing indexes */ + for (i = target_index; i < chars && i >= 0; i += cluster_dir) { if (pwLogClust[i] != target_glyph) pwLogClust[i] += changeCount; @@ -803,8 +804,8 @@ static void UpdateClusters(int nextIndex, int changeCount, int write_dir, int ch } else { - for(i = target_index; i < chars && i >= 0; i+=write_dir) - pwLogClust[i] += changeCount; + for (i = target_index; i < chars && i >= 0; i += cluster_dir) + pwLogClust[i] += changeCount; } } } @@ -3382,7 +3383,7 @@ static void SHAPE_ApplyOpenTypeFeatures(HDC hdc, ScriptCache *psc, SCRIPT_ANALYS if (!psc->GSUB_Table) return; - if (!psa->fLogicalOrder && psa->fRTL) + if (scriptInformation[psa->eScript].a.fRTL && (!psa->fLogicalOrder || !psa->fRTL)) dirL = -1; else dirL = 1;
participants (1)
-
Alexandre Julliard