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
42 hb_codepoint_t glyph_id = IN_CURGLYPH ();
43 unsigned int index = (this+coverage) (glyph_id);
44 if (HB_LIKELY (index == NOT_COVERED))
47 glyph_id += deltaGlyphID;
48 _hb_buffer_replace_glyph (buffer, glyph_id);
50 /* We inherit the old glyph class to the substituted glyph */
51 if (_hb_ot_layout_has_new_glyph_classes (context->face))
52 _hb_ot_layout_set_glyph_property (context->face, glyph_id, property);
57 inline bool sanitize (SANITIZE_ARG_DEF) {
59 return SANITIZE_THIS (coverage) && SANITIZE (deltaGlyphID);
63 USHORT format; /* Format identifier--format = 1 */
65 coverage; /* Offset to Coverage table--from
66 * beginning of Substitution table */
67 SHORT deltaGlyphID; /* Add to original GlyphID to get
68 * substitute GlyphID */
70 ASSERT_SIZE (SingleSubstFormat1, 6);
72 struct SingleSubstFormat2
74 friend struct SingleSubst;
78 inline bool apply (APPLY_ARG_DEF) const
81 hb_codepoint_t glyph_id = IN_CURGLYPH ();
82 unsigned int index = (this+coverage) (glyph_id);
83 if (HB_LIKELY (index == NOT_COVERED))
86 if (HB_UNLIKELY (index >= substitute.len))
89 glyph_id = substitute[index];
90 _hb_buffer_replace_glyph (buffer, glyph_id);
92 /* We inherit the old glyph class to the substituted glyph */
93 if (_hb_ot_layout_has_new_glyph_classes (context->face))
94 _hb_ot_layout_set_glyph_property (context->face, glyph_id, property);
99 inline bool sanitize (SANITIZE_ARG_DEF) {
101 return SANITIZE_THIS (coverage) && SANITIZE (substitute);
105 USHORT format; /* Format identifier--format = 2 */
107 coverage; /* Offset to Coverage table--from
108 * beginning of Substitution table */
110 substitute; /* Array of substitute
111 * GlyphIDs--ordered by Coverage Index */
113 ASSERT_SIZE (SingleSubstFormat2, 6);
117 friend struct SubstLookupSubTable;
121 inline bool apply (APPLY_ARG_DEF) const
125 case 1: return u.format1->apply (APPLY_ARG);
126 case 2: return u.format2->apply (APPLY_ARG);
127 default:return false;
131 inline bool sanitize (SANITIZE_ARG_DEF) {
133 if (!SANITIZE (u.format)) return false;
135 case 1: return u.format1->sanitize (SANITIZE_ARG);
136 case 2: return u.format2->sanitize (SANITIZE_ARG);
143 USHORT format; /* Format identifier */
144 SingleSubstFormat1 format1[];
145 SingleSubstFormat2 format2[];
148 ASSERT_SIZE (SingleSubst, 2);
153 friend struct MultipleSubstFormat1;
156 inline bool apply (APPLY_ARG_DEF) const
159 if (HB_UNLIKELY (!substitute.len))
162 _hb_buffer_add_output_glyphs (buffer, 1,
163 substitute.len, (const uint16_t *) substitute.array,
166 /* This is a guess only ... */
167 if (_hb_ot_layout_has_new_glyph_classes (context->face))
169 if (property == HB_OT_LAYOUT_GLYPH_CLASS_LIGATURE)
170 property = HB_OT_LAYOUT_GLYPH_CLASS_BASE_GLYPH;
172 unsigned int count = substitute.len;
173 for (unsigned int n = 0; n < count; n++)
174 _hb_ot_layout_set_glyph_property (context->face, substitute[n], property);
181 inline bool sanitize (SANITIZE_ARG_DEF) {
183 return SANITIZE (substitute);
188 substitute; /* String of GlyphIDs to substitute */
190 ASSERT_SIZE (Sequence, 2);
192 struct MultipleSubstFormat1
194 friend struct MultipleSubst;
198 inline bool apply (APPLY_ARG_DEF) const
202 unsigned int index = (this+coverage) (IN_CURGLYPH ());
203 if (HB_LIKELY (index == NOT_COVERED))
206 return (this+sequence[index]).apply (APPLY_ARG);
209 inline bool sanitize (SANITIZE_ARG_DEF) {
211 return SANITIZE_THIS2 (coverage, sequence);
215 USHORT format; /* Format identifier--format = 1 */
217 coverage; /* Offset to Coverage table--from
218 * beginning of Substitution table */
219 OffsetArrayOf<Sequence>
220 sequence; /* Array of Sequence tables
221 * ordered by Coverage Index */
223 ASSERT_SIZE (MultipleSubstFormat1, 6);
227 friend struct SubstLookupSubTable;
231 inline bool apply (APPLY_ARG_DEF) const
235 case 1: return u.format1->apply (APPLY_ARG);
236 default:return false;
240 inline bool sanitize (SANITIZE_ARG_DEF) {
242 if (!SANITIZE (u.format)) return false;
244 case 1: return u.format1->sanitize (SANITIZE_ARG);
251 USHORT format; /* Format identifier */
252 MultipleSubstFormat1 format1[];
255 ASSERT_SIZE (MultipleSubst, 2);
258 typedef ArrayOf<GlyphID> AlternateSet; /* Array of alternate GlyphIDs--in
260 ASSERT_SIZE (AlternateSet, 2);
262 struct AlternateSubstFormat1
264 friend struct AlternateSubst;
268 inline bool apply (APPLY_ARG_DEF) const
271 hb_codepoint_t glyph_id = IN_CURGLYPH ();
273 unsigned int index = (this+coverage) (glyph_id);
274 if (HB_LIKELY (index == NOT_COVERED))
277 const AlternateSet &alt_set = this+alternateSet[index];
279 if (HB_UNLIKELY (!alt_set.len))
282 unsigned int alt_index = 0;
284 /* XXX callback to user to choose alternate
285 if (context->face->altfunc)
286 alt_index = (context->face->altfunc)(context->layout, buffer,
287 buffer->out_pos, glyph_id,
288 alt_set.len, alt_set.array);
291 if (HB_UNLIKELY (alt_index >= alt_set.len))
294 glyph_id = alt_set[alt_index];
296 _hb_buffer_replace_glyph (buffer, glyph_id);
298 /* We inherit the old glyph class to the substituted glyph */
299 if (_hb_ot_layout_has_new_glyph_classes (context->face))
300 _hb_ot_layout_set_glyph_property (context->face, glyph_id, property);
305 inline bool sanitize (SANITIZE_ARG_DEF) {
307 return SANITIZE_THIS2 (coverage, alternateSet);
311 USHORT format; /* Format identifier--format = 1 */
313 coverage; /* Offset to Coverage table--from
314 * beginning of Substitution table */
315 OffsetArrayOf<AlternateSet>
316 alternateSet; /* Array of AlternateSet tables
317 * ordered by Coverage Index */
319 ASSERT_SIZE (AlternateSubstFormat1, 6);
321 struct AlternateSubst
323 friend struct SubstLookupSubTable;
327 inline bool apply (APPLY_ARG_DEF) const
331 case 1: return u.format1->apply (APPLY_ARG);
332 default:return false;
336 inline bool sanitize (SANITIZE_ARG_DEF) {
338 if (!SANITIZE (u.format)) return false;
340 case 1: return u.format1->sanitize (SANITIZE_ARG);
347 USHORT format; /* Format identifier */
348 AlternateSubstFormat1 format1[];
351 ASSERT_SIZE (AlternateSubst, 2);
356 friend struct LigatureSet;
359 inline bool apply (APPLY_ARG_DEF, bool is_mark) const
363 unsigned int count = component.len;
364 unsigned int end = MIN (buffer->in_length, buffer->in_pos + context_length);
365 if (HB_UNLIKELY (buffer->in_pos + count > end))
368 for (i = 1, j = buffer->in_pos + 1; i < count; i++, j++)
370 while (_hb_ot_layout_skip_mark (context->face, IN_INFO (j), lookup_flag, &property))
372 if (HB_UNLIKELY (j + count - i == end))
377 if (!(property & HB_OT_LAYOUT_GLYPH_CLASS_MARK))
380 if (HB_LIKELY (IN_GLYPH (j) != component[i]))
383 /* This is just a guess ... */
384 if (_hb_ot_layout_has_new_glyph_classes (context->face))
385 _hb_ot_layout_set_glyph_class (context->face, ligGlyph,
386 is_mark ? HB_OT_LAYOUT_GLYPH_CLASS_MARK
387 : HB_OT_LAYOUT_GLYPH_CLASS_LIGATURE);
389 if (j == buffer->in_pos + i) /* No input glyphs skipped */
390 /* We don't use a new ligature ID if there are no skipped
391 glyphs and the ligature already has an ID. */
392 _hb_buffer_add_output_glyphs (buffer, i,
393 1, (const uint16_t *) &ligGlyph,
395 IN_LIGID (buffer->in_pos) ?
396 0xFFFF : _hb_buffer_allocate_lig_id (buffer));
399 unsigned int lig_id = _hb_buffer_allocate_lig_id (buffer);
400 _hb_buffer_add_output_glyph (buffer, ligGlyph, 0xFFFF, lig_id);
402 /* Now we must do a second loop to copy the skipped glyphs to
403 `out' and assign component values to it. We start with the
404 glyph after the first component. Glyphs between component
405 i and i+1 belong to component i. Together with the lig_id
406 value it is later possible to check whether a specific
407 component value really belongs to a given ligature. */
409 for ( i = 1; i < count; i++ )
411 while (_hb_ot_layout_skip_mark (context->face, IN_CURINFO (), lookup_flag, NULL))
412 _hb_buffer_add_output_glyph (buffer, IN_CURGLYPH (), i - 1, lig_id);
417 /* TODO We should possibly reassign lig_id and component for any
418 * components of a previous ligature that s now being removed as part of
426 inline bool sanitize (SANITIZE_ARG_DEF) {
428 return SANITIZE2 (ligGlyph, component);
432 GlyphID ligGlyph; /* GlyphID of ligature to substitute */
433 HeadlessArrayOf<GlyphID>
434 component; /* Array of component GlyphIDs--start
435 * with the second component--ordered
436 * in writing direction */
438 ASSERT_SIZE (Ligature, 4);
442 friend struct LigatureSubstFormat1;
445 inline bool apply (APPLY_ARG_DEF, bool is_mark) const
448 unsigned int num_ligs = ligature.len;
449 for (unsigned int i = 0; i < num_ligs; i++)
451 const Ligature &lig = this+ligature[i];
452 if (lig.apply (APPLY_ARG, is_mark))
460 inline bool sanitize (SANITIZE_ARG_DEF) {
462 return SANITIZE_THIS (ligature);
466 OffsetArrayOf<Ligature>
467 ligature; /* Array LigatureSet tables
468 * ordered by preference */
470 ASSERT_SIZE (LigatureSet, 2);
472 struct LigatureSubstFormat1
474 friend struct LigatureSubst;
477 inline bool apply (APPLY_ARG_DEF) const
480 hb_codepoint_t glyph_id = IN_CURGLYPH ();
482 bool first_is_mark = !!(property & HB_OT_LAYOUT_GLYPH_CLASS_MARK);
484 unsigned int index = (this+coverage) (glyph_id);
485 if (HB_LIKELY (index == NOT_COVERED))
488 const LigatureSet &lig_set = this+ligatureSet[index];
489 return lig_set.apply (APPLY_ARG, first_is_mark);
492 inline bool sanitize (SANITIZE_ARG_DEF) {
494 return SANITIZE_THIS2 (coverage, ligatureSet);
498 USHORT format; /* Format identifier--format = 1 */
500 coverage; /* Offset to Coverage table--from
501 * beginning of Substitution table */
502 OffsetArrayOf<LigatureSet>
503 ligatureSet; /* Array LigatureSet tables
504 * ordered by Coverage Index */
506 ASSERT_SIZE (LigatureSubstFormat1, 6);
510 friend struct SubstLookupSubTable;
513 inline bool apply (APPLY_ARG_DEF) const
517 case 1: return u.format1->apply (APPLY_ARG);
518 default:return false;
522 inline bool sanitize (SANITIZE_ARG_DEF) {
524 if (!SANITIZE (u.format)) return false;
526 case 1: return u.format1->sanitize (SANITIZE_ARG);
533 USHORT format; /* Format identifier */
534 LigatureSubstFormat1 format1[];
537 ASSERT_SIZE (LigatureSubst, 2);
541 static inline bool substitute_lookup (APPLY_ARG_DEF, unsigned int lookup_index);
543 struct ContextSubst : Context
545 friend struct SubstLookupSubTable;
548 inline bool apply (APPLY_ARG_DEF) const
551 return Context::apply (APPLY_ARG, substitute_lookup);
554 ASSERT_SIZE (ContextSubst, 2);
556 struct ChainContextSubst : ChainContext
558 friend struct SubstLookupSubTable;
561 inline bool apply (APPLY_ARG_DEF) const
564 return ChainContext::apply (APPLY_ARG, substitute_lookup);
567 ASSERT_SIZE (ChainContextSubst, 2);
570 struct ExtensionSubst : Extension
572 friend struct SubstLookupSubTable;
575 inline const struct SubstLookupSubTable& get_subtable (void) const
576 { return CONST_CAST (SubstLookupSubTable, Extension::get_subtable (), 0); }
578 inline bool apply (APPLY_ARG_DEF) const;
580 inline bool sanitize (SANITIZE_ARG_DEF);
582 ASSERT_SIZE (ExtensionSubst, 2);
585 struct ReverseChainSingleSubstFormat1
587 friend struct ReverseChainSingleSubst;
590 inline bool apply (APPLY_ARG_DEF) const
593 if (HB_UNLIKELY (context_length != NO_CONTEXT))
594 return false; /* No chaining to this type */
596 unsigned int index = (this+coverage) (IN_CURGLYPH ());
597 if (HB_LIKELY (index == NOT_COVERED))
600 const OffsetArrayOf<Coverage> &lookahead = CONST_NEXT (OffsetArrayOf<Coverage>, backtrack);
601 const ArrayOf<GlyphID> &substitute = CONST_NEXT (ArrayOf<GlyphID>, lookahead);
603 if (match_backtrack (APPLY_ARG,
604 backtrack.len, (USHORT *) backtrack.array,
605 match_coverage, DECONST_CHARP(this)) &&
606 match_lookahead (APPLY_ARG,
607 lookahead.len, (USHORT *) lookahead.array,
608 match_coverage, DECONST_CHARP(this),
611 IN_CURGLYPH () = substitute[index];
612 buffer->in_pos--; /* Reverse! */
619 inline bool sanitize (SANITIZE_ARG_DEF) {
621 if (!SANITIZE_THIS2 (coverage, backtrack))
623 OffsetArrayOf<Coverage> &lookahead = NEXT (OffsetArrayOf<Coverage>, backtrack);
624 if (!SANITIZE_THIS (lookahead))
626 ArrayOf<GlyphID> &substitute = NEXT (ArrayOf<GlyphID>, lookahead);
627 return SANITIZE (substitute);
631 USHORT format; /* Format identifier--format = 1 */
633 coverage; /* Offset to Coverage table--from
634 * beginning of table */
635 OffsetArrayOf<Coverage>
636 backtrack; /* Array of coverage tables
637 * in backtracking sequence, in glyph
639 OffsetArrayOf<Coverage>
640 lookaheadX; /* Array of coverage tables
641 * in lookahead sequence, in glyph
644 substituteX; /* Array of substitute
645 * GlyphIDs--ordered by Coverage Index */
647 ASSERT_SIZE (ReverseChainSingleSubstFormat1, 10);
649 struct ReverseChainSingleSubst
651 friend struct SubstLookupSubTable;
654 inline bool apply (APPLY_ARG_DEF) const
658 case 1: return u.format1->apply (APPLY_ARG);
659 default:return false;
663 inline bool sanitize (SANITIZE_ARG_DEF) {
665 if (!SANITIZE (u.format)) return false;
667 case 1: return u.format1->sanitize (SANITIZE_ARG);
674 USHORT format; /* Format identifier */
675 ReverseChainSingleSubstFormat1 format1[];
678 ASSERT_SIZE (ReverseChainSingleSubst, 2);
686 struct SubstLookupSubTable
688 friend struct SubstLookup;
698 ReverseChainSingle = 8
701 inline bool apply (APPLY_ARG_DEF, unsigned int lookup_type) const
704 switch (lookup_type) {
705 case Single: return u.single->apply (APPLY_ARG);
706 case Multiple: return u.multiple->apply (APPLY_ARG);
707 case Alternate: return u.alternate->apply (APPLY_ARG);
708 case Ligature: return u.ligature->apply (APPLY_ARG);
709 case Context: return u.context->apply (APPLY_ARG);
710 case ChainContext: return u.chainContext->apply (APPLY_ARG);
711 case Extension: return u.extension->apply (APPLY_ARG);
712 case ReverseChainSingle: return u.reverseChainContextSingle->apply (APPLY_ARG);
713 default:return false;
717 inline bool sanitize (SANITIZE_ARG_DEF) {
719 if (!SANITIZE (u.format)) return false;
721 case Single: return u.single->sanitize (SANITIZE_ARG);
722 case Multiple: return u.multiple->sanitize (SANITIZE_ARG);
723 case Alternate: return u.alternate->sanitize (SANITIZE_ARG);
724 case Ligature: return u.ligature->sanitize (SANITIZE_ARG);
725 case Context: return u.context->sanitize (SANITIZE_ARG);
726 case ChainContext: return u.chainContext->sanitize (SANITIZE_ARG);
727 case Extension: return u.extension->sanitize (SANITIZE_ARG);
728 case ReverseChainSingle: return u.reverseChainContextSingle->sanitize (SANITIZE_ARG);
736 SingleSubst single[];
737 MultipleSubst multiple[];
738 AlternateSubst alternate[];
739 LigatureSubst ligature[];
740 ContextSubst context[];
741 ChainContextSubst chainContext[];
742 ExtensionSubst extension[];
743 ReverseChainSingleSubst reverseChainContextSingle[];
746 ASSERT_SIZE (SubstLookupSubTable, 2);
749 struct SubstLookup : Lookup
751 inline const SubstLookupSubTable& get_subtable (unsigned int i) const
752 { return CONST_CAST (SubstLookupSubTable, Lookup::get_subtable (i), 0); }
754 /* Like get_type(), but looks through extension lookups.
755 * Never returns Extension */
756 inline unsigned int get_effective_type (void) const
758 unsigned int type = get_type ();
760 if (HB_UNLIKELY (type == SubstLookupSubTable::Extension))
762 unsigned int count = get_subtable_count ();
763 type = get_subtable(0).u.extension->get_type ();
764 /* The spec says all subtables should have the same type.
765 * This is specially important if one has a reverse type! */
766 for (unsigned int i = 1; i < count; i++)
767 if (get_subtable(i).u.extension->get_type () != type)
774 inline bool is_reverse (void) const
775 { return HB_UNLIKELY (get_effective_type () == SubstLookupSubTable::ReverseChainSingle); }
777 inline bool apply_once (hb_ot_layout_context_t *context,
779 unsigned int context_length,
780 unsigned int nesting_level_left) const
782 unsigned int lookup_type = get_type ();
783 unsigned int lookup_flag = get_flag ();
784 unsigned int property;
786 if (!_hb_ot_layout_check_glyph_property (context->face, IN_CURINFO (), lookup_flag, &property))
789 unsigned int count = get_subtable_count ();
790 for (unsigned int i = 0; i < count; i++)
791 if (get_subtable (i).apply (APPLY_ARG_INIT, lookup_type))
797 inline bool apply_string (hb_ot_layout_context_t *context,
799 hb_mask_t mask) const
803 if (HB_UNLIKELY (!buffer->in_length))
806 if (HB_LIKELY (!is_reverse ()))
808 /* in/out forward substitution */
809 _hb_buffer_clear_output (buffer);
811 while (buffer->in_pos < buffer->in_length)
813 if ((~IN_MASK (buffer->in_pos) & mask) &&
814 apply_once (context, buffer, NO_CONTEXT, MAX_NESTING_LEVEL))
817 _hb_buffer_next_glyph (buffer);
821 _hb_buffer_swap (buffer);
825 /* in-place backward substitution */
826 buffer->in_pos = buffer->in_length - 1;
829 if ((~IN_MASK (buffer->in_pos) & mask) &&
830 apply_once (context, buffer, NO_CONTEXT, MAX_NESTING_LEVEL))
836 while ((int) buffer->in_pos >= 0);
842 inline bool sanitize (SANITIZE_ARG_DEF) {
844 if (!Lookup::sanitize (SANITIZE_ARG)) return false;
845 OffsetArrayOf<SubstLookupSubTable> &list = (OffsetArrayOf<SubstLookupSubTable> &) subTable;
846 return SANITIZE_THIS (list);
849 ASSERT_SIZE (SubstLookup, 6);
851 typedef OffsetListOf<SubstLookup> SubstLookupList;
852 ASSERT_SIZE (SubstLookupList, 2);
858 struct GSUB : GSUBGPOS
860 static const hb_tag_t Tag = HB_OT_TAG_GSUB;
862 static inline const GSUB& get_for_data (const char *data)
863 { return (const GSUB&) GSUBGPOS::get_for_data (data); }
865 inline const SubstLookup& get_lookup (unsigned int i) const
866 { return (const SubstLookup&) GSUBGPOS::get_lookup (i); }
868 inline bool substitute_lookup (hb_ot_layout_context_t *context,
870 unsigned int lookup_index,
871 hb_mask_t mask) const
872 { return get_lookup (lookup_index).apply_string (context, buffer, mask); }
875 inline bool sanitize (SANITIZE_ARG_DEF) {
877 if (!GSUBGPOS::sanitize (SANITIZE_ARG)) return false;
878 OffsetTo<SubstLookupList> &list = CAST(OffsetTo<SubstLookupList>, lookupList, 0);
879 return SANITIZE_THIS (list);
882 ASSERT_SIZE (GSUB, 10);
885 /* Out-of-class implementation for methods recursing */
887 inline bool ExtensionSubst::apply (APPLY_ARG_DEF) const
890 unsigned int lookup_type = get_type ();
892 if (HB_UNLIKELY (lookup_type == SubstLookupSubTable::Extension))
895 return get_subtable ().apply (APPLY_ARG, lookup_type);
898 inline bool ExtensionSubst::sanitize (SANITIZE_ARG_DEF)
901 return Extension::sanitize (SANITIZE_ARG) &&
902 (&(Extension::get_subtable ()) == &Null(LookupSubTable) ||
903 get_type () == SubstLookupSubTable::Extension ||
904 DECONST_CAST (SubstLookupSubTable, get_subtable (), 0).sanitize (SANITIZE_ARG));
907 static inline bool substitute_lookup (APPLY_ARG_DEF, unsigned int lookup_index)
909 const GSUB &gsub = *(context->face->ot_layout.gsub);
910 const SubstLookup &l = gsub.get_lookup (lookup_index);
912 if (HB_UNLIKELY (nesting_level_left == 0))
914 nesting_level_left--;
916 if (HB_UNLIKELY (context_length < 1))
919 return l.apply_once (context, buffer, context_length, nesting_level_left);
923 #endif /* HB_OT_LAYOUT_GSUB_PRIVATE_HH */