2 * Copyright (C) 2007,2008,2009 Red Hat, Inc.
4 * This is part of HarfBuzz, an OpenType Layout engine library.
6 * Permission is hereby granted, without written agreement and without
7 * license or royalty fees, to use, copy, modify, and distribute this
8 * software and its documentation for any purpose, provided that the
9 * above copyright notice and the following two paragraphs appear in
10 * all copies of this software.
12 * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
13 * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
14 * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
15 * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
18 * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
19 * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
20 * FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
21 * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
22 * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
24 * Red Hat Author(s): Behdad Esfahbod
27 #ifndef HB_OT_LAYOUT_GSUB_PRIVATE_HH
28 #define HB_OT_LAYOUT_GSUB_PRIVATE_HH
30 #include "hb-ot-layout-gsubgpos-private.hh"
33 struct SingleSubstFormat1
35 friend struct SingleSubst;
39 inline bool apply (APPLY_ARG_DEF) const
41 hb_codepoint_t glyph_id = IN_CURGLYPH ();
42 unsigned int index = (this+coverage) (glyph_id);
43 if (HB_LIKELY (index == NOT_COVERED))
46 glyph_id += deltaGlyphID;
47 _hb_buffer_replace_glyph (buffer, glyph_id);
49 /* We inherit the old glyph class to the substituted glyph */
50 if (_hb_ot_layout_has_new_glyph_classes (context->face))
51 _hb_ot_layout_set_glyph_property (context->face, glyph_id, property);
56 inline bool sanitize (SANITIZE_ARG_DEF) {
57 return SANITIZE_THIS (coverage) && SANITIZE (deltaGlyphID);
61 USHORT format; /* Format identifier--format = 1 */
63 coverage; /* Offset to Coverage table--from
64 * beginning of Substitution table */
65 SHORT deltaGlyphID; /* Add to original GlyphID to get
66 * substitute GlyphID */
68 ASSERT_SIZE (SingleSubstFormat1, 6);
70 struct SingleSubstFormat2
72 friend struct SingleSubst;
76 inline bool apply (APPLY_ARG_DEF) const
78 hb_codepoint_t glyph_id = IN_CURGLYPH ();
79 unsigned int index = (this+coverage) (glyph_id);
80 if (HB_LIKELY (index == NOT_COVERED))
83 if (HB_UNLIKELY (index >= substitute.len))
86 glyph_id = substitute[index];
87 _hb_buffer_replace_glyph (buffer, glyph_id);
89 /* We inherit the old glyph class to the substituted glyph */
90 if (_hb_ot_layout_has_new_glyph_classes (context->face))
91 _hb_ot_layout_set_glyph_property (context->face, glyph_id, property);
96 inline bool sanitize (SANITIZE_ARG_DEF) {
97 return SANITIZE_THIS (coverage) && SANITIZE (substitute);
101 USHORT format; /* Format identifier--format = 2 */
103 coverage; /* Offset to Coverage table--from
104 * beginning of Substitution table */
106 substitute; /* Array of substitute
107 * GlyphIDs--ordered by Coverage Index */
109 ASSERT_SIZE (SingleSubstFormat2, 6);
113 friend struct SubstLookupSubTable;
117 inline bool apply (APPLY_ARG_DEF) const
120 case 1: return u.format1->apply (APPLY_ARG);
121 case 2: return u.format2->apply (APPLY_ARG);
122 default:return false;
126 inline bool sanitize (SANITIZE_ARG_DEF) {
127 if (!SANITIZE (u.format)) return false;
129 case 1: return u.format1->sanitize (SANITIZE_ARG);
130 case 2: return u.format2->sanitize (SANITIZE_ARG);
137 USHORT format; /* Format identifier */
138 SingleSubstFormat1 format1[];
139 SingleSubstFormat2 format2[];
142 ASSERT_SIZE (SingleSubst, 2);
147 friend struct MultipleSubstFormat1;
150 inline bool apply (APPLY_ARG_DEF) const
152 if (HB_UNLIKELY (!substitute.len))
155 _hb_buffer_add_output_glyphs (buffer, 1,
156 substitute.len, (const uint16_t *) substitute.array,
159 /* This is a guess only ... */
160 if (_hb_ot_layout_has_new_glyph_classes (context->face))
162 if (property == HB_OT_LAYOUT_GLYPH_CLASS_LIGATURE)
163 property = HB_OT_LAYOUT_GLYPH_CLASS_BASE_GLYPH;
165 unsigned int count = substitute.len;
166 for (unsigned int n = 0; n < count; n++)
167 _hb_ot_layout_set_glyph_property (context->face, substitute[n], property);
174 inline bool sanitize (SANITIZE_ARG_DEF) {
175 return SANITIZE (substitute);
180 substitute; /* String of GlyphIDs to substitute */
182 ASSERT_SIZE (Sequence, 2);
184 struct MultipleSubstFormat1
186 friend struct MultipleSubst;
190 inline bool apply (APPLY_ARG_DEF) const
193 unsigned int index = (this+coverage) (IN_CURGLYPH ());
194 if (HB_LIKELY (index == NOT_COVERED))
197 return (this+sequence[index]).apply (APPLY_ARG);
200 inline bool sanitize (SANITIZE_ARG_DEF) {
201 return SANITIZE_THIS2 (coverage, sequence);
205 USHORT format; /* Format identifier--format = 1 */
207 coverage; /* Offset to Coverage table--from
208 * beginning of Substitution table */
209 OffsetArrayOf<Sequence>
210 sequence; /* Array of Sequence tables
211 * ordered by Coverage Index */
213 ASSERT_SIZE (MultipleSubstFormat1, 6);
217 friend struct SubstLookupSubTable;
221 inline bool apply (APPLY_ARG_DEF) const
224 case 1: return u.format1->apply (APPLY_ARG);
225 default:return false;
229 inline bool sanitize (SANITIZE_ARG_DEF) {
230 if (!SANITIZE (u.format)) return false;
232 case 1: return u.format1->sanitize (SANITIZE_ARG);
239 USHORT format; /* Format identifier */
240 MultipleSubstFormat1 format1[];
243 ASSERT_SIZE (MultipleSubst, 2);
246 typedef ArrayOf<GlyphID> AlternateSet; /* Array of alternate GlyphIDs--in
248 ASSERT_SIZE (AlternateSet, 2);
250 struct AlternateSubstFormat1
252 friend struct AlternateSubst;
256 inline bool apply (APPLY_ARG_DEF) const
258 hb_codepoint_t glyph_id = IN_CURGLYPH ();
260 unsigned int index = (this+coverage) (glyph_id);
261 if (HB_LIKELY (index == NOT_COVERED))
264 const AlternateSet &alt_set = this+alternateSet[index];
266 if (HB_UNLIKELY (!alt_set.len))
269 unsigned int alt_index = 0;
271 /* XXX callback to user to choose alternate
272 if (context->face->altfunc)
273 alt_index = (context->face->altfunc)(context->layout, buffer,
274 buffer->out_pos, glyph_id,
275 alt_set.len, alt_set.array);
278 if (HB_UNLIKELY (alt_index >= alt_set.len))
281 glyph_id = alt_set[alt_index];
283 _hb_buffer_replace_glyph (buffer, glyph_id);
285 /* We inherit the old glyph class to the substituted glyph */
286 if (_hb_ot_layout_has_new_glyph_classes (context->face))
287 _hb_ot_layout_set_glyph_property (context->face, glyph_id, property);
292 inline bool sanitize (SANITIZE_ARG_DEF) {
293 return SANITIZE_THIS2 (coverage, alternateSet);
297 USHORT format; /* Format identifier--format = 1 */
299 coverage; /* Offset to Coverage table--from
300 * beginning of Substitution table */
301 OffsetArrayOf<AlternateSet>
302 alternateSet; /* Array of AlternateSet tables
303 * ordered by Coverage Index */
305 ASSERT_SIZE (AlternateSubstFormat1, 6);
307 struct AlternateSubst
309 friend struct SubstLookupSubTable;
313 inline bool apply (APPLY_ARG_DEF) const
316 case 1: return u.format1->apply (APPLY_ARG);
317 default:return false;
321 inline bool sanitize (SANITIZE_ARG_DEF) {
322 if (!SANITIZE (u.format)) return false;
324 case 1: return u.format1->sanitize (SANITIZE_ARG);
331 USHORT format; /* Format identifier */
332 AlternateSubstFormat1 format1[];
335 ASSERT_SIZE (AlternateSubst, 2);
340 friend struct LigatureSet;
343 inline bool apply (APPLY_ARG_DEF, bool is_mark) const
346 unsigned int count = component.len;
347 unsigned int end = MIN (buffer->in_length, buffer->in_pos + context_length);
348 if (HB_UNLIKELY (buffer->in_pos + count > end))
351 for (i = 1, j = buffer->in_pos + 1; i < count; i++, j++)
353 while (_hb_ot_layout_skip_mark (context->face, IN_INFO (j), lookup_flag, &property))
355 if (HB_UNLIKELY (j + count - i == end))
360 if (!(property & HB_OT_LAYOUT_GLYPH_CLASS_MARK))
363 if (HB_LIKELY (IN_GLYPH (j) != component[i]))
366 /* This is just a guess ... */
367 if (_hb_ot_layout_has_new_glyph_classes (context->face))
368 _hb_ot_layout_set_glyph_class (context->face, ligGlyph,
369 is_mark ? HB_OT_LAYOUT_GLYPH_CLASS_MARK
370 : HB_OT_LAYOUT_GLYPH_CLASS_LIGATURE);
372 if (j == buffer->in_pos + i) /* No input glyphs skipped */
373 /* We don't use a new ligature ID if there are no skipped
374 glyphs and the ligature already has an ID. */
375 _hb_buffer_add_output_glyphs (buffer, i,
376 1, (const uint16_t *) &ligGlyph,
378 IN_LIGID (buffer->in_pos) ?
379 0xFFFF : _hb_buffer_allocate_lig_id (buffer));
382 unsigned int lig_id = _hb_buffer_allocate_lig_id (buffer);
383 _hb_buffer_add_output_glyph (buffer, ligGlyph, 0xFFFF, lig_id);
385 /* Now we must do a second loop to copy the skipped glyphs to
386 `out' and assign component values to it. We start with the
387 glyph after the first component. Glyphs between component
388 i and i+1 belong to component i. Together with the lig_id
389 value it is later possible to check whether a specific
390 component value really belongs to a given ligature. */
392 for ( i = 1; i < count; i++ )
394 while (_hb_ot_layout_skip_mark (context->face, IN_CURINFO (), lookup_flag, NULL))
395 _hb_buffer_add_output_glyph (buffer, IN_CURGLYPH (), i - 1, lig_id);
400 /* TODO We should possibly reassign lig_id and component for any
401 * components of a previous ligature that s now being removed as part of
409 inline bool sanitize (SANITIZE_ARG_DEF) {
410 return SANITIZE2 (ligGlyph, component);
414 GlyphID ligGlyph; /* GlyphID of ligature to substitute */
415 HeadlessArrayOf<GlyphID>
416 component; /* Array of component GlyphIDs--start
417 * with the second component--ordered
418 * in writing direction */
420 ASSERT_SIZE (Ligature, 4);
424 friend struct LigatureSubstFormat1;
427 inline bool apply (APPLY_ARG_DEF, bool is_mark) const
429 unsigned int num_ligs = ligature.len;
430 for (unsigned int i = 0; i < num_ligs; i++)
432 const Ligature &lig = this+ligature[i];
433 if (lig.apply (APPLY_ARG, is_mark))
441 inline bool sanitize (SANITIZE_ARG_DEF) {
442 return SANITIZE_THIS (ligature);
446 OffsetArrayOf<Ligature>
447 ligature; /* Array LigatureSet tables
448 * ordered by preference */
450 ASSERT_SIZE (LigatureSet, 2);
452 struct LigatureSubstFormat1
454 friend struct LigatureSubst;
457 inline bool apply (APPLY_ARG_DEF) const
459 hb_codepoint_t glyph_id = IN_CURGLYPH ();
461 bool first_is_mark = !!(property & HB_OT_LAYOUT_GLYPH_CLASS_MARK);
463 unsigned int index = (this+coverage) (glyph_id);
464 if (HB_LIKELY (index == NOT_COVERED))
467 const LigatureSet &lig_set = this+ligatureSet[index];
468 return lig_set.apply (APPLY_ARG, first_is_mark);
471 inline bool sanitize (SANITIZE_ARG_DEF) {
472 return SANITIZE_THIS2 (coverage, ligatureSet);
476 USHORT format; /* Format identifier--format = 1 */
478 coverage; /* Offset to Coverage table--from
479 * beginning of Substitution table */
480 OffsetArrayOf<LigatureSet>
481 ligatureSet; /* Array LigatureSet tables
482 * ordered by Coverage Index */
484 ASSERT_SIZE (LigatureSubstFormat1, 6);
488 friend struct SubstLookupSubTable;
491 inline bool apply (APPLY_ARG_DEF) const
494 case 1: return u.format1->apply (APPLY_ARG);
495 default:return false;
499 inline bool sanitize (SANITIZE_ARG_DEF) {
500 if (!SANITIZE (u.format)) return false;
502 case 1: return u.format1->sanitize (SANITIZE_ARG);
509 USHORT format; /* Format identifier */
510 LigatureSubstFormat1 format1[];
513 ASSERT_SIZE (LigatureSubst, 2);
517 static inline bool substitute_lookup (APPLY_ARG_DEF, unsigned int lookup_index);
519 struct ContextSubst : Context
521 friend struct SubstLookupSubTable;
524 inline bool apply (APPLY_ARG_DEF) const
525 { return Context::apply (APPLY_ARG, substitute_lookup); }
527 ASSERT_SIZE (ContextSubst, 2);
529 struct ChainContextSubst : ChainContext
531 friend struct SubstLookupSubTable;
534 inline bool apply (APPLY_ARG_DEF) const
535 { return ChainContext::apply (APPLY_ARG, substitute_lookup); }
537 ASSERT_SIZE (ChainContextSubst, 2);
540 struct ExtensionSubst : Extension
542 friend struct SubstLookupSubTable;
545 inline const struct SubstLookupSubTable& get_subtable (void) const
546 { return CONST_CAST (SubstLookupSubTable, Extension::get_subtable (), 0); }
548 inline bool apply (APPLY_ARG_DEF) const;
550 inline bool sanitize (SANITIZE_ARG_DEF);
552 ASSERT_SIZE (ExtensionSubst, 2);
555 struct ReverseChainSingleSubstFormat1
557 friend struct ReverseChainSingleSubst;
560 inline bool apply (APPLY_ARG_DEF) const
562 if (HB_UNLIKELY (context_length != NO_CONTEXT))
563 return false; /* No chaining to this type */
565 unsigned int index = (this+coverage) (IN_CURGLYPH ());
566 if (HB_LIKELY (index == NOT_COVERED))
569 const OffsetArrayOf<Coverage> &lookahead = CONST_CAST (OffsetArrayOf<Coverage>, backtrack, backtrack.get_size ());
570 const ArrayOf<GlyphID> &substitute = CONST_CAST (ArrayOf<GlyphID>, lookahead, lookahead.get_size ());
572 if (match_backtrack (APPLY_ARG,
573 backtrack.len, (USHORT *) backtrack.array,
574 match_coverage, DECONST_CHARP(this)) &&
575 match_lookahead (APPLY_ARG,
576 lookahead.len, (USHORT *) lookahead.array,
577 match_coverage, DECONST_CHARP(this),
580 IN_CURGLYPH () = substitute[index];
581 buffer->in_pos--; /* Reverse! */
588 inline bool sanitize (SANITIZE_ARG_DEF) {
589 if (!SANITIZE_THIS2 (coverage, backtrack))
591 OffsetArrayOf<Coverage> &lookahead = CAST (OffsetArrayOf<Coverage>, backtrack, backtrack.get_size ());
592 if (!SANITIZE_THIS (lookahead))
594 ArrayOf<GlyphID> &substitute = CAST (ArrayOf<GlyphID>, lookahead, lookahead.get_size ());
595 if (!SANITIZE (substitute))
600 USHORT format; /* Format identifier--format = 1 */
602 coverage; /* Offset to Coverage table--from
603 * beginning of table */
604 OffsetArrayOf<Coverage>
605 backtrack; /* Array of coverage tables
606 * in backtracking sequence, in glyph
608 OffsetArrayOf<Coverage>
609 lookaheadX; /* Array of coverage tables
610 * in lookahead sequence, in glyph
613 substituteX; /* Array of substitute
614 * GlyphIDs--ordered by Coverage Index */
616 ASSERT_SIZE (ReverseChainSingleSubstFormat1, 10);
618 struct ReverseChainSingleSubst
620 friend struct SubstLookupSubTable;
623 inline bool apply (APPLY_ARG_DEF) const
626 case 1: return u.format1->apply (APPLY_ARG);
627 default:return false;
631 inline bool sanitize (SANITIZE_ARG_DEF) {
632 if (!SANITIZE (u.format)) return false;
634 case 1: return u.format1->sanitize (SANITIZE_ARG);
641 USHORT format; /* Format identifier */
642 ReverseChainSingleSubstFormat1 format1[];
645 ASSERT_SIZE (ReverseChainSingleSubst, 2);
653 struct SubstLookupSubTable
655 friend struct SubstLookup;
665 ReverseChainSingle = 8,
668 bool apply (APPLY_ARG_DEF, unsigned int lookup_type) const
670 switch (lookup_type) {
671 case Single: return u.single->apply (APPLY_ARG);
672 case Multiple: return u.multiple->apply (APPLY_ARG);
673 case Alternate: return u.alternate->apply (APPLY_ARG);
674 case Ligature: return u.ligature->apply (APPLY_ARG);
675 case Context: return u.context->apply (APPLY_ARG);
676 case ChainContext: return u.chainContext->apply (APPLY_ARG);
677 case Extension: return u.extension->apply (APPLY_ARG);
678 case ReverseChainSingle: return u.reverseChainContextSingle->apply (APPLY_ARG);
679 default:return false;
683 bool sanitize (SANITIZE_ARG_DEF) {
684 if (!SANITIZE (u.format)) return false;
686 case Single: return u.single->sanitize (SANITIZE_ARG);
687 case Multiple: return u.multiple->sanitize (SANITIZE_ARG);
688 case Alternate: return u.alternate->sanitize (SANITIZE_ARG);
689 case Ligature: return u.ligature->sanitize (SANITIZE_ARG);
690 case Context: return u.context->sanitize (SANITIZE_ARG);
691 case ChainContext: return u.chainContext->sanitize (SANITIZE_ARG);
692 case Extension: return u.extension->sanitize (SANITIZE_ARG);
693 case ReverseChainSingle: return u.reverseChainContextSingle->sanitize (SANITIZE_ARG);
701 SingleSubst single[];
702 MultipleSubst multiple[];
703 AlternateSubst alternate[];
704 LigatureSubst ligature[];
705 ContextSubst context[];
706 ChainContextSubst chainContext[];
707 ExtensionSubst extension[];
708 ReverseChainSingleSubst reverseChainContextSingle[];
711 ASSERT_SIZE (SubstLookupSubTable, 2);
714 struct SubstLookup : Lookup
716 inline const SubstLookupSubTable& get_subtable (unsigned int i) const
717 { return CONST_CAST (SubstLookupSubTable, Lookup::get_subtable (i), 0); }
719 /* Like get_type(), but looks through extension lookups.
720 * Never returns Extension */
721 inline unsigned int get_effective_type (void) const
723 unsigned int type = get_type ();
725 if (HB_UNLIKELY (type == SubstLookupSubTable::Extension))
727 unsigned int count = get_subtable_count ();
728 type = get_subtable(0).u.extension->get_type ();
729 /* The spec says all subtables should have the same type.
730 * This is specially important if one has a reverse type! */
731 for (unsigned int i = 1; i < count; i++)
732 if (get_subtable(i).u.extension->get_type () != type)
739 inline bool is_reverse (void) const
740 { return HB_UNLIKELY (get_effective_type () == SubstLookupSubTable::ReverseChainSingle); }
742 inline bool apply_once (hb_ot_layout_context_t *context,
744 unsigned int context_length,
745 unsigned int nesting_level_left) const
747 unsigned int lookup_type = get_type ();
748 unsigned int lookup_flag = get_flag ();
749 unsigned int property;
751 if (!_hb_ot_layout_check_glyph_property (context->face, IN_CURINFO (), lookup_flag, &property))
754 unsigned int count = get_subtable_count ();
755 for (unsigned int i = 0; i < count; i++)
756 if (get_subtable (i).apply (APPLY_ARG, lookup_type))
762 bool apply_string (hb_ot_layout_context_t *context,
764 hb_ot_layout_feature_mask_t mask) const
768 if (HB_UNLIKELY (!buffer->in_length))
771 if (HB_LIKELY (!is_reverse ()))
773 /* in/out forward substitution */
774 _hb_buffer_clear_output (buffer);
776 while (buffer->in_pos < buffer->in_length)
778 if ((~IN_PROPERTIES (buffer->in_pos) & mask) &&
779 apply_once (context, buffer, NO_CONTEXT, MAX_NESTING_LEVEL))
782 _hb_buffer_next_glyph (buffer);
786 _hb_buffer_swap (buffer);
792 /* in-place backward substitution */
793 buffer->in_pos = buffer->in_length - 1;
796 if ((~IN_PROPERTIES (buffer->in_pos) & mask) &&
797 apply_once (context, buffer, NO_CONTEXT, MAX_NESTING_LEVEL))
803 while ((int) buffer->in_pos >= 0);
809 inline bool sanitize (SANITIZE_ARG_DEF) {
810 if (Lookup::sanitize (SANITIZE_ARG)) return false;
811 OffsetArrayOf<SubstLookupSubTable> &list = (OffsetArrayOf<SubstLookupSubTable> &) subTable;
812 return SANITIZE_THIS (list);
815 ASSERT_SIZE (SubstLookup, 6);
817 typedef OffsetListOf<SubstLookup> SubstLookupList;
818 ASSERT_SIZE (SubstLookupList, 2);
824 struct GSUB : GSUBGPOS
826 static const hb_tag_t Tag = HB_TAG ('G','S','U','B');
828 static inline const GSUB& get_for_data (const char *data)
829 { return (const GSUB&) GSUBGPOS::get_for_data (data); }
831 inline const SubstLookup& get_lookup (unsigned int i) const
832 { return (const SubstLookup&) GSUBGPOS::get_lookup (i); }
834 inline bool substitute_lookup (hb_ot_layout_context_t *context,
836 unsigned int lookup_index,
837 hb_ot_layout_feature_mask_t mask) const
838 { return get_lookup (lookup_index).apply_string (context, buffer, mask); }
841 bool sanitize (SANITIZE_ARG_DEF) {
842 if (GSUBGPOS::sanitize (SANITIZE_ARG)) return false;
843 OffsetTo<SubstLookupList> &list = CAST(OffsetTo<SubstLookupList>, lookupList, 0);
844 return SANITIZE_THIS (list);
847 ASSERT_SIZE (GSUB, 10);
850 /* Out-of-class implementation for methods recursing */
852 inline bool ExtensionSubst::apply (APPLY_ARG_DEF) const
854 unsigned int lookup_type = get_type ();
856 if (HB_UNLIKELY (lookup_type == SubstLookupSubTable::Extension))
859 return get_subtable ().apply (APPLY_ARG, lookup_type);
862 inline bool ExtensionSubst::sanitize (SANITIZE_ARG_DEF)
864 return Extension::sanitize (SANITIZE_ARG) &&
865 (&(Extension::get_subtable ()) == &Null(LookupSubTable) ||
866 DECONST_CAST (SubstLookupSubTable, get_subtable (), 0).sanitize (SANITIZE_ARG));
869 static inline bool substitute_lookup (APPLY_ARG_DEF, unsigned int lookup_index)
871 const GSUB &gsub = *(context->face->ot_layout.gsub);
872 const SubstLookup &l = gsub.get_lookup (lookup_index);
874 if (HB_UNLIKELY (nesting_level_left == 0))
876 nesting_level_left--;
878 if (HB_UNLIKELY (context_length < 1))
881 return l.apply_once (context, buffer, context_length, nesting_level_left);
885 #endif /* HB_OT_LAYOUT_GSUB_PRIVATE_HH */