Mercurial > hgrepos > Python2 > PyMuPDF
comparison mupdf-source/thirdparty/harfbuzz/src/OT/glyf/composite-iter.hh @ 2:b50eed0cc0ef upstream
ADD: MuPDF v1.26.7: the MuPDF source as downloaded by a default build of PyMuPDF 1.26.4.
The directory name has changed: no version number in the expanded directory now.
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Mon, 15 Sep 2025 11:43:07 +0200 |
| parents | |
| children |
comparison
equal
deleted
inserted
replaced
| 1:1d09e1dec1d9 | 2:b50eed0cc0ef |
|---|---|
| 1 #ifndef OT_GLYF_COMPOSITE_ITER_HH | |
| 2 #define OT_GLYF_COMPOSITE_ITER_HH | |
| 3 | |
| 4 | |
| 5 #include "../../hb.hh" | |
| 6 | |
| 7 | |
| 8 namespace OT { | |
| 9 namespace glyf_impl { | |
| 10 | |
| 11 | |
| 12 template <typename CompositeGlyphRecord> | |
| 13 struct composite_iter_tmpl : hb_iter_with_fallback_t<composite_iter_tmpl<CompositeGlyphRecord>, | |
| 14 const CompositeGlyphRecord &> | |
| 15 { | |
| 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) | |
| 19 { | |
| 20 set_current (current_); | |
| 21 } | |
| 22 | |
| 23 composite_iter_tmpl () : glyph (hb_bytes_t ()), current (nullptr), current_size (0) {} | |
| 24 | |
| 25 const CompositeGlyphRecord & __item__ () const { return *current; } | |
| 26 bool __more__ () const { return current; } | |
| 27 void __next__ () | |
| 28 { | |
| 29 if (!current->has_more ()) { current = nullptr; return; } | |
| 30 | |
| 31 set_current (&StructAtOffset<CompositeGlyphRecord> (current, current_size)); | |
| 32 } | |
| 33 composite_iter_tmpl __end__ () const { return composite_iter_tmpl (); } | |
| 34 bool operator != (const composite_iter_tmpl& o) const | |
| 35 { return current != o.current; } | |
| 36 | |
| 37 | |
| 38 void set_current (__item_t__ current_) | |
| 39 { | |
| 40 if (!glyph.check_range (current_, CompositeGlyphRecord::min_size)) | |
| 41 { | |
| 42 current = nullptr; | |
| 43 current_size = 0; | |
| 44 return; | |
| 45 } | |
| 46 unsigned size = current_->get_size (); | |
| 47 if (!glyph.check_range (current_, size)) | |
| 48 { | |
| 49 current = nullptr; | |
| 50 current_size = 0; | |
| 51 return; | |
| 52 } | |
| 53 | |
| 54 current = current_; | |
| 55 current_size = size; | |
| 56 } | |
| 57 | |
| 58 private: | |
| 59 hb_bytes_t glyph; | |
| 60 __item_t__ current; | |
| 61 unsigned current_size; | |
| 62 }; | |
| 63 | |
| 64 | |
| 65 } /* namespace glyf_impl */ | |
| 66 } /* namespace OT */ | |
| 67 | |
| 68 #endif /* OT_GLYF_COMPOSITE_ITER_HH */ |
