OLD | NEW |
1 /* | 1 /* |
2 * Copyright © 2007,2008,2009,2010 Red Hat, Inc. | 2 * Copyright © 2007,2008,2009,2010 Red Hat, Inc. |
3 * Copyright © 2010,2012,2013 Google, Inc. | 3 * Copyright © 2010,2012,2013 Google, Inc. |
4 * | 4 * |
5 * This is part of HarfBuzz, a text shaping library. | 5 * This is part of HarfBuzz, a text shaping library. |
6 * | 6 * |
7 * Permission is hereby granted, without written agreement and without | 7 * Permission is hereby granted, without written agreement and without |
8 * license or royalty fees, to use, copy, modify, and distribute this | 8 * license or royalty fees, to use, copy, modify, and distribute this |
9 * software and its documentation for any purpose, provided that the | 9 * software and its documentation for any purpose, provided that the |
10 * above copyright notice and the following two paragraphs appear in | 10 * above copyright notice and the following two paragraphs appear in |
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
623 if (unlikely (count == 1)) | 623 if (unlikely (count == 1)) |
624 { | 624 { |
625 c->replace_glyph (ligGlyph); | 625 c->replace_glyph (ligGlyph); |
626 return_trace (true); | 626 return_trace (true); |
627 } | 627 } |
628 | 628 |
629 bool is_mark_ligature = false; | 629 bool is_mark_ligature = false; |
630 unsigned int total_component_count = 0; | 630 unsigned int total_component_count = 0; |
631 | 631 |
632 unsigned int match_length = 0; | 632 unsigned int match_length = 0; |
633 unsigned int match_positions[MAX_CONTEXT_LENGTH]; | 633 unsigned int match_positions[HB_MAX_CONTEXT_LENGTH]; |
634 | 634 |
635 if (likely (!match_input (c, count, | 635 if (likely (!match_input (c, count, |
636 &component[1], | 636 &component[1], |
637 match_glyph, | 637 match_glyph, |
638 NULL, | 638 NULL, |
639 &match_length, | 639 &match_length, |
640 match_positions, | 640 match_positions, |
641 &is_mark_ligature, | 641 &is_mark_ligature, |
642 &total_component_count))) | 642 &total_component_count))) |
643 return_trace (false); | 643 return_trace (false); |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
963 | 963 |
964 inline bool would_apply (hb_would_apply_context_t *c) const | 964 inline bool would_apply (hb_would_apply_context_t *c) const |
965 { | 965 { |
966 TRACE_WOULD_APPLY (this); | 966 TRACE_WOULD_APPLY (this); |
967 return_trace (c->len == 1 && (this+coverage).get_coverage (c->glyphs[0]) !=
NOT_COVERED); | 967 return_trace (c->len == 1 && (this+coverage).get_coverage (c->glyphs[0]) !=
NOT_COVERED); |
968 } | 968 } |
969 | 969 |
970 inline bool apply (hb_apply_context_t *c) const | 970 inline bool apply (hb_apply_context_t *c) const |
971 { | 971 { |
972 TRACE_APPLY (this); | 972 TRACE_APPLY (this); |
973 if (unlikely (c->nesting_level_left != MAX_NESTING_LEVEL)) | 973 if (unlikely (c->nesting_level_left != HB_MAX_NESTING_LEVEL)) |
974 return_trace (false); /* No chaining to this type */ | 974 return_trace (false); /* No chaining to this type */ |
975 | 975 |
976 unsigned int index = (this+coverage).get_coverage (c->buffer->cur().codepoin
t); | 976 unsigned int index = (this+coverage).get_coverage (c->buffer->cur().codepoin
t); |
977 if (likely (index == NOT_COVERED)) return_trace (false); | 977 if (likely (index == NOT_COVERED)) return_trace (false); |
978 | 978 |
979 const OffsetArrayOf<Coverage> &lookahead = StructAfter<OffsetArrayOf<Coverag
e> > (backtrack); | 979 const OffsetArrayOf<Coverage> &lookahead = StructAfter<OffsetArrayOf<Coverag
e> > (backtrack); |
980 const ArrayOf<GlyphID> &substitute = StructAfter<ArrayOf<GlyphID> > (lookahe
ad); | 980 const ArrayOf<GlyphID> &substitute = StructAfter<ArrayOf<GlyphID> > (lookahe
ad); |
981 | 981 |
982 if (match_backtrack (c, | 982 if (match_backtrack (c, |
983 backtrack.len, (USHORT *) backtrack.array, | 983 backtrack.len, (USHORT *) backtrack.array, |
(...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1333 c->set_lookup_index (saved_lookup_index); | 1333 c->set_lookup_index (saved_lookup_index); |
1334 c->set_lookup_props (saved_lookup_props); | 1334 c->set_lookup_props (saved_lookup_props); |
1335 return ret; | 1335 return ret; |
1336 } | 1336 } |
1337 | 1337 |
1338 | 1338 |
1339 } /* namespace OT */ | 1339 } /* namespace OT */ |
1340 | 1340 |
1341 | 1341 |
1342 #endif /* HB_OT_LAYOUT_GSUB_TABLE_HH */ | 1342 #endif /* HB_OT_LAYOUT_GSUB_TABLE_HH */ |
OLD | NEW |