From: Aric Stewart Subject: Re: [PATCH 4/5] usp10: Iterate in visual order in GPOS_apply_feature(). Message-Id: <495a0409-d42e-24fb-c1ea-711288ada687@codeweavers.com> Date: Tue, 21 Feb 2017 07:05:29 -0600 In-Reply-To: <1487524599-13189-4-git-send-email-hverbeet@codeweavers.com> References: <1487524599-13189-4-git-send-email-hverbeet@codeweavers.com> Signed-off-by: Aric Stewart On 2/19/17 11:16 AM, Henri Verbeet wrote: > In particular, cursive attachment application depends on previous visual order > glyph offsets. Affects e.g. wordpad with Nastaliq fonts. > > Signed-off-by: Henri Verbeet > --- > dlls/usp10/shape.c | 9 ++++++--- > 1 file changed, 6 insertions(+), 3 deletions(-) > > diff --git a/dlls/usp10/shape.c b/dlls/usp10/shape.c > index bf333b2..fae4288 100644 > --- a/dlls/usp10/shape.c > +++ b/dlls/usp10/shape.c > @@ -882,14 +882,17 @@ static int apply_GSUB_feature(HDC hdc, SCRIPT_ANALYSIS *psa, ScriptCache* psc, W > > static VOID GPOS_apply_feature(ScriptCache *psc, LPOUTLINETEXTMETRICW lpotm, LPLOGFONTW lplogfont, const SCRIPT_ANALYSIS *analysis, INT* piAdvance, LoadedFeature *feature, const WORD *glyphs, INT glyph_count, GOFFSET *pGoffset) > { > - int i; > + int dir = analysis->fLogicalOrder && analysis->fRTL ? -1 : 1; > + unsigned int start_idx, i, j; > > TRACE("%i lookups\n", feature->lookup_count); > + > + start_idx = dir < 0 ? glyph_count - 1 : 0; > for (i = 0; i < feature->lookup_count; i++) > { > - int j; > for (j = 0; j < glyph_count; ) > - j = OpenType_apply_GPOS_lookup(psc, lpotm, lplogfont, analysis, piAdvance, feature->lookups[i], glyphs, j, glyph_count, pGoffset); > + j = OpenType_apply_GPOS_lookup(psc, lpotm, lplogfont, analysis, piAdvance, > + feature->lookups[i], glyphs, start_idx + dir * j, glyph_count, pGoffset); > } > } > >