656 unsigned int match_positions[HB_MAX_CONTEXT_LENGTH]; |
656 unsigned int match_positions[HB_MAX_CONTEXT_LENGTH]; |
657 |
657 |
658 if (likely (!match_input (c, count, |
658 if (likely (!match_input (c, count, |
659 &component[1], |
659 &component[1], |
660 match_glyph, |
660 match_glyph, |
661 NULL, |
661 nullptr, |
662 &match_length, |
662 &match_length, |
663 match_positions, |
663 match_positions, |
664 &is_mark_ligature, |
664 &is_mark_ligature, |
665 &total_component_count))) |
665 &total_component_count))) |
666 return_trace (false); |
666 return_trace (false); |
1012 if (likely (index == NOT_COVERED)) return_trace (false); |
1012 if (likely (index == NOT_COVERED)) return_trace (false); |
1013 |
1013 |
1014 const OffsetArrayOf<Coverage> &lookahead = StructAfter<OffsetArrayOf<Coverage> > (backtrack); |
1014 const OffsetArrayOf<Coverage> &lookahead = StructAfter<OffsetArrayOf<Coverage> > (backtrack); |
1015 const ArrayOf<GlyphID> &substitute = StructAfter<ArrayOf<GlyphID> > (lookahead); |
1015 const ArrayOf<GlyphID> &substitute = StructAfter<ArrayOf<GlyphID> > (lookahead); |
1016 |
1016 |
|
1017 unsigned int start_index = 0, end_index = 0; |
1017 if (match_backtrack (c, |
1018 if (match_backtrack (c, |
1018 backtrack.len, (USHORT *) backtrack.array, |
1019 backtrack.len, (USHORT *) backtrack.array, |
1019 match_coverage, this) && |
1020 match_coverage, this, |
|
1021 &start_index) && |
1020 match_lookahead (c, |
1022 match_lookahead (c, |
1021 lookahead.len, (USHORT *) lookahead.array, |
1023 lookahead.len, (USHORT *) lookahead.array, |
1022 match_coverage, this, |
1024 match_coverage, this, |
1023 1)) |
1025 1, &end_index)) |
1024 { |
1026 { |
|
1027 c->buffer->unsafe_to_break_from_outbuffer (start_index, end_index); |
1025 c->replace_glyph_inplace (substitute[index]); |
1028 c->replace_glyph_inplace (substitute[index]); |
1026 /* Note: We DON'T decrease buffer->idx. The main loop does it |
1029 /* Note: We DON'T decrease buffer->idx. The main loop does it |
1027 * for us. This is useful for preventing surprises if someone |
1030 * for us. This is useful for preventing surprises if someone |
1028 * calls us through a Context lookup. */ |
1031 * calls us through a Context lookup. */ |
1029 return_trace (true); |
1032 return_trace (true); |