1 #ifndef OT_GLYF_COMPOSITE_ITER_HH
2 #define OT_GLYF_COMPOSITE_ITER_HH
12 template <typename CompositeGlyphRecord>
13 struct composite_iter_tmpl : hb_iter_with_fallback_t<composite_iter_tmpl<CompositeGlyphRecord>,
14 const CompositeGlyphRecord &>
16 typedef const CompositeGlyphRecord *__item_t__;
17 composite_iter_tmpl (hb_bytes_t glyph_, __item_t__ current_) :
18 glyph (glyph_), current (nullptr), current_size (0)
20 set_current (current_);
23 composite_iter_tmpl () : glyph (hb_bytes_t ()), current (nullptr), current_size (0) {}
25 const CompositeGlyphRecord & __item__ () const { return *current; }
26 bool __more__ () const { return current; }
29 if (!current->has_more ()) { current = nullptr; return; }
31 set_current (&StructAtOffset<CompositeGlyphRecord> (current, current_size));
33 composite_iter_tmpl __end__ () const { return composite_iter_tmpl (); }
34 bool operator != (const composite_iter_tmpl& o) const
35 { return current != o.current; }
38 void set_current (__item_t__ current_)
40 if (!glyph.check_range (current_, CompositeGlyphRecord::min_size))
46 unsigned size = current_->get_size ();
47 if (!glyph.check_range (current_, size))
61 unsigned current_size;
65 } /* namespace glyf_impl */
68 #endif /* OT_GLYF_COMPOSITE_ITER_HH */