summaryrefslogtreecommitdiff
path: root/pango/opentype/ftxgsub.c
diff options
context:
space:
mode:
Diffstat (limited to 'pango/opentype/ftxgsub.c')
-rw-r--r--pango/opentype/ftxgsub.c24
1 files changed, 17 insertions, 7 deletions
diff --git a/pango/opentype/ftxgsub.c b/pango/opentype/ftxgsub.c
index 148b3a6c..f56ae6f1 100644
--- a/pango/opentype/ftxgsub.c
+++ b/pango/opentype/ftxgsub.c
@@ -3423,13 +3423,13 @@
if ( bgc )
{
- /* Since we don't know in advance the number of glyphs to inspect,
+ /* since we don't know in advance the number of glyphs to inspect,
we search backwards for matches in the backtrack glyph array */
curr_pos = 0;
s_in = &in->string[curr_pos];
- for ( i = bgc, j = in->pos - 1; i > 0; i--, j-- )
+ for ( i = 0, j = in->pos - 1; i < bgc; i++, j-- )
{
while ( CHECK_Property( gdef, s_in[j], flags, &property ) )
{
@@ -3442,11 +3442,21 @@
break;
}
- if ( s_in[j] != curr_csr.Backtrack[i - 1] )
+ /* In OpenType 1.3, it is undefined whether the offsets of
+ backtrack glyphs is in logical order or not. Version 1.4
+ will clarify this:
+
+ Logical order - a b c d e f g h i j
+ i
+ Input offsets - 0 1
+ Backtrack offsets - 3 2 1 0
+ Lookahead offsets - 0 1 2 3 */
+
+ if ( s_in[j] != curr_csr.Backtrack[i] )
break;
}
- if ( i != 0 )
+ if ( i != bgc )
continue;
}
@@ -3630,7 +3640,7 @@
known_backtrack_classes = i;
}
- if ( bc[bgc - 1 - i] != backtrack_classes[i] )
+ if ( bc[i] != backtrack_classes[i] )
break;
}
@@ -3777,7 +3787,7 @@
s_in = &in->string[curr_pos];
bc = ccsf3->BacktrackCoverage;
- for ( i = bgc, j = in->pos - 1; i > 0; i--, j-- )
+ for ( i = 0, j = in->pos - 1; i < bgc; i++, j-- )
{
while ( CHECK_Property( gdef, s_in[j], flags, &property ) )
{
@@ -3790,7 +3800,7 @@
return TTO_Err_Not_Covered;
}
- error = Coverage_Index( &bc[i - 1], s_in[j], &index );
+ error = Coverage_Index( &bc[i], s_in[j], &index );
if ( error )
return error;
}