Mercurial > hgrepos > Python2 > PyMuPDF
comparison mupdf-source/thirdparty/harfbuzz/src/hb-ot-layout-gsub-table.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 /* | |
| 2 * Copyright © 2007,2008,2009,2010 Red Hat, Inc. | |
| 3 * Copyright © 2010,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_GSUB_TABLE_HH | |
| 30 #define HB_OT_LAYOUT_GSUB_TABLE_HH | |
| 31 | |
| 32 #include "OT/Layout/GSUB/GSUB.hh" | |
| 33 | |
| 34 namespace OT { | |
| 35 namespace Layout { | |
| 36 namespace GSUB_impl { | |
| 37 | |
| 38 // TODO(garretrieger): Move into the new layout directory. | |
| 39 /* Out-of-class implementation for methods recursing */ | |
| 40 | |
| 41 #ifndef HB_NO_OT_LAYOUT | |
| 42 /*static*/ inline bool ExtensionSubst::is_reverse () const | |
| 43 { | |
| 44 return SubstLookup::lookup_type_is_reverse (get_type ()); | |
| 45 } | |
| 46 template <typename context_t> | |
| 47 /*static*/ typename context_t::return_t SubstLookup::dispatch_recurse_func (context_t *c, unsigned int lookup_index) | |
| 48 { | |
| 49 const SubstLookup &l = c->face->table.GSUB.get_relaxed ()->table->get_lookup (lookup_index); | |
| 50 return l.dispatch (c); | |
| 51 } | |
| 52 | |
| 53 /*static*/ typename hb_closure_context_t::return_t SubstLookup::closure_glyphs_recurse_func (hb_closure_context_t *c, unsigned lookup_index, hb_set_t *covered_seq_indices, unsigned seq_index, unsigned end_index) | |
| 54 { | |
| 55 const SubstLookup &l = c->face->table.GSUB.get_relaxed ()->table->get_lookup (lookup_index); | |
| 56 if (l.may_have_non_1to1 ()) | |
| 57 hb_set_add_range (covered_seq_indices, seq_index, end_index); | |
| 58 return l.dispatch (c); | |
| 59 } | |
| 60 | |
| 61 template <> | |
| 62 inline hb_closure_lookups_context_t::return_t | |
| 63 SubstLookup::dispatch_recurse_func<hb_closure_lookups_context_t> (hb_closure_lookups_context_t *c, unsigned this_index) | |
| 64 { | |
| 65 const SubstLookup &l = c->face->table.GSUB.get_relaxed ()->table->get_lookup (this_index); | |
| 66 return l.closure_lookups (c, this_index); | |
| 67 } | |
| 68 | |
| 69 template <> | |
| 70 inline bool SubstLookup::dispatch_recurse_func<hb_ot_apply_context_t> (hb_ot_apply_context_t *c, unsigned int lookup_index) | |
| 71 { | |
| 72 const SubstLookup &l = c->face->table.GSUB.get_relaxed ()->table->get_lookup (lookup_index); | |
| 73 unsigned int saved_lookup_props = c->lookup_props; | |
| 74 unsigned int saved_lookup_index = c->lookup_index; | |
| 75 c->set_lookup_index (lookup_index); | |
| 76 c->set_lookup_props (l.get_props ()); | |
| 77 bool ret = l.dispatch (c); | |
| 78 c->set_lookup_index (saved_lookup_index); | |
| 79 c->set_lookup_props (saved_lookup_props); | |
| 80 return ret; | |
| 81 } | |
| 82 #endif | |
| 83 | |
| 84 } /* namespace GSUB_impl */ | |
| 85 } /* namespace Layout */ | |
| 86 } /* namespace OT */ | |
| 87 | |
| 88 | |
| 89 #endif /* HB_OT_LAYOUT_GSUB_TABLE_HH */ |
