778b2c442b0158d106a06c3a31e3abec334e76e6
[platform/upstream/harfbuzz.git] / src / hb-ot-layout-private.hh
1 /*
2  * Copyright © 2007,2008,2009  Red Hat, Inc.
3  * Copyright © 2012,2013  Google, Inc.
4  *
5  *  This is part of HarfBuzz, a text shaping library.
6  *
7  * Permission is hereby granted, without written agreement and without
8  * license or royalty fees, to use, copy, modify, and distribute this
9  * software and its documentation for any purpose, provided that the
10  * above copyright notice and the following two paragraphs appear in
11  * all copies of this software.
12  *
13  * IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
14  * DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
15  * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
16  * IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
17  * DAMAGE.
18  *
19  * THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
20  * BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
21  * FITNESS FOR A PARTICULAR PURPOSE.  THE SOFTWARE PROVIDED HEREUNDER IS
22  * ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
23  * PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
24  *
25  * Red Hat Author(s): Behdad Esfahbod
26  * Google Author(s): Behdad Esfahbod
27  */
28
29 #ifndef HB_OT_LAYOUT_PRIVATE_HH
30 #define HB_OT_LAYOUT_PRIVATE_HH
31
32 #include "hb-private.hh"
33
34 #include "hb-font-private.hh"
35 #include "hb-buffer-private.hh"
36 #include "hb-set-private.hh"
37
38
39 /* Private API corresponding to hb-ot-layout.h: */
40
41 HB_INTERNAL hb_bool_t
42 hb_ot_layout_table_find_feature (hb_face_t    *face,
43                                  hb_tag_t      table_tag,
44                                  hb_tag_t      feature_tag,
45                                  unsigned int *feature_index);
46
47
48 /*
49  * GDEF
50  */
51
52 enum hb_ot_layout_glyph_props_flags_t
53 {
54   /* The following three match LookupFlags::Ignore* numbers. */
55   HB_OT_LAYOUT_GLYPH_PROPS_BASE_GLYPH   = 0x02u,
56   HB_OT_LAYOUT_GLYPH_PROPS_LIGATURE     = 0x04u,
57   HB_OT_LAYOUT_GLYPH_PROPS_MARK         = 0x08u,
58
59   /* The following are used internally; not derived from GDEF. */
60   HB_OT_LAYOUT_GLYPH_PROPS_SUBSTITUTED  = 0x10u,
61   HB_OT_LAYOUT_GLYPH_PROPS_LIGATED      = 0x20u,
62   HB_OT_LAYOUT_GLYPH_PROPS_MULTIPLIED   = 0x40u,
63
64   HB_OT_LAYOUT_GLYPH_PROPS_PRESERVE     = HB_OT_LAYOUT_GLYPH_PROPS_SUBSTITUTED |
65                                           HB_OT_LAYOUT_GLYPH_PROPS_LIGATED |
66                                           HB_OT_LAYOUT_GLYPH_PROPS_MULTIPLIED
67 };
68 HB_MARK_AS_FLAG_T (hb_ot_layout_glyph_props_flags_t);
69
70
71 /*
72  * GSUB/GPOS
73  */
74
75 HB_INTERNAL hb_bool_t
76 hb_ot_layout_lookup_would_substitute_fast (hb_face_t            *face,
77                                            unsigned int          lookup_index,
78                                            const hb_codepoint_t *glyphs,
79                                            unsigned int          glyphs_length,
80                                            hb_bool_t             zero_context);
81
82
83 /* Should be called before all the substitute_lookup's are done. */
84 HB_INTERNAL void
85 hb_ot_layout_substitute_start (hb_font_t    *font,
86                                hb_buffer_t  *buffer);
87
88
89 struct hb_ot_layout_lookup_accelerator_t;
90
91 namespace OT {
92   struct hb_apply_context_t;
93   struct SubstLookup;
94 }
95
96 HB_INTERNAL void
97 hb_ot_layout_substitute_lookup (OT::hb_apply_context_t *c,
98                                 const OT::SubstLookup &lookup,
99                                 const hb_ot_layout_lookup_accelerator_t &accel);
100
101
102 /* Should be called before all the position_lookup's are done. */
103 HB_INTERNAL void
104 hb_ot_layout_position_start (hb_font_t    *font,
105                              hb_buffer_t  *buffer);
106
107 /* Should be called after all the position_lookup's are done, to finish advances. */
108 HB_INTERNAL void
109 hb_ot_layout_position_finish_advances (hb_font_t    *font,
110                                        hb_buffer_t  *buffer);
111
112 /* Should be called after hb_ot_layout_position_finish_advances, to finish offsets. */
113 HB_INTERNAL void
114 hb_ot_layout_position_finish_offsets (hb_font_t    *font,
115                                       hb_buffer_t  *buffer);
116
117
118
119 /*
120  * hb_ot_layout_t
121  */
122
123 namespace OT {
124   struct GDEF;
125   struct GSUB;
126   struct GPOS;
127 }
128
129 struct hb_ot_layout_lookup_accelerator_t
130 {
131   template <typename TLookup>
132   inline void init (const TLookup &lookup)
133   {
134     digest.init ();
135     lookup.add_coverage (&digest);
136   }
137
138   inline void fini (void)
139   {
140   }
141
142   inline bool may_have (hb_codepoint_t g) const {
143     return digest.may_have (g);
144   }
145
146   private:
147   hb_set_digest_t digest;
148 };
149
150 struct hb_ot_layout_t
151 {
152   hb_blob_t *gdef_blob;
153   hb_blob_t *gsub_blob;
154   hb_blob_t *gpos_blob;
155
156   const struct OT::GDEF *gdef;
157   const struct OT::GSUB *gsub;
158   const struct OT::GPOS *gpos;
159
160   unsigned int gsub_lookup_count;
161   unsigned int gpos_lookup_count;
162
163   hb_ot_layout_lookup_accelerator_t *gsub_accels;
164   hb_ot_layout_lookup_accelerator_t *gpos_accels;
165 };
166
167
168 HB_INTERNAL hb_ot_layout_t *
169 _hb_ot_layout_create (hb_face_t *face);
170
171 HB_INTERNAL void
172 _hb_ot_layout_destroy (hb_ot_layout_t *layout);
173
174
175 #define hb_ot_layout_from_face(face) ((hb_ot_layout_t *) face->shaper_data.ot)
176
177
178 /*
179  * Buffer var routines.
180  */
181
182 /* buffer var allocations, used during the entire shaping process */
183 #define unicode_props()         var2.u16[0]
184
185 /* buffer var allocations, used during the GSUB/GPOS processing */
186 #define glyph_props()           var1.u16[0] /* GDEF glyph properties */
187 #define lig_props()             var1.u8[2] /* GSUB/GPOS ligature tracking */
188 #define syllable()              var1.u8[3] /* GSUB/GPOS shaping boundaries */
189
190
191 /* loop over syllables */
192
193 #define foreach_syllable(buffer, start, end) \
194   for (unsigned int \
195        _count = buffer->len, \
196        start = 0, end = _count ? _next_syllable (buffer, 0) : 0; \
197        start < _count; \
198        start = end, end = _next_syllable (buffer, start))
199
200 static inline unsigned int
201 _next_syllable (hb_buffer_t *buffer, unsigned int start)
202 {
203   hb_glyph_info_t *info = buffer->info;
204   unsigned int count = buffer->len;
205
206   unsigned int syllable = info[start].syllable();
207   while (++start < count && syllable == info[start].syllable())
208     ;
209
210   return start;
211 }
212
213
214 /* unicode_props */
215
216 /* Design:
217  * unicode_props() is a two-byte number.  The low byte includes:
218  * - General_Category: 5 bits.
219  * - A bit each for:
220  *   * Is it Default_Ignorable(); we have a modified Default_Ignorable().
221  *   * Whether it's one of the three Mongolian Free Variation Selectors.
222  *   * One free bit right now.
223  *
224  * The high-byte has different meanings, switched by the Gen-Cat:
225  * - For Mn,Mc,Me: the modified Combining_Class.
226  * - For Cf: whether it's ZWJ, ZWNJ, or something else.
227  * - For Ws: index of which space character this is, if space fallback
228  *   is needed, ie. we don't set this by default, only if asked to.
229  */
230
231 enum hb_unicode_props_flags_t {
232   UPROPS_MASK_GEN_CAT   = 0x001Fu,
233   UPROPS_MASK_IGNORABLE = 0x0020u,
234   UPROPS_MASK_FVS       = 0x0040u, /* MONGOLIAN FREE VARIATION SELECTOR 1..3 */
235
236   /* If GEN_CAT=FORMAT, top byte masks: */
237   UPROPS_MASK_Cf_ZWJ    = 0x0100u,
238   UPROPS_MASK_Cf_ZWNJ   = 0x0200u
239 };
240 HB_MARK_AS_FLAG_T (hb_unicode_props_flags_t);
241
242 static inline void
243 _hb_glyph_info_set_unicode_props (hb_glyph_info_t *info, hb_buffer_t *buffer)
244 {
245   hb_unicode_funcs_t *unicode = buffer->unicode;
246   unsigned int u = info->codepoint;
247   unsigned int gen_cat = (unsigned int) unicode->general_category (u);
248   unsigned int props = gen_cat;
249
250   if (u >= 0x80)
251   {
252     buffer->scratch_flags |= HB_BUFFER_SCRATCH_FLAG_HAS_NON_ASCII;
253     if (unlikely (unicode->is_default_ignorable (u)))
254     {
255       buffer->scratch_flags |= HB_BUFFER_SCRATCH_FLAG_HAS_DEFAULT_IGNORABLES;
256       props |=  UPROPS_MASK_IGNORABLE;
257       if (u == 0x200Cu) props |= UPROPS_MASK_Cf_ZWNJ;
258       if (u == 0x200Du) props |= UPROPS_MASK_Cf_ZWJ;
259       /* Mongolian Free Variation Selectors need to be remembered
260        * because although we need to hide them like default-ignorables,
261        * they need to non-ignorable during shaping.  This is similar to
262        * what we do for joiners in Indic-like shapers, but since the
263        * FVSes are GC=Mn, we have use a separate bit to remember them.
264        * Fixes:
265        * https://github.com/behdad/harfbuzz/issues/234
266        */
267       if (unlikely (hb_in_range (u, 0x180Bu, 0x180Du))) props |= UPROPS_MASK_FVS;
268     }
269     else if (unlikely (HB_UNICODE_GENERAL_CATEGORY_IS_NON_ENCLOSING_MARK_OR_MODIFIER_SYMBOL (gen_cat)))
270     {
271       /* The above check is just an optimization to let in only things we need further
272        * processing on. */
273
274       /* Only Mn and Mc can have non-zero ccc:
275        * http://www.unicode.org/policies/stability_policy.html#Property_Value
276        * """
277        * Canonical_Combining_Class, General_Category
278        * All characters other than those with General_Category property values
279        * Spacing_Mark (Mc) and Nonspacing_Mark (Mn) have the Canonical_Combining_Class
280        * property value 0.
281        * 1.1.5+
282        * """
283        *
284        * Also, all Mn's that are Default_Ignorable, have ccc=0, hence
285        * the "else if".
286        */
287       props |= unicode->modified_combining_class (info->codepoint)<<8;
288
289       /* Recategorize emoji skin-tone modifiers as Unicode mark, so they
290        * behave correctly in non-native directionality.  They originally
291        * are MODIFIER_SYMBOL.  Fixes:
292        * https://github.com/behdad/harfbuzz/issues/169
293        */
294       if (unlikely (hb_in_range (u, 0x1F3FBu, 0x1F3FFu)))
295       {
296         props = gen_cat = HB_UNICODE_GENERAL_CATEGORY_ENCLOSING_MARK;
297       }
298     }
299   }
300
301   info->unicode_props() = props;
302 }
303
304 static inline void
305 _hb_glyph_info_set_general_category (hb_glyph_info_t *info,
306                                      hb_unicode_general_category_t gen_cat)
307 {
308   /* Clears top-byte. */
309   info->unicode_props() = (unsigned int) gen_cat | (info->unicode_props() & (0xFF & ~UPROPS_MASK_GEN_CAT));
310 }
311
312 static inline hb_unicode_general_category_t
313 _hb_glyph_info_get_general_category (const hb_glyph_info_t *info)
314 {
315   return (hb_unicode_general_category_t) (info->unicode_props() & UPROPS_MASK_GEN_CAT);
316 }
317
318 static inline bool
319 _hb_glyph_info_is_unicode_mark (const hb_glyph_info_t *info)
320 {
321   return HB_UNICODE_GENERAL_CATEGORY_IS_MARK (info->unicode_props() & UPROPS_MASK_GEN_CAT);
322 }
323 static inline void
324 _hb_glyph_info_set_modified_combining_class (hb_glyph_info_t *info,
325                                              unsigned int modified_class)
326 {
327   if (unlikely (!_hb_glyph_info_is_unicode_mark (info)))
328     return;
329   info->unicode_props() = (modified_class<<8) | (info->unicode_props() & 0xFF);
330 }
331 static inline unsigned int
332 _hb_glyph_info_get_modified_combining_class (const hb_glyph_info_t *info)
333 {
334   return _hb_glyph_info_is_unicode_mark (info) ? info->unicode_props()>>8 : 0;
335 }
336
337 static inline bool
338 _hb_glyph_info_is_unicode_space (const hb_glyph_info_t *info)
339 {
340   return _hb_glyph_info_get_general_category (info) ==
341          HB_UNICODE_GENERAL_CATEGORY_SPACE_SEPARATOR;
342 }
343 static inline void
344 _hb_glyph_info_set_unicode_space_fallback_type (hb_glyph_info_t *info, hb_unicode_funcs_t::space_t s)
345 {
346   if (unlikely (!_hb_glyph_info_is_unicode_space (info)))
347     return;
348   info->unicode_props() = (((unsigned int) s)<<8) | (info->unicode_props() & 0xFF);
349 }
350 static inline hb_unicode_funcs_t::space_t
351 _hb_glyph_info_get_unicode_space_fallback_type (const hb_glyph_info_t *info)
352 {
353   return _hb_glyph_info_is_unicode_space (info) ?
354          (hb_unicode_funcs_t::space_t) (info->unicode_props()>>8) :
355          hb_unicode_funcs_t::NOT_SPACE;
356 }
357
358 static inline bool _hb_glyph_info_ligated (const hb_glyph_info_t *info);
359
360 static inline hb_bool_t
361 _hb_glyph_info_is_default_ignorable (const hb_glyph_info_t *info)
362 {
363   return (info->unicode_props() & UPROPS_MASK_IGNORABLE) &&
364          !_hb_glyph_info_ligated (info);
365 }
366 static inline hb_bool_t
367 _hb_glyph_info_is_default_ignorable_and_not_fvs (const hb_glyph_info_t *info)
368 {
369   return ((info->unicode_props() & (UPROPS_MASK_IGNORABLE|UPROPS_MASK_FVS))
370           == UPROPS_MASK_IGNORABLE) &&
371          !_hb_glyph_info_ligated (info);
372 }
373
374 static inline bool
375 _hb_glyph_info_is_unicode_format (const hb_glyph_info_t *info)
376 {
377   return _hb_glyph_info_get_general_category (info) ==
378          HB_UNICODE_GENERAL_CATEGORY_FORMAT;
379 }
380 static inline hb_bool_t
381 _hb_glyph_info_is_zwnj (const hb_glyph_info_t *info)
382 {
383   return _hb_glyph_info_is_unicode_format (info) && (info->unicode_props() & UPROPS_MASK_Cf_ZWNJ);
384 }
385 static inline hb_bool_t
386 _hb_glyph_info_is_zwj (const hb_glyph_info_t *info)
387 {
388   return _hb_glyph_info_is_unicode_format (info) && (info->unicode_props() & UPROPS_MASK_Cf_ZWJ);
389 }
390 static inline hb_bool_t
391 _hb_glyph_info_is_joiner (const hb_glyph_info_t *info)
392 {
393   return _hb_glyph_info_is_unicode_format (info) && (info->unicode_props() & (UPROPS_MASK_Cf_ZWNJ|UPROPS_MASK_Cf_ZWJ));
394 }
395 static inline void
396 _hb_glyph_info_flip_joiners (hb_glyph_info_t *info)
397 {
398   if (!_hb_glyph_info_is_unicode_format (info))
399     return;
400   info->unicode_props() ^= UPROPS_MASK_Cf_ZWNJ | UPROPS_MASK_Cf_ZWJ;
401 }
402
403 /* lig_props: aka lig_id / lig_comp
404  *
405  * When a ligature is formed:
406  *
407  *   - The ligature glyph and any marks in between all the same newly allocated
408  *     lig_id,
409  *   - The ligature glyph will get lig_num_comps set to the number of components
410  *   - The marks get lig_comp > 0, reflecting which component of the ligature
411  *     they were applied to.
412  *   - This is used in GPOS to attach marks to the right component of a ligature
413  *     in MarkLigPos,
414  *   - Note that when marks are ligated together, much of the above is skipped
415  *     and the current lig_id reused.
416  *
417  * When a multiple-substitution is done:
418  *
419  *   - All resulting glyphs will have lig_id = 0,
420  *   - The resulting glyphs will have lig_comp = 0, 1, 2, ... respectively.
421  *   - This is used in GPOS to attach marks to the first component of a
422  *     multiple substitution in MarkBasePos.
423  *
424  * The numbers are also used in GPOS to do mark-to-mark positioning only
425  * to marks that belong to the same component of the same ligature.
426  */
427
428 static inline void
429 _hb_glyph_info_clear_lig_props (hb_glyph_info_t *info)
430 {
431   info->lig_props() = 0;
432 }
433
434 #define IS_LIG_BASE 0x10
435
436 static inline void
437 _hb_glyph_info_set_lig_props_for_ligature (hb_glyph_info_t *info,
438                                            unsigned int lig_id,
439                                            unsigned int lig_num_comps)
440 {
441   info->lig_props() = (lig_id << 5) | IS_LIG_BASE | (lig_num_comps & 0x0F);
442 }
443
444 static inline void
445 _hb_glyph_info_set_lig_props_for_mark (hb_glyph_info_t *info,
446                                        unsigned int lig_id,
447                                        unsigned int lig_comp)
448 {
449   info->lig_props() = (lig_id << 5) | (lig_comp & 0x0F);
450 }
451
452 static inline void
453 _hb_glyph_info_set_lig_props_for_component (hb_glyph_info_t *info, unsigned int comp)
454 {
455   _hb_glyph_info_set_lig_props_for_mark (info, 0, comp);
456 }
457
458 static inline unsigned int
459 _hb_glyph_info_get_lig_id (const hb_glyph_info_t *info)
460 {
461   return info->lig_props() >> 5;
462 }
463
464 static inline bool
465 _hb_glyph_info_ligated_internal (const hb_glyph_info_t *info)
466 {
467   return !!(info->lig_props() & IS_LIG_BASE);
468 }
469
470 static inline unsigned int
471 _hb_glyph_info_get_lig_comp (const hb_glyph_info_t *info)
472 {
473   if (_hb_glyph_info_ligated_internal (info))
474     return 0;
475   else
476     return info->lig_props() & 0x0F;
477 }
478
479 static inline unsigned int
480 _hb_glyph_info_get_lig_num_comps (const hb_glyph_info_t *info)
481 {
482   if ((info->glyph_props() & HB_OT_LAYOUT_GLYPH_PROPS_LIGATURE) &&
483       _hb_glyph_info_ligated_internal (info))
484     return info->lig_props() & 0x0F;
485   else
486     return 1;
487 }
488
489 static inline uint8_t
490 _hb_allocate_lig_id (hb_buffer_t *buffer) {
491   uint8_t lig_id = buffer->next_serial () & 0x07;
492   if (unlikely (!lig_id))
493     lig_id = _hb_allocate_lig_id (buffer); /* in case of overflow */
494   return lig_id;
495 }
496
497 /* glyph_props: */
498
499 static inline void
500 _hb_glyph_info_set_glyph_props (hb_glyph_info_t *info, unsigned int props)
501 {
502   info->glyph_props() = props;
503 }
504
505 static inline unsigned int
506 _hb_glyph_info_get_glyph_props (const hb_glyph_info_t *info)
507 {
508   return info->glyph_props();
509 }
510
511 static inline bool
512 _hb_glyph_info_is_base_glyph (const hb_glyph_info_t *info)
513 {
514   return !!(info->glyph_props() & HB_OT_LAYOUT_GLYPH_PROPS_BASE_GLYPH);
515 }
516
517 static inline bool
518 _hb_glyph_info_is_ligature (const hb_glyph_info_t *info)
519 {
520   return !!(info->glyph_props() & HB_OT_LAYOUT_GLYPH_PROPS_LIGATURE);
521 }
522
523 static inline bool
524 _hb_glyph_info_is_mark (const hb_glyph_info_t *info)
525 {
526   return !!(info->glyph_props() & HB_OT_LAYOUT_GLYPH_PROPS_MARK);
527 }
528
529 static inline bool
530 _hb_glyph_info_substituted (const hb_glyph_info_t *info)
531 {
532   return !!(info->glyph_props() & HB_OT_LAYOUT_GLYPH_PROPS_SUBSTITUTED);
533 }
534
535 static inline bool
536 _hb_glyph_info_ligated (const hb_glyph_info_t *info)
537 {
538   return !!(info->glyph_props() & HB_OT_LAYOUT_GLYPH_PROPS_LIGATED);
539 }
540
541 static inline bool
542 _hb_glyph_info_multiplied (const hb_glyph_info_t *info)
543 {
544   return !!(info->glyph_props() & HB_OT_LAYOUT_GLYPH_PROPS_MULTIPLIED);
545 }
546
547 static inline bool
548 _hb_glyph_info_ligated_and_didnt_multiply (const hb_glyph_info_t *info)
549 {
550   return _hb_glyph_info_ligated (info) && !_hb_glyph_info_multiplied (info);
551 }
552
553 static inline void
554 _hb_glyph_info_clear_ligated_and_multiplied (hb_glyph_info_t *info)
555 {
556   info->glyph_props() &= ~(HB_OT_LAYOUT_GLYPH_PROPS_LIGATED |
557                            HB_OT_LAYOUT_GLYPH_PROPS_MULTIPLIED);
558 }
559
560 static inline void
561 _hb_glyph_info_clear_substituted (hb_glyph_info_t *info)
562 {
563   info->glyph_props() &= ~(HB_OT_LAYOUT_GLYPH_PROPS_SUBSTITUTED);
564 }
565
566
567 /* Allocation / deallocation. */
568
569 static inline void
570 _hb_buffer_allocate_unicode_vars (hb_buffer_t *buffer)
571 {
572   HB_BUFFER_ALLOCATE_VAR (buffer, unicode_props);
573 }
574
575 static inline void
576 _hb_buffer_deallocate_unicode_vars (hb_buffer_t *buffer)
577 {
578   HB_BUFFER_DEALLOCATE_VAR (buffer, unicode_props);
579 }
580
581 static inline void
582 _hb_buffer_assert_unicode_vars (hb_buffer_t *buffer)
583 {
584   HB_BUFFER_ASSERT_VAR (buffer, unicode_props);
585 }
586
587 static inline void
588 _hb_buffer_allocate_gsubgpos_vars (hb_buffer_t *buffer)
589 {
590   HB_BUFFER_ALLOCATE_VAR (buffer, glyph_props);
591   HB_BUFFER_ALLOCATE_VAR (buffer, lig_props);
592   HB_BUFFER_ALLOCATE_VAR (buffer, syllable);
593 }
594
595 static inline void
596 _hb_buffer_deallocate_gsubgpos_vars (hb_buffer_t *buffer)
597 {
598   HB_BUFFER_DEALLOCATE_VAR (buffer, syllable);
599   HB_BUFFER_DEALLOCATE_VAR (buffer, lig_props);
600   HB_BUFFER_DEALLOCATE_VAR (buffer, glyph_props);
601 }
602
603 static inline void
604 _hb_buffer_assert_gsubgpos_vars (hb_buffer_t *buffer)
605 {
606   HB_BUFFER_ASSERT_VAR (buffer, glyph_props);
607   HB_BUFFER_ASSERT_VAR (buffer, lig_props);
608   HB_BUFFER_ASSERT_VAR (buffer, syllable);
609 }
610
611 /* Make sure no one directly touches our props... */
612 #undef unicode_props0
613 #undef unicode_props1
614 #undef lig_props
615 #undef glyph_props
616
617
618 #endif /* HB_OT_LAYOUT_PRIVATE_HH */