/src/harfbuzz/src/hb-ot-layout-gsubgpos.hh
Line | Count | Source |
1 | | /* |
2 | | * Copyright © 2007,2008,2009,2010 Red Hat, Inc. |
3 | | * Copyright © 2010,2012 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_GSUBGPOS_HH |
30 | | #define HB_OT_LAYOUT_GSUBGPOS_HH |
31 | | |
32 | | #include "hb.hh" |
33 | | #include "hb-buffer.hh" |
34 | | #include "hb-map.hh" |
35 | | #include "hb-set.hh" |
36 | | #include "hb-ot-map.hh" |
37 | | #include "hb-ot-layout-common.hh" |
38 | | #include "hb-ot-layout-gdef-table.hh" |
39 | | |
40 | | |
41 | | namespace OT { |
42 | | |
43 | | |
44 | | struct hb_intersects_context_t : |
45 | | hb_dispatch_context_t<hb_intersects_context_t, bool> |
46 | | { |
47 | | template <typename T> |
48 | 0 | return_t dispatch (const T &obj) { return obj.intersects (this->glyphs); }Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::Layout::GPOS_impl::SinglePosFormat1>(OT::Layout::GPOS_impl::SinglePosFormat1 const&) Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::Layout::GPOS_impl::SinglePosFormat2>(OT::Layout::GPOS_impl::SinglePosFormat2 const&) Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::SmallTypes> const&) Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::SmallTypes> const&) Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::MediumTypes> const&) Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::MediumTypes> const&) Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::Layout::GPOS_impl::CursivePosFormat1>(OT::Layout::GPOS_impl::CursivePosFormat1 const&) Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::SmallTypes> const&) Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::MediumTypes> const&) Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::SmallTypes> const&) Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::MediumTypes> const&) Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::SmallTypes> const&) Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::MediumTypes> const&) Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::ContextFormat1_4<OT::Layout::SmallTypes> >(OT::ContextFormat1_4<OT::Layout::SmallTypes> const&) Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::ContextFormat2_5<OT::Layout::SmallTypes> >(OT::ContextFormat2_5<OT::Layout::SmallTypes> const&) Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::ContextFormat3>(OT::ContextFormat3 const&) Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::ContextFormat1_4<OT::Layout::MediumTypes> >(OT::ContextFormat1_4<OT::Layout::MediumTypes> const&) Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::ContextFormat2_5<OT::Layout::MediumTypes> >(OT::ContextFormat2_5<OT::Layout::MediumTypes> const&) Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::ChainContextFormat1_4<OT::Layout::SmallTypes> >(OT::ChainContextFormat1_4<OT::Layout::SmallTypes> const&) Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::ChainContextFormat2_5<OT::Layout::SmallTypes> >(OT::ChainContextFormat2_5<OT::Layout::SmallTypes> const&) Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::ChainContextFormat3>(OT::ChainContextFormat3 const&) Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::ChainContextFormat1_4<OT::Layout::MediumTypes> >(OT::ChainContextFormat1_4<OT::Layout::MediumTypes> const&) Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::ChainContextFormat2_5<OT::Layout::MediumTypes> >(OT::ChainContextFormat2_5<OT::Layout::MediumTypes> const&) Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> const&) Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> const&) Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> const&) Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> const&) Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::SmallTypes> const&) Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> const&) Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::SmallTypes> const&) Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> const&) Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::SmallTypes> const&) Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::MediumTypes> const&) Unexecuted instantiation: bool OT::hb_intersects_context_t::dispatch<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1>(OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1 const&) |
49 | 0 | static return_t default_return_value () { return false; } |
50 | 0 | bool stop_sublookup_iteration (return_t r) const { return r; } |
51 | | |
52 | | const hb_set_t *glyphs; |
53 | | |
54 | | hb_intersects_context_t (const hb_set_t *glyphs_) : |
55 | 0 | glyphs (glyphs_) {} |
56 | | }; |
57 | | |
58 | | struct hb_have_non_1to1_context_t : |
59 | | hb_dispatch_context_t<hb_have_non_1to1_context_t, bool> |
60 | | { |
61 | | template <typename T> |
62 | 0 | return_t dispatch (const T &obj) { return obj.may_have_non_1to1 (); }Unexecuted instantiation: bool OT::hb_have_non_1to1_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> const&) Unexecuted instantiation: bool OT::hb_have_non_1to1_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> const&) Unexecuted instantiation: bool OT::hb_have_non_1to1_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> const&) Unexecuted instantiation: bool OT::hb_have_non_1to1_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> const&) Unexecuted instantiation: bool OT::hb_have_non_1to1_context_t::dispatch<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::SmallTypes> const&) Unexecuted instantiation: bool OT::hb_have_non_1to1_context_t::dispatch<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> const&) Unexecuted instantiation: bool OT::hb_have_non_1to1_context_t::dispatch<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::SmallTypes> const&) Unexecuted instantiation: bool OT::hb_have_non_1to1_context_t::dispatch<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> const&) Unexecuted instantiation: bool OT::hb_have_non_1to1_context_t::dispatch<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::SmallTypes> const&) Unexecuted instantiation: bool OT::hb_have_non_1to1_context_t::dispatch<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::MediumTypes> const&) Unexecuted instantiation: bool OT::hb_have_non_1to1_context_t::dispatch<OT::ContextFormat1_4<OT::Layout::SmallTypes> >(OT::ContextFormat1_4<OT::Layout::SmallTypes> const&) Unexecuted instantiation: bool OT::hb_have_non_1to1_context_t::dispatch<OT::ContextFormat2_5<OT::Layout::SmallTypes> >(OT::ContextFormat2_5<OT::Layout::SmallTypes> const&) Unexecuted instantiation: bool OT::hb_have_non_1to1_context_t::dispatch<OT::ContextFormat3>(OT::ContextFormat3 const&) Unexecuted instantiation: bool OT::hb_have_non_1to1_context_t::dispatch<OT::ContextFormat1_4<OT::Layout::MediumTypes> >(OT::ContextFormat1_4<OT::Layout::MediumTypes> const&) Unexecuted instantiation: bool OT::hb_have_non_1to1_context_t::dispatch<OT::ContextFormat2_5<OT::Layout::MediumTypes> >(OT::ContextFormat2_5<OT::Layout::MediumTypes> const&) Unexecuted instantiation: bool OT::hb_have_non_1to1_context_t::dispatch<OT::ChainContextFormat1_4<OT::Layout::SmallTypes> >(OT::ChainContextFormat1_4<OT::Layout::SmallTypes> const&) Unexecuted instantiation: bool OT::hb_have_non_1to1_context_t::dispatch<OT::ChainContextFormat2_5<OT::Layout::SmallTypes> >(OT::ChainContextFormat2_5<OT::Layout::SmallTypes> const&) Unexecuted instantiation: bool OT::hb_have_non_1to1_context_t::dispatch<OT::ChainContextFormat3>(OT::ChainContextFormat3 const&) Unexecuted instantiation: bool OT::hb_have_non_1to1_context_t::dispatch<OT::ChainContextFormat1_4<OT::Layout::MediumTypes> >(OT::ChainContextFormat1_4<OT::Layout::MediumTypes> const&) Unexecuted instantiation: bool OT::hb_have_non_1to1_context_t::dispatch<OT::ChainContextFormat2_5<OT::Layout::MediumTypes> >(OT::ChainContextFormat2_5<OT::Layout::MediumTypes> const&) Unexecuted instantiation: bool OT::hb_have_non_1to1_context_t::dispatch<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1>(OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1 const&) |
63 | 0 | static return_t default_return_value () { return false; } |
64 | 0 | bool stop_sublookup_iteration (return_t r) const { return r; } |
65 | | }; |
66 | | |
67 | | struct hb_closure_context_t : |
68 | | hb_dispatch_context_t<hb_closure_context_t> |
69 | | { |
70 | | typedef return_t (*recurse_func_t) (hb_closure_context_t *c, unsigned lookup_index, hb_set_t *covered_seq_indicies, unsigned seq_index, unsigned end_index); |
71 | | template <typename T> |
72 | 0 | return_t dispatch (const T &obj) { obj.closure (this); return hb_empty_t (); }Unexecuted instantiation: hb_empty_t OT::hb_closure_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_context_t::dispatch<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::SmallTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_context_t::dispatch<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_context_t::dispatch<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::SmallTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_context_t::dispatch<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_context_t::dispatch<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::SmallTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_context_t::dispatch<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::MediumTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_context_t::dispatch<OT::ContextFormat1_4<OT::Layout::SmallTypes> >(OT::ContextFormat1_4<OT::Layout::SmallTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_context_t::dispatch<OT::ContextFormat2_5<OT::Layout::SmallTypes> >(OT::ContextFormat2_5<OT::Layout::SmallTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_context_t::dispatch<OT::ContextFormat3>(OT::ContextFormat3 const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_context_t::dispatch<OT::ContextFormat1_4<OT::Layout::MediumTypes> >(OT::ContextFormat1_4<OT::Layout::MediumTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_context_t::dispatch<OT::ContextFormat2_5<OT::Layout::MediumTypes> >(OT::ContextFormat2_5<OT::Layout::MediumTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_context_t::dispatch<OT::ChainContextFormat1_4<OT::Layout::SmallTypes> >(OT::ChainContextFormat1_4<OT::Layout::SmallTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_context_t::dispatch<OT::ChainContextFormat2_5<OT::Layout::SmallTypes> >(OT::ChainContextFormat2_5<OT::Layout::SmallTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_context_t::dispatch<OT::ChainContextFormat3>(OT::ChainContextFormat3 const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_context_t::dispatch<OT::ChainContextFormat1_4<OT::Layout::MediumTypes> >(OT::ChainContextFormat1_4<OT::Layout::MediumTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_context_t::dispatch<OT::ChainContextFormat2_5<OT::Layout::MediumTypes> >(OT::ChainContextFormat2_5<OT::Layout::MediumTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_context_t::dispatch<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1>(OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1 const&) |
73 | 0 | static return_t default_return_value () { return hb_empty_t (); } |
74 | | void recurse (unsigned lookup_index, hb_set_t *covered_seq_indicies, unsigned seq_index, unsigned end_index) |
75 | 0 | { |
76 | 0 | if (unlikely (nesting_level_left == 0 || !recurse_func)) |
77 | 0 | return; |
78 | | |
79 | 0 | nesting_level_left--; |
80 | 0 | recurse_func (this, lookup_index, covered_seq_indicies, seq_index, end_index); |
81 | 0 | nesting_level_left++; |
82 | 0 | } |
83 | | |
84 | | void reset_lookup_visit_count () |
85 | 0 | { lookup_count = 0; } |
86 | | |
87 | | bool lookup_limit_exceeded () |
88 | 0 | { return lookup_count > HB_MAX_LOOKUP_VISIT_COUNT; } |
89 | | |
90 | | bool should_visit_lookup (unsigned int lookup_index) |
91 | 0 | { |
92 | 0 | if (lookup_count++ > HB_MAX_LOOKUP_VISIT_COUNT) |
93 | 0 | return false; |
94 | | |
95 | 0 | if (is_lookup_done (lookup_index)) |
96 | 0 | return false; |
97 | | |
98 | 0 | return true; |
99 | 0 | } |
100 | | |
101 | | bool is_lookup_done (unsigned int lookup_index) |
102 | 0 | { |
103 | 0 | if (unlikely (done_lookups_glyph_count->in_error () || |
104 | 0 | done_lookups_glyph_set->in_error ())) |
105 | 0 | return true; |
106 | | |
107 | | /* Have we visited this lookup with the current set of glyphs? */ |
108 | 0 | if (done_lookups_glyph_count->get (lookup_index) != glyphs->get_population ()) |
109 | 0 | { |
110 | 0 | done_lookups_glyph_count->set (lookup_index, glyphs->get_population ()); |
111 | |
|
112 | 0 | if (!done_lookups_glyph_set->has (lookup_index)) |
113 | 0 | { |
114 | 0 | if (unlikely (!done_lookups_glyph_set->set (lookup_index, hb::unique_ptr<hb_set_t> {hb_set_create ()}))) |
115 | 0 | return true; |
116 | 0 | } |
117 | | |
118 | 0 | done_lookups_glyph_set->get (lookup_index)->clear (); |
119 | 0 | } |
120 | | |
121 | 0 | hb_set_t *covered_glyph_set = done_lookups_glyph_set->get (lookup_index); |
122 | 0 | if (unlikely (covered_glyph_set->in_error ())) |
123 | 0 | return true; |
124 | 0 | if (parent_active_glyphs ().is_subset (*covered_glyph_set)) |
125 | 0 | return true; |
126 | | |
127 | 0 | covered_glyph_set->union_ (parent_active_glyphs ()); |
128 | 0 | return false; |
129 | 0 | } |
130 | | |
131 | 0 | const hb_set_t& previous_parent_active_glyphs () { |
132 | 0 | if (active_glyphs_stack.length <= 1) |
133 | 0 | return *glyphs; |
134 | | |
135 | 0 | return active_glyphs_stack[active_glyphs_stack.length - 2]; |
136 | 0 | } |
137 | | |
138 | | const hb_set_t& parent_active_glyphs () |
139 | 0 | { |
140 | 0 | if (!active_glyphs_stack) |
141 | 0 | return *glyphs; |
142 | | |
143 | 0 | return active_glyphs_stack.tail (); |
144 | 0 | } |
145 | | |
146 | | hb_set_t* push_cur_active_glyphs () |
147 | 0 | { |
148 | 0 | hb_set_t *s = active_glyphs_stack.push (); |
149 | 0 | if (unlikely (active_glyphs_stack.in_error ())) |
150 | 0 | return nullptr; |
151 | 0 | return s; |
152 | 0 | } |
153 | | |
154 | | bool pop_cur_done_glyphs () |
155 | 0 | { |
156 | 0 | if (!active_glyphs_stack) |
157 | 0 | return false; |
158 | | |
159 | 0 | active_glyphs_stack.pop (); |
160 | 0 | return true; |
161 | 0 | } |
162 | | |
163 | | hb_face_t *face; |
164 | | hb_set_t *glyphs; |
165 | | hb_set_t output[1]; |
166 | | hb_vector_t<hb_set_t> active_glyphs_stack; |
167 | | recurse_func_t recurse_func = nullptr; |
168 | | unsigned int nesting_level_left; |
169 | | |
170 | | hb_closure_context_t (hb_face_t *face_, |
171 | | hb_set_t *glyphs_, |
172 | | hb_map_t *done_lookups_glyph_count_, |
173 | | hb_hashmap_t<unsigned, hb::unique_ptr<hb_set_t>> *done_lookups_glyph_set_, |
174 | | unsigned int nesting_level_left_ = HB_MAX_NESTING_LEVEL) : |
175 | 0 | face (face_), |
176 | 0 | glyphs (glyphs_), |
177 | 0 | nesting_level_left (nesting_level_left_), |
178 | 0 | done_lookups_glyph_count (done_lookups_glyph_count_), |
179 | 0 | done_lookups_glyph_set (done_lookups_glyph_set_) |
180 | 0 | {} |
181 | | |
182 | 0 | ~hb_closure_context_t () { flush (); } |
183 | | |
184 | 0 | void set_recurse_func (recurse_func_t func) { recurse_func = func; } |
185 | | |
186 | | void flush () |
187 | 0 | { |
188 | 0 | output->del_range (face->get_num_glyphs (), HB_SET_VALUE_INVALID); /* Remove invalid glyphs. */ |
189 | 0 | glyphs->union_ (*output); |
190 | 0 | output->clear (); |
191 | 0 | active_glyphs_stack.pop (); |
192 | 0 | active_glyphs_stack.reset (); |
193 | 0 | } |
194 | | |
195 | | private: |
196 | | hb_map_t *done_lookups_glyph_count; |
197 | | hb_hashmap_t<unsigned, hb::unique_ptr<hb_set_t>> *done_lookups_glyph_set; |
198 | | unsigned int lookup_count = 0; |
199 | | }; |
200 | | |
201 | | |
202 | | |
203 | | struct hb_closure_lookups_context_t : |
204 | | hb_dispatch_context_t<hb_closure_lookups_context_t> |
205 | | { |
206 | | typedef return_t (*recurse_func_t) (hb_closure_lookups_context_t *c, unsigned lookup_index); |
207 | | template <typename T> |
208 | 0 | return_t dispatch (const T &obj) { obj.closure_lookups (this); return hb_empty_t (); }Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GPOS_impl::SinglePosFormat1>(OT::Layout::GPOS_impl::SinglePosFormat1 const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GPOS_impl::SinglePosFormat2>(OT::Layout::GPOS_impl::SinglePosFormat2 const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::SmallTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::SmallTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::MediumTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::MediumTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GPOS_impl::CursivePosFormat1>(OT::Layout::GPOS_impl::CursivePosFormat1 const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::SmallTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::MediumTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::SmallTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::MediumTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::SmallTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::MediumTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::ContextFormat1_4<OT::Layout::SmallTypes> >(OT::ContextFormat1_4<OT::Layout::SmallTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::ContextFormat2_5<OT::Layout::SmallTypes> >(OT::ContextFormat2_5<OT::Layout::SmallTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::ContextFormat3>(OT::ContextFormat3 const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::ContextFormat1_4<OT::Layout::MediumTypes> >(OT::ContextFormat1_4<OT::Layout::MediumTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::ContextFormat2_5<OT::Layout::MediumTypes> >(OT::ContextFormat2_5<OT::Layout::MediumTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::ChainContextFormat1_4<OT::Layout::SmallTypes> >(OT::ChainContextFormat1_4<OT::Layout::SmallTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::ChainContextFormat2_5<OT::Layout::SmallTypes> >(OT::ChainContextFormat2_5<OT::Layout::SmallTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::ChainContextFormat3>(OT::ChainContextFormat3 const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::ChainContextFormat1_4<OT::Layout::MediumTypes> >(OT::ChainContextFormat1_4<OT::Layout::MediumTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::ChainContextFormat2_5<OT::Layout::MediumTypes> >(OT::ChainContextFormat2_5<OT::Layout::MediumTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::SmallTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::SmallTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::SmallTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::MediumTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_closure_lookups_context_t::dispatch<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1>(OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1 const&) |
209 | 0 | static return_t default_return_value () { return hb_empty_t (); } |
210 | | void recurse (unsigned lookup_index) |
211 | 0 | { |
212 | 0 | if (unlikely (nesting_level_left == 0 || !recurse_func)) |
213 | 0 | return; |
214 | 0 |
|
215 | 0 | /* Return if new lookup was recursed to before. */ |
216 | 0 | if (lookup_limit_exceeded () |
217 | 0 | || visited_lookups->in_error () |
218 | 0 | || visited_lookups->has (lookup_index)) |
219 | 0 | // Don't increment lookup count here, that will be done in the call to closure_lookups() |
220 | 0 | // made by recurse_func. |
221 | 0 | return; |
222 | 0 |
|
223 | 0 | nesting_level_left--; |
224 | 0 | recurse_func (this, lookup_index); |
225 | 0 | nesting_level_left++; |
226 | 0 | } |
227 | | |
228 | | void set_lookup_visited (unsigned lookup_index) |
229 | 0 | { visited_lookups->add (lookup_index); } |
230 | | |
231 | | void set_lookup_inactive (unsigned lookup_index) |
232 | 0 | { inactive_lookups->add (lookup_index); } |
233 | | |
234 | | bool lookup_limit_exceeded () |
235 | 0 | { |
236 | 0 | bool ret = lookup_count > HB_MAX_LOOKUP_VISIT_COUNT; |
237 | 0 | if (ret) |
238 | 0 | DEBUG_MSG (SUBSET, nullptr, "lookup visit count limit exceeded in lookup closure!"); |
239 | 0 | return ret; } |
240 | | |
241 | | bool is_lookup_visited (unsigned lookup_index) |
242 | 0 | { |
243 | 0 | if (unlikely (lookup_count++ > HB_MAX_LOOKUP_VISIT_COUNT)) |
244 | 0 | { |
245 | 0 | DEBUG_MSG (SUBSET, nullptr, "total visited lookup count %u exceeds max limit, lookup %u is dropped.", |
246 | 0 | lookup_count, lookup_index); |
247 | 0 | return true; |
248 | 0 | } |
249 | 0 |
|
250 | 0 | if (unlikely (visited_lookups->in_error ())) |
251 | 0 | return true; |
252 | 0 |
|
253 | 0 | return visited_lookups->has (lookup_index); |
254 | 0 | } |
255 | | |
256 | | hb_face_t *face; |
257 | | const hb_set_t *glyphs; |
258 | | recurse_func_t recurse_func; |
259 | | unsigned int nesting_level_left; |
260 | | |
261 | | hb_closure_lookups_context_t (hb_face_t *face_, |
262 | | const hb_set_t *glyphs_, |
263 | | hb_set_t *visited_lookups_, |
264 | | hb_set_t *inactive_lookups_, |
265 | | unsigned nesting_level_left_ = HB_MAX_NESTING_LEVEL) : |
266 | | face (face_), |
267 | | glyphs (glyphs_), |
268 | | recurse_func (nullptr), |
269 | | nesting_level_left (nesting_level_left_), |
270 | | visited_lookups (visited_lookups_), |
271 | | inactive_lookups (inactive_lookups_), |
272 | 0 | lookup_count (0) {} |
273 | | |
274 | 0 | void set_recurse_func (recurse_func_t func) { recurse_func = func; } |
275 | | |
276 | | private: |
277 | | hb_set_t *visited_lookups; |
278 | | hb_set_t *inactive_lookups; |
279 | | unsigned int lookup_count; |
280 | | }; |
281 | | |
282 | | struct hb_would_apply_context_t : |
283 | | hb_dispatch_context_t<hb_would_apply_context_t, bool> |
284 | | { |
285 | | template <typename T> |
286 | 0 | return_t dispatch (const T &obj) { return obj.would_apply (this); }Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> const&) Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> const&) Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> const&) Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> const&) Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::SmallTypes> const&) Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> const&) Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::SmallTypes> const&) Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> const&) Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::SmallTypes> const&) Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::MediumTypes> const&) Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::ContextFormat1_4<OT::Layout::SmallTypes> >(OT::ContextFormat1_4<OT::Layout::SmallTypes> const&) Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::ContextFormat2_5<OT::Layout::SmallTypes> >(OT::ContextFormat2_5<OT::Layout::SmallTypes> const&) Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::ContextFormat3>(OT::ContextFormat3 const&) Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::ContextFormat1_4<OT::Layout::MediumTypes> >(OT::ContextFormat1_4<OT::Layout::MediumTypes> const&) Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::ContextFormat2_5<OT::Layout::MediumTypes> >(OT::ContextFormat2_5<OT::Layout::MediumTypes> const&) Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::ChainContextFormat1_4<OT::Layout::SmallTypes> >(OT::ChainContextFormat1_4<OT::Layout::SmallTypes> const&) Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::ChainContextFormat2_5<OT::Layout::SmallTypes> >(OT::ChainContextFormat2_5<OT::Layout::SmallTypes> const&) Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::ChainContextFormat3>(OT::ChainContextFormat3 const&) Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::ChainContextFormat1_4<OT::Layout::MediumTypes> >(OT::ChainContextFormat1_4<OT::Layout::MediumTypes> const&) Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::ChainContextFormat2_5<OT::Layout::MediumTypes> >(OT::ChainContextFormat2_5<OT::Layout::MediumTypes> const&) Unexecuted instantiation: bool OT::hb_would_apply_context_t::dispatch<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1>(OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1 const&) |
287 | 0 | static return_t default_return_value () { return false; } |
288 | 0 | bool stop_sublookup_iteration (return_t r) const { return r; } |
289 | | |
290 | | hb_face_t *face; |
291 | | const hb_codepoint_t *glyphs; |
292 | | unsigned int len; |
293 | | bool zero_context; |
294 | | |
295 | | hb_would_apply_context_t (hb_face_t *face_, |
296 | | const hb_codepoint_t *glyphs_, |
297 | | unsigned int len_, |
298 | | bool zero_context_) : |
299 | 0 | face (face_), |
300 | 0 | glyphs (glyphs_), |
301 | 0 | len (len_), |
302 | 0 | zero_context (zero_context_) {} |
303 | | }; |
304 | | |
305 | | struct hb_collect_glyphs_context_t : |
306 | | hb_dispatch_context_t<hb_collect_glyphs_context_t> |
307 | | { |
308 | | typedef return_t (*recurse_func_t) (hb_collect_glyphs_context_t *c, unsigned int lookup_index); |
309 | | template <typename T> |
310 | 0 | return_t dispatch (const T &obj) { obj.collect_glyphs (this); return hb_empty_t (); }Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GPOS_impl::SinglePosFormat1>(OT::Layout::GPOS_impl::SinglePosFormat1 const&) Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GPOS_impl::SinglePosFormat2>(OT::Layout::GPOS_impl::SinglePosFormat2 const&) Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::SmallTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::SmallTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::MediumTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::MediumTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GPOS_impl::CursivePosFormat1>(OT::Layout::GPOS_impl::CursivePosFormat1 const&) Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::SmallTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::MediumTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::SmallTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::MediumTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::SmallTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::MediumTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::ContextFormat1_4<OT::Layout::SmallTypes> >(OT::ContextFormat1_4<OT::Layout::SmallTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::ContextFormat2_5<OT::Layout::SmallTypes> >(OT::ContextFormat2_5<OT::Layout::SmallTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::ContextFormat3>(OT::ContextFormat3 const&) Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::ContextFormat1_4<OT::Layout::MediumTypes> >(OT::ContextFormat1_4<OT::Layout::MediumTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::ContextFormat2_5<OT::Layout::MediumTypes> >(OT::ContextFormat2_5<OT::Layout::MediumTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::ChainContextFormat1_4<OT::Layout::SmallTypes> >(OT::ChainContextFormat1_4<OT::Layout::SmallTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::ChainContextFormat2_5<OT::Layout::SmallTypes> >(OT::ChainContextFormat2_5<OT::Layout::SmallTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::ChainContextFormat3>(OT::ChainContextFormat3 const&) Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::ChainContextFormat1_4<OT::Layout::MediumTypes> >(OT::ChainContextFormat1_4<OT::Layout::MediumTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::ChainContextFormat2_5<OT::Layout::MediumTypes> >(OT::ChainContextFormat2_5<OT::Layout::MediumTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::SmallTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::SmallTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::SmallTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::MediumTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_collect_glyphs_context_t::dispatch<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1>(OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1 const&) |
311 | 0 | static return_t default_return_value () { return hb_empty_t (); } |
312 | | void recurse (unsigned int lookup_index) |
313 | 0 | { |
314 | 0 | if (unlikely (nesting_level_left == 0 || !recurse_func)) |
315 | 0 | return; |
316 | | |
317 | | /* Note that GPOS sets recurse_func to nullptr already, so it doesn't get |
318 | | * past the previous check. For GSUB, we only want to collect the output |
319 | | * glyphs in the recursion. If output is not requested, we can go home now. |
320 | | * |
321 | | * Note further, that the above is not exactly correct. A recursed lookup |
322 | | * is allowed to match input that is not matched in the context, but that's |
323 | | * not how most fonts are built. It's possible to relax that and recurse |
324 | | * with all sets here if it proves to be an issue. |
325 | | */ |
326 | | |
327 | 0 | if (output == hb_set_get_empty ()) |
328 | 0 | return; |
329 | | |
330 | | /* Return if new lookup was recursed to before. */ |
331 | 0 | if (recursed_lookups->has (lookup_index)) |
332 | 0 | return; |
333 | | |
334 | 0 | hb_set_t *old_before = before; |
335 | 0 | hb_set_t *old_input = input; |
336 | 0 | hb_set_t *old_after = after; |
337 | 0 | before = input = after = hb_set_get_empty (); |
338 | |
|
339 | 0 | nesting_level_left--; |
340 | 0 | recurse_func (this, lookup_index); |
341 | 0 | nesting_level_left++; |
342 | |
|
343 | 0 | before = old_before; |
344 | 0 | input = old_input; |
345 | 0 | after = old_after; |
346 | |
|
347 | 0 | recursed_lookups->add (lookup_index); |
348 | 0 | } |
349 | | |
350 | | hb_face_t *face; |
351 | | hb_set_t *before; |
352 | | hb_set_t *input; |
353 | | hb_set_t *after; |
354 | | hb_set_t *output; |
355 | | recurse_func_t recurse_func; |
356 | | hb_set_t *recursed_lookups; |
357 | | unsigned int nesting_level_left; |
358 | | |
359 | | hb_collect_glyphs_context_t (hb_face_t *face_, |
360 | | hb_set_t *glyphs_before, /* OUT. May be NULL */ |
361 | | hb_set_t *glyphs_input, /* OUT. May be NULL */ |
362 | | hb_set_t *glyphs_after, /* OUT. May be NULL */ |
363 | | hb_set_t *glyphs_output, /* OUT. May be NULL */ |
364 | | unsigned int nesting_level_left_ = HB_MAX_NESTING_LEVEL) : |
365 | 0 | face (face_), |
366 | 0 | before (glyphs_before ? glyphs_before : hb_set_get_empty ()), |
367 | 0 | input (glyphs_input ? glyphs_input : hb_set_get_empty ()), |
368 | 0 | after (glyphs_after ? glyphs_after : hb_set_get_empty ()), |
369 | 0 | output (glyphs_output ? glyphs_output : hb_set_get_empty ()), |
370 | 0 | recurse_func (nullptr), |
371 | 0 | recursed_lookups (hb_set_create ()), |
372 | 0 | nesting_level_left (nesting_level_left_) {} |
373 | 0 | ~hb_collect_glyphs_context_t () { hb_set_destroy (recursed_lookups); } |
374 | | |
375 | 0 | void set_recurse_func (recurse_func_t func) { recurse_func = func; } |
376 | | }; |
377 | | |
378 | | |
379 | | |
380 | | template <typename set_t> |
381 | | struct hb_collect_coverage_context_t : |
382 | | hb_dispatch_context_t<hb_collect_coverage_context_t<set_t>, const Coverage &> |
383 | | { |
384 | | typedef const Coverage &return_t; // Stoopid that we have to dupe this here. |
385 | | template <typename T> |
386 | | return_t dispatch (const T &obj) { return obj.get_coverage (); } |
387 | | static return_t default_return_value () { return Null (Coverage); } |
388 | | bool stop_sublookup_iteration (return_t r) const |
389 | | { |
390 | | r.collect_coverage (set); |
391 | | return false; |
392 | | } |
393 | | |
394 | | hb_collect_coverage_context_t (set_t *set_) : |
395 | | set (set_) {} |
396 | | |
397 | | set_t *set; |
398 | | }; |
399 | | |
400 | | struct matcher_t |
401 | | { |
402 | | typedef bool (*match_func_t) (hb_glyph_info_t &info, unsigned value, const void *data); |
403 | | |
404 | | template <typename context_t> |
405 | | void init (const context_t *c, bool context_match = false) |
406 | 0 | { |
407 | 0 | set_match_func (nullptr, nullptr); |
408 | 0 | lookup_props = c->lookup_props; |
409 | | /* Ignore ZWNJ if we are matching GPOS, or matching GSUB context and asked to. */ |
410 | 0 | ignore_zwnj = c->table_index == 1 || (context_match && c->auto_zwnj); |
411 | | /* Ignore ZWJ if we are matching context, or asked to. */ |
412 | 0 | ignore_zwj = context_match || c->auto_zwj; |
413 | | /* Ignore hidden glyphs (like CGJ) during GPOS. */ |
414 | 0 | ignore_hidden = c->table_index == 1; |
415 | 0 | mask = context_match ? -1 : c->lookup_mask; |
416 | | /* Per syllable matching is only for GSUB. */ |
417 | 0 | per_syllable = c->table_index == 0 && c->per_syllable; |
418 | 0 | syllable = 0; |
419 | 0 | } |
420 | | |
421 | | void set_match_func (match_func_t match_func_, |
422 | | const void *match_data_) |
423 | 0 | { match_func = match_func_; match_data = match_data_; } |
424 | | |
425 | | enum may_match_t { |
426 | | MATCH_NO, |
427 | | MATCH_YES, |
428 | | MATCH_MAYBE |
429 | | }; |
430 | | |
431 | | #ifndef HB_OPTIMIZE_SIZE |
432 | | HB_ALWAYS_INLINE |
433 | | #endif |
434 | | may_match_t may_match (hb_glyph_info_t &info, |
435 | | hb_codepoint_t glyph_data) const |
436 | 0 | { |
437 | 0 | if (!(info.mask & mask) || |
438 | 0 | (per_syllable && syllable && syllable != info.syllable ())) |
439 | 0 | return MATCH_NO; |
440 | | |
441 | 0 | if (match_func) |
442 | 0 | return match_func (info, glyph_data, match_data) ? MATCH_YES : MATCH_NO; |
443 | | |
444 | 0 | return MATCH_MAYBE; |
445 | 0 | } |
446 | | |
447 | | enum may_skip_t { |
448 | | SKIP_NO, |
449 | | SKIP_YES, |
450 | | SKIP_MAYBE |
451 | | }; |
452 | | |
453 | | template <typename context_t> |
454 | | #ifndef HB_OPTIMIZE_SIZE |
455 | | HB_ALWAYS_INLINE |
456 | | #endif |
457 | | may_skip_t may_skip (const context_t *c, |
458 | | const hb_glyph_info_t &info) const |
459 | 0 | { |
460 | 0 | if (!c->check_glyph_property (&info, lookup_props)) |
461 | 0 | return SKIP_YES; |
462 | | |
463 | 0 | if (unlikely (_hb_glyph_info_is_default_ignorable (&info) && |
464 | 0 | (ignore_zwnj || !_hb_glyph_info_is_zwnj (&info)) && |
465 | 0 | (ignore_zwj || !_hb_glyph_info_is_zwj (&info)) && |
466 | 0 | (ignore_hidden || !_hb_glyph_info_is_hidden (&info)))) |
467 | 0 | return SKIP_MAYBE; |
468 | | |
469 | 0 | return SKIP_NO; |
470 | 0 | } |
471 | | |
472 | | public: |
473 | | unsigned int lookup_props = 0; |
474 | | hb_mask_t mask = -1; |
475 | | bool ignore_zwnj = false; |
476 | | bool ignore_zwj = false; |
477 | | bool ignore_hidden = false; |
478 | | bool per_syllable = false; |
479 | | uint8_t syllable = 0; |
480 | | match_func_t match_func = nullptr; |
481 | | const void *match_data = nullptr; |
482 | | }; |
483 | | |
484 | | template <typename context_t> |
485 | | struct skipping_iterator_t |
486 | | { |
487 | | void init (context_t *c_, bool context_match = false) |
488 | 0 | { |
489 | 0 | c = c_; |
490 | 0 | end = c->buffer->len; |
491 | 0 | match_glyph_data16 = nullptr; |
492 | 0 | #ifndef HB_NO_BEYOND_64K |
493 | 0 | match_glyph_data24 = nullptr; |
494 | 0 | #endif |
495 | 0 | matcher.init (c, context_match); |
496 | 0 | } |
497 | | void set_lookup_props (unsigned int lookup_props) |
498 | 0 | { |
499 | 0 | matcher.lookup_props = lookup_props; |
500 | 0 | } |
501 | | void set_match_func (matcher_t::match_func_t match_func_, |
502 | | const void *match_data_) |
503 | 0 | { |
504 | 0 | matcher.set_match_func (match_func_, match_data_); |
505 | 0 | } |
506 | | void set_glyph_data (const HBUINT16 glyph_data[]) |
507 | 0 | { |
508 | 0 | match_glyph_data16 = glyph_data; |
509 | 0 | #ifndef HB_NO_BEYOND_64K |
510 | 0 | match_glyph_data24 = nullptr; |
511 | 0 | #endif |
512 | 0 | } |
513 | | #ifndef HB_NO_BEYOND_64K |
514 | | void set_glyph_data (const HBUINT24 glyph_data[]) |
515 | 0 | { |
516 | 0 | match_glyph_data16 = nullptr; |
517 | 0 | match_glyph_data24 = glyph_data; |
518 | 0 | } |
519 | | #endif |
520 | | |
521 | | #ifndef HB_OPTIMIZE_SIZE |
522 | | HB_ALWAYS_INLINE |
523 | | #endif |
524 | | void reset (unsigned int start_index_) |
525 | 0 | { |
526 | | // For GSUB forward iterator |
527 | 0 | idx = start_index_; |
528 | 0 | end = c->buffer->len; |
529 | 0 | matcher.syllable = c->buffer->cur().syllable(); |
530 | 0 | } |
531 | | void reset_back (unsigned int start_index_, bool from_out_buffer = false) |
532 | 0 | { |
533 | | // For GSUB backward iterator |
534 | 0 | idx = start_index_; |
535 | 0 | matcher.syllable = c->buffer->cur().syllable(); |
536 | 0 | } |
537 | | |
538 | | #ifndef HB_OPTIMIZE_SIZE |
539 | | HB_ALWAYS_INLINE |
540 | | #endif |
541 | | void reset_fast (unsigned int start_index_) |
542 | 0 | { |
543 | | // Doesn't set end or syllable. Used by GPOS which doesn't care / change. |
544 | 0 | idx = start_index_; |
545 | 0 | } |
546 | | |
547 | | #ifndef HB_OPTIMIZE_SIZE |
548 | | HB_ALWAYS_INLINE |
549 | | #endif |
550 | | matcher_t::may_skip_t may_skip (const hb_glyph_info_t &info) const |
551 | 0 | { return matcher.may_skip (c, info); } |
552 | | |
553 | | enum match_t { |
554 | | MATCH, |
555 | | NOT_MATCH, |
556 | | SKIP |
557 | | }; |
558 | | |
559 | | #ifndef HB_OPTIMIZE_SIZE |
560 | | HB_ALWAYS_INLINE |
561 | | #endif |
562 | | match_t match (hb_glyph_info_t &info) |
563 | 0 | { |
564 | 0 | matcher_t::may_skip_t skip = matcher.may_skip (c, info); |
565 | 0 | if (unlikely (skip == matcher_t::SKIP_YES)) |
566 | 0 | return SKIP; |
567 | | |
568 | 0 | matcher_t::may_match_t match = matcher.may_match (info, get_glyph_data ()); |
569 | 0 | if (match == matcher_t::MATCH_YES || |
570 | 0 | (match == matcher_t::MATCH_MAYBE && |
571 | 0 | skip == matcher_t::SKIP_NO)) |
572 | 0 | return MATCH; |
573 | | |
574 | 0 | if (skip == matcher_t::SKIP_NO) |
575 | 0 | return NOT_MATCH; |
576 | | |
577 | 0 | return SKIP; |
578 | 0 | } |
579 | | |
580 | | #ifndef HB_OPTIMIZE_SIZE |
581 | | HB_ALWAYS_INLINE |
582 | | #endif |
583 | | bool next (unsigned *unsafe_to = nullptr) |
584 | 0 | { |
585 | 0 | const signed stop = (signed) end - 1; |
586 | 0 | while ((signed) idx < stop) |
587 | 0 | { |
588 | 0 | idx++; |
589 | 0 | switch (match (c->buffer->info[idx])) |
590 | 0 | { |
591 | 0 | case MATCH: |
592 | 0 | { |
593 | 0 | advance_glyph_data (); |
594 | 0 | return true; |
595 | 0 | } |
596 | 0 | case NOT_MATCH: |
597 | 0 | { |
598 | 0 | if (unsafe_to) |
599 | 0 | *unsafe_to = idx + 1; |
600 | 0 | return false; |
601 | 0 | } |
602 | 0 | case SKIP: |
603 | 0 | continue; |
604 | 0 | } |
605 | 0 | } |
606 | 0 | if (unsafe_to) |
607 | 0 | *unsafe_to = end; |
608 | 0 | return false; |
609 | 0 | } |
610 | | #ifndef HB_OPTIMIZE_SIZE |
611 | | HB_ALWAYS_INLINE |
612 | | #endif |
613 | | bool prev (unsigned *unsafe_from = nullptr) |
614 | 0 | { |
615 | 0 | const unsigned stop = 0; |
616 | 0 | while (idx > stop) |
617 | 0 | { |
618 | 0 | idx--; |
619 | 0 | switch (match (c->buffer->out_info[idx])) |
620 | 0 | { |
621 | 0 | case MATCH: |
622 | 0 | { |
623 | 0 | advance_glyph_data (); |
624 | 0 | return true; |
625 | 0 | } |
626 | 0 | case NOT_MATCH: |
627 | 0 | { |
628 | 0 | if (unsafe_from) |
629 | 0 | *unsafe_from = hb_max (1u, idx) - 1u; |
630 | 0 | return false; |
631 | 0 | } |
632 | 0 | case SKIP: |
633 | 0 | continue; |
634 | 0 | } |
635 | 0 | } |
636 | 0 | if (unsafe_from) |
637 | 0 | *unsafe_from = 0; |
638 | 0 | return false; |
639 | 0 | } |
640 | | |
641 | | HB_ALWAYS_INLINE |
642 | | hb_codepoint_t |
643 | | get_glyph_data () |
644 | 0 | { |
645 | 0 | if (match_glyph_data16) return *match_glyph_data16; |
646 | 0 | #ifndef HB_NO_BEYOND_64K |
647 | 0 | else |
648 | 0 | if (match_glyph_data24) return *match_glyph_data24; |
649 | 0 | #endif |
650 | 0 | return 0; |
651 | 0 | } |
652 | | HB_ALWAYS_INLINE |
653 | | void |
654 | | advance_glyph_data () |
655 | 0 | { |
656 | 0 | if (match_glyph_data16) match_glyph_data16++; |
657 | 0 | #ifndef HB_NO_BEYOND_64K |
658 | 0 | else |
659 | 0 | if (match_glyph_data24) match_glyph_data24++; |
660 | 0 | #endif |
661 | 0 | } |
662 | | |
663 | | unsigned int idx; |
664 | | protected: |
665 | | context_t *c; |
666 | | matcher_t matcher; |
667 | | const HBUINT16 *match_glyph_data16; |
668 | | #ifndef HB_NO_BEYOND_64K |
669 | | const HBUINT24 *match_glyph_data24; |
670 | | #endif |
671 | | |
672 | | unsigned int end; |
673 | | }; |
674 | | |
675 | | struct hb_ot_apply_context_t : |
676 | | hb_dispatch_context_t<hb_ot_apply_context_t, bool, HB_DEBUG_APPLY> |
677 | | { |
678 | 0 | const char *get_name () { return "APPLY"; } |
679 | | typedef return_t (*recurse_func_t) (hb_ot_apply_context_t *c, unsigned int lookup_index); |
680 | | |
681 | | template <typename T> |
682 | | static inline auto apply_ (const T &obj, hb_ot_apply_context_t *c, hb_priority<1>) HB_RETURN (return_t, obj.apply (c, nullptr) ) |
683 | | template <typename T> |
684 | | static inline auto apply_ (const T &obj, hb_ot_apply_context_t *c, hb_priority<0>) HB_RETURN (return_t, obj.apply (c) ) |
685 | | template <typename T> |
686 | 0 | return_t dispatch (const T &obj) { return apply_(obj, this, hb_prioritize); }Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GPOS_impl::SinglePosFormat1>(OT::Layout::GPOS_impl::SinglePosFormat1 const&) Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GPOS_impl::SinglePosFormat2>(OT::Layout::GPOS_impl::SinglePosFormat2 const&) Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::SmallTypes> const&) Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::SmallTypes> const&) Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::MediumTypes> const&) Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::MediumTypes> const&) Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GPOS_impl::CursivePosFormat1>(OT::Layout::GPOS_impl::CursivePosFormat1 const&) Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::SmallTypes> const&) Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::MediumTypes> const&) Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::SmallTypes> const&) Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::MediumTypes> const&) Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::SmallTypes> const&) Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::MediumTypes> const&) Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::ContextFormat1_4<OT::Layout::SmallTypes> >(OT::ContextFormat1_4<OT::Layout::SmallTypes> const&) Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::ContextFormat2_5<OT::Layout::SmallTypes> >(OT::ContextFormat2_5<OT::Layout::SmallTypes> const&) Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::ContextFormat3>(OT::ContextFormat3 const&) Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::ContextFormat1_4<OT::Layout::MediumTypes> >(OT::ContextFormat1_4<OT::Layout::MediumTypes> const&) Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::ContextFormat2_5<OT::Layout::MediumTypes> >(OT::ContextFormat2_5<OT::Layout::MediumTypes> const&) Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::ChainContextFormat1_4<OT::Layout::SmallTypes> >(OT::ChainContextFormat1_4<OT::Layout::SmallTypes> const&) Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::ChainContextFormat2_5<OT::Layout::SmallTypes> >(OT::ChainContextFormat2_5<OT::Layout::SmallTypes> const&) Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::ChainContextFormat3>(OT::ChainContextFormat3 const&) Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::ChainContextFormat1_4<OT::Layout::MediumTypes> >(OT::ChainContextFormat1_4<OT::Layout::MediumTypes> const&) Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::ChainContextFormat2_5<OT::Layout::MediumTypes> >(OT::ChainContextFormat2_5<OT::Layout::MediumTypes> const&) Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> const&) Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> const&) Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> const&) Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> const&) Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::SmallTypes> const&) Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> const&) Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::SmallTypes> const&) Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> const&) Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::SmallTypes> const&) Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::MediumTypes> const&) Unexecuted instantiation: bool OT::hb_ot_apply_context_t::dispatch<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1>(OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1 const&) |
687 | | |
688 | 0 | static return_t default_return_value () { return false; } |
689 | 0 | bool stop_sublookup_iteration (return_t r) const { return r; } |
690 | | return_t recurse (unsigned int sub_lookup_index) |
691 | 0 | { |
692 | 0 | assert (recurse_func); |
693 | 0 | if (unlikely (nesting_level_left == 0)) |
694 | 0 | { |
695 | 0 | buffer->successful = false; |
696 | 0 | return default_return_value (); |
697 | 0 | } |
698 | | |
699 | 0 | buffer->max_ops--; |
700 | 0 | if (unlikely (buffer->max_ops < 0)) |
701 | 0 | { |
702 | 0 | buffer->successful = false; |
703 | 0 | return default_return_value (); |
704 | 0 | } |
705 | | |
706 | 0 | nesting_level_left--; |
707 | 0 | bool ret = recurse_func (this, sub_lookup_index); |
708 | 0 | nesting_level_left++; |
709 | 0 | return ret; |
710 | 0 | } |
711 | | |
712 | | skipping_iterator_t<hb_ot_apply_context_t> iter_input, iter_context; |
713 | | |
714 | | unsigned int table_index; /* GSUB/GPOS */ |
715 | | hb_font_t *font; |
716 | | hb_face_t *face; |
717 | | hb_buffer_t *buffer; |
718 | | hb_sanitize_context_t sanitizer; |
719 | | recurse_func_t recurse_func = nullptr; |
720 | | const GDEF &gdef; |
721 | | const GDEF::accelerator_t &gdef_accel; |
722 | | const hb_ot_layout_lookup_accelerator_t *lookup_accel = nullptr; |
723 | | const ItemVariationStore &var_store; |
724 | | hb_scalar_cache_t *var_store_cache; |
725 | | |
726 | | hb_direction_t direction; |
727 | | hb_mask_t lookup_mask = 1; |
728 | | unsigned int lookup_index = (unsigned) -1; |
729 | | unsigned int lookup_props = 0; |
730 | | unsigned int nesting_level_left = HB_MAX_NESTING_LEVEL; |
731 | | |
732 | | bool has_glyph_classes; |
733 | | bool auto_zwnj = true; |
734 | | bool auto_zwj = true; |
735 | | bool per_syllable = false; |
736 | | bool random = false; |
737 | | unsigned new_syllables = (unsigned) -1; |
738 | | |
739 | | signed last_base = -1; // GPOS uses |
740 | | unsigned last_base_until = 0; // GPOS uses |
741 | | |
742 | | hb_vector_t<uint32_t> match_positions; |
743 | | uint32_t stack_match_positions[8]; |
744 | | |
745 | | hb_ot_apply_context_t (unsigned int table_index_, |
746 | | hb_font_t *font_, |
747 | | hb_buffer_t *buffer_, |
748 | | hb_blob_t *table_blob_, |
749 | | hb_scalar_cache_t *var_store_cache_ = nullptr) : |
750 | 0 | table_index (table_index_), |
751 | 0 | font (font_), face (font->face), buffer (buffer_), |
752 | 0 | sanitizer (table_blob_), |
753 | | gdef ( |
754 | | #ifndef HB_NO_OT_LAYOUT |
755 | 0 | *face->table.GDEF->table |
756 | | #else |
757 | | Null (GDEF) |
758 | | #endif |
759 | | ), |
760 | | gdef_accel ( |
761 | | #ifndef HB_NO_OT_LAYOUT |
762 | 0 | *face->table.GDEF |
763 | | #else |
764 | | Null (GDEF::accelerator_t) |
765 | | #endif |
766 | | ), |
767 | 0 | var_store (gdef.get_var_store ()), |
768 | 0 | var_store_cache (var_store_cache_), |
769 | 0 | direction (buffer_->props.direction), |
770 | 0 | has_glyph_classes (gdef.has_glyph_classes ()) |
771 | 0 | { |
772 | 0 | init_iters (); |
773 | 0 | match_positions.set_storage (stack_match_positions); |
774 | 0 | } |
775 | | |
776 | | void init_iters () |
777 | 0 | { |
778 | 0 | iter_input.init (this, false); |
779 | 0 | iter_context.init (this, true); |
780 | 0 | } |
781 | | |
782 | 0 | void set_lookup_mask (hb_mask_t mask, bool init = true) { lookup_mask = mask; last_base = -1; last_base_until = 0; if (init) init_iters (); } |
783 | 0 | void set_auto_zwj (bool auto_zwj_, bool init = true) { auto_zwj = auto_zwj_; if (init) init_iters (); } |
784 | 0 | void set_auto_zwnj (bool auto_zwnj_, bool init = true) { auto_zwnj = auto_zwnj_; if (init) init_iters (); } |
785 | 0 | void set_per_syllable (bool per_syllable_, bool init = true) { per_syllable = per_syllable_; if (init) init_iters (); } |
786 | 0 | void set_random (bool random_) { random = random_; } |
787 | 0 | void set_recurse_func (recurse_func_t func) { recurse_func = func; } |
788 | 0 | void set_lookup_index (unsigned int lookup_index_) { lookup_index = lookup_index_; } |
789 | 0 | void set_lookup_props (unsigned int lookup_props_) { lookup_props = lookup_props_; init_iters (); } |
790 | | |
791 | | uint32_t random_number () |
792 | 0 | { |
793 | | /* http://www.cplusplus.com/reference/random/minstd_rand/ */ |
794 | 0 | buffer->random_state = buffer->random_state * 48271 % 2147483647; |
795 | 0 | return buffer->random_state; |
796 | 0 | } |
797 | | |
798 | | HB_ALWAYS_INLINE |
799 | | HB_HOT |
800 | | bool match_properties_mark (const hb_glyph_info_t *info, |
801 | | unsigned int glyph_props, |
802 | | unsigned int match_props) const |
803 | 0 | { |
804 | | /* If using mark filtering sets, the high short of |
805 | | * match_props has the set index. |
806 | | */ |
807 | 0 | if (match_props & LookupFlag::UseMarkFilteringSet) |
808 | 0 | return gdef_accel.mark_set_covers (match_props >> 16, info->codepoint); |
809 | | |
810 | | /* The second byte of match_props has the meaning |
811 | | * "ignore marks of attachment type different than |
812 | | * the attachment type specified." |
813 | | */ |
814 | 0 | if (match_props & LookupFlag::MarkAttachmentType) |
815 | 0 | return (match_props & LookupFlag::MarkAttachmentType) == (glyph_props & LookupFlag::MarkAttachmentType); |
816 | | |
817 | 0 | return true; |
818 | 0 | } |
819 | | |
820 | | #ifndef HB_OPTIMIZE_SIZE |
821 | | HB_ALWAYS_INLINE |
822 | | #endif |
823 | | bool check_glyph_property (const hb_glyph_info_t *info, |
824 | | unsigned match_props) const |
825 | 0 | { |
826 | 0 | unsigned int glyph_props = _hb_glyph_info_get_glyph_props (info); |
827 | | |
828 | | /* Not covered, if, for example, glyph class is ligature and |
829 | | * match_props includes LookupFlags::IgnoreLigatures |
830 | | */ |
831 | 0 | if (glyph_props & match_props & LookupFlag::IgnoreFlags) |
832 | 0 | return false; |
833 | | |
834 | 0 | if (unlikely (glyph_props & HB_OT_LAYOUT_GLYPH_PROPS_MARK)) |
835 | 0 | return match_properties_mark (info, glyph_props, match_props); |
836 | | |
837 | 0 | return true; |
838 | 0 | } |
839 | | |
840 | | void _set_glyph_class (hb_codepoint_t glyph_index, |
841 | | unsigned int class_guess = 0, |
842 | | bool ligature = false, |
843 | | bool component = false) |
844 | 0 | { |
845 | 0 | buffer->digest.add (glyph_index); |
846 | |
|
847 | 0 | if (new_syllables != (unsigned) -1) |
848 | 0 | buffer->cur().syllable() = new_syllables; |
849 | |
|
850 | 0 | unsigned int props = _hb_glyph_info_get_glyph_props (&buffer->cur()); |
851 | 0 | props |= HB_OT_LAYOUT_GLYPH_PROPS_SUBSTITUTED; |
852 | 0 | if (ligature) |
853 | 0 | { |
854 | 0 | props |= HB_OT_LAYOUT_GLYPH_PROPS_LIGATED; |
855 | | /* In the only place that the MULTIPLIED bit is used, Uniscribe |
856 | | * seems to only care about the "last" transformation between |
857 | | * Ligature and Multiple substitutions. Ie. if you ligate, expand, |
858 | | * and ligate again, it forgives the multiplication and acts as |
859 | | * if only ligation happened. As such, clear MULTIPLIED bit. |
860 | | */ |
861 | 0 | props &= ~HB_OT_LAYOUT_GLYPH_PROPS_MULTIPLIED; |
862 | 0 | } |
863 | 0 | if (component) |
864 | 0 | props |= HB_OT_LAYOUT_GLYPH_PROPS_MULTIPLIED; |
865 | 0 | if (likely (has_glyph_classes)) |
866 | 0 | { |
867 | 0 | props &= HB_OT_LAYOUT_GLYPH_PROPS_PRESERVE; |
868 | 0 | _hb_glyph_info_set_glyph_props (&buffer->cur(), props | gdef_accel.get_glyph_props (glyph_index)); |
869 | 0 | } |
870 | 0 | else if (class_guess) |
871 | 0 | { |
872 | 0 | props &= HB_OT_LAYOUT_GLYPH_PROPS_PRESERVE; |
873 | 0 | _hb_glyph_info_set_glyph_props (&buffer->cur(), props | class_guess); |
874 | 0 | } |
875 | 0 | else |
876 | 0 | _hb_glyph_info_set_glyph_props (&buffer->cur(), props); |
877 | 0 | } |
878 | | |
879 | | void replace_glyph (hb_codepoint_t glyph_index) |
880 | 0 | { |
881 | 0 | _set_glyph_class (glyph_index); |
882 | 0 | (void) buffer->replace_glyph (glyph_index); |
883 | 0 | } |
884 | | void replace_glyph_inplace (hb_codepoint_t glyph_index) |
885 | 0 | { |
886 | 0 | _set_glyph_class (glyph_index); |
887 | 0 | buffer->cur().codepoint = glyph_index; |
888 | 0 | } |
889 | | void replace_glyph_with_ligature (hb_codepoint_t glyph_index, |
890 | | unsigned int class_guess) |
891 | 0 | { |
892 | 0 | _set_glyph_class (glyph_index, class_guess, true); |
893 | 0 | (void) buffer->replace_glyph (glyph_index); |
894 | 0 | } |
895 | | void output_glyph_for_component (hb_codepoint_t glyph_index, |
896 | | unsigned int class_guess) |
897 | 0 | { |
898 | 0 | _set_glyph_class (glyph_index, class_guess, false, true); |
899 | 0 | (void) buffer->output_glyph (glyph_index); |
900 | 0 | } |
901 | | }; |
902 | | |
903 | | enum class hb_ot_subtable_cache_op_t |
904 | | { |
905 | | ENTER, |
906 | | LEAVE, |
907 | | }; |
908 | | |
909 | | struct hb_accelerate_subtables_context_t : |
910 | | hb_dispatch_context_t<hb_accelerate_subtables_context_t> |
911 | | { |
912 | | template <typename T> |
913 | | static inline auto apply_ (const T *obj, hb_ot_apply_context_t *c, void *external_cache, hb_priority<1>) HB_RETURN (bool, obj->apply (c, external_cache) ) |
914 | | template <typename T> |
915 | | static inline auto apply_ (const T *obj, hb_ot_apply_context_t *c, void *external_cache, hb_priority<0>) HB_RETURN (bool, obj->apply (c) ) |
916 | | template <typename T> |
917 | | static inline bool apply_to (const void *obj, hb_ot_apply_context_t *c, void *external_cache) |
918 | 0 | { |
919 | 0 | const T *typed_obj = (const T *) obj; |
920 | 0 | return apply_ (typed_obj, c, external_cache, hb_prioritize); |
921 | 0 | } Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GPOS_impl::SinglePosFormat1>(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GPOS_impl::SinglePosFormat2>(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GPOS_impl::CursivePosFormat1>(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::ContextFormat1_4<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::ContextFormat2_5<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::ContextFormat3>(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::ContextFormat1_4<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::ContextFormat2_5<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::ChainContextFormat1_4<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::ChainContextFormat2_5<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::ChainContextFormat3>(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::ChainContextFormat1_4<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::ChainContextFormat2_5<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_to<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1>(void const*, OT::hb_ot_apply_context_t*, void*) |
922 | | |
923 | | #ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE |
924 | | template <typename T> |
925 | | static inline auto apply_cached_ (const T *obj, hb_ot_apply_context_t *c, void *external_cache, hb_priority<2>) HB_RETURN (bool, obj->apply_cached (c, external_cache) ) |
926 | | template <typename T> |
927 | | static inline auto apply_cached_ (const T *obj, hb_ot_apply_context_t *c, void *external_cache, hb_priority<1>) HB_RETURN (bool, obj->apply (c, external_cache) ) |
928 | | template <typename T> |
929 | | static inline auto apply_cached_ (const T *obj, hb_ot_apply_context_t *c, void *external_cache, hb_priority<0>) HB_RETURN (bool, obj->apply (c) ) |
930 | | template <typename T> |
931 | | static inline bool apply_cached_to (const void *obj, hb_ot_apply_context_t *c, void *external_cache) |
932 | 0 | { |
933 | 0 | const T *typed_obj = (const T *) obj; |
934 | 0 | return apply_cached_ (typed_obj, c, external_cache, hb_prioritize); |
935 | 0 | } Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GPOS_impl::SinglePosFormat1>(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GPOS_impl::SinglePosFormat2>(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GPOS_impl::CursivePosFormat1>(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::ContextFormat1_4<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::ContextFormat2_5<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::ContextFormat3>(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::ContextFormat1_4<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::ContextFormat2_5<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::ChainContextFormat1_4<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::ChainContextFormat2_5<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::ChainContextFormat3>(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::ChainContextFormat1_4<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::ChainContextFormat2_5<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::SmallTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::MediumTypes> >(void const*, OT::hb_ot_apply_context_t*, void*) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::apply_cached_to<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1>(void const*, OT::hb_ot_apply_context_t*, void*) |
936 | | |
937 | | template <typename T> |
938 | | static inline auto cache_func_ (hb_ot_apply_context_t *c, |
939 | | hb_ot_subtable_cache_op_t op, |
940 | | hb_priority<1>) HB_RETURN (bool, T::cache_func (c, op) ) |
941 | | template <typename T=void> |
942 | | static inline bool cache_func_ (hb_ot_apply_context_t *c, |
943 | | hb_ot_subtable_cache_op_t op HB_UNUSED, |
944 | 0 | hb_priority<0>) { return false; }Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::Layout::GPOS_impl::SinglePosFormat1>(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::Layout::GPOS_impl::SinglePosFormat2>(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::Layout::GPOS_impl::CursivePosFormat1>(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::ContextFormat1_4<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::ContextFormat3>(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::ContextFormat1_4<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::ChainContextFormat1_4<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::ChainContextFormat3>(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::ChainContextFormat1_4<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1>(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t, hb_priority<0u>) |
945 | | template <typename Type> |
946 | | static inline bool cache_func_to (hb_ot_apply_context_t *c, |
947 | | hb_ot_subtable_cache_op_t op) |
948 | 0 | { |
949 | 0 | return cache_func_<Type> (c, op, hb_prioritize); |
950 | 0 | } Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GPOS_impl::SinglePosFormat1>(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GPOS_impl::SinglePosFormat2>(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GPOS_impl::CursivePosFormat1>(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::ContextFormat1_4<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::ContextFormat2_5<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::ContextFormat3>(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::ContextFormat1_4<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::ContextFormat2_5<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::ChainContextFormat1_4<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::ChainContextFormat2_5<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::ChainContextFormat3>(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::ChainContextFormat1_4<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::ChainContextFormat2_5<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::SmallTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::MediumTypes> >(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t) Unexecuted instantiation: bool OT::hb_accelerate_subtables_context_t::cache_func_to<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1>(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t) |
951 | | #endif |
952 | | |
953 | | typedef bool (*hb_apply_func_t) (const void *obj, hb_ot_apply_context_t *c, void *external_cache); |
954 | | typedef bool (*hb_cache_func_t) (hb_ot_apply_context_t *c, hb_ot_subtable_cache_op_t op); |
955 | | |
956 | | struct hb_applicable_t |
957 | | { |
958 | | friend struct hb_accelerate_subtables_context_t; |
959 | | friend struct hb_ot_layout_lookup_accelerator_t; |
960 | | |
961 | | template <typename T> |
962 | | void init (const T &obj_, |
963 | | hb_apply_func_t apply_func_ |
964 | | #ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE |
965 | | , hb_apply_func_t apply_cached_func_ |
966 | | , hb_cache_func_t cache_func_ |
967 | | , void *external_cache_ |
968 | | #endif |
969 | | ) |
970 | 0 | { |
971 | 0 | obj = &obj_; |
972 | 0 | apply_func = apply_func_; |
973 | 0 | #ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE |
974 | 0 | apply_cached_func = apply_cached_func_; |
975 | 0 | cache_func = cache_func_; |
976 | 0 | external_cache = external_cache_; |
977 | 0 | #endif |
978 | 0 | digest.init (); |
979 | 0 | obj_.get_coverage ().collect_coverage (&digest); |
980 | 0 | } Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GPOS_impl::SinglePosFormat1>(OT::Layout::GPOS_impl::SinglePosFormat1 const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*) Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GPOS_impl::SinglePosFormat2>(OT::Layout::GPOS_impl::SinglePosFormat2 const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*) Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::SmallTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*) Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::SmallTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*) Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::MediumTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*) Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::MediumTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*) Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GPOS_impl::CursivePosFormat1>(OT::Layout::GPOS_impl::CursivePosFormat1 const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*) Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::SmallTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*) Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::MediumTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*) Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::SmallTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*) Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::MediumTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*) Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::SmallTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*) Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::MediumTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*) Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::ContextFormat1_4<OT::Layout::SmallTypes> >(OT::ContextFormat1_4<OT::Layout::SmallTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*) Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::ContextFormat2_5<OT::Layout::SmallTypes> >(OT::ContextFormat2_5<OT::Layout::SmallTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*) Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::ContextFormat3>(OT::ContextFormat3 const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*) Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::ContextFormat1_4<OT::Layout::MediumTypes> >(OT::ContextFormat1_4<OT::Layout::MediumTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*) Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::ContextFormat2_5<OT::Layout::MediumTypes> >(OT::ContextFormat2_5<OT::Layout::MediumTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*) Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::ChainContextFormat1_4<OT::Layout::SmallTypes> >(OT::ChainContextFormat1_4<OT::Layout::SmallTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*) Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::ChainContextFormat2_5<OT::Layout::SmallTypes> >(OT::ChainContextFormat2_5<OT::Layout::SmallTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*) Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::ChainContextFormat3>(OT::ChainContextFormat3 const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*) Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::ChainContextFormat1_4<OT::Layout::MediumTypes> >(OT::ChainContextFormat1_4<OT::Layout::MediumTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*) Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::ChainContextFormat2_5<OT::Layout::MediumTypes> >(OT::ChainContextFormat2_5<OT::Layout::MediumTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*) Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*) Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*) Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*) Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*) Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::SmallTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*) Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*) Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::SmallTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*) Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*) Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::SmallTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*) Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::MediumTypes> const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*) Unexecuted instantiation: void OT::hb_accelerate_subtables_context_t::hb_applicable_t::init<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1>(OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1 const&, bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(void const*, OT::hb_ot_apply_context_t*, void*), bool (*)(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t), void*) |
981 | | |
982 | | #ifdef HB_NO_OT_LAYOUT_LOOKUP_CACHE |
983 | | bool apply (hb_ot_apply_context_t *c) const |
984 | | { |
985 | | return digest.may_have (c->buffer->cur().codepoint) && apply_func (obj, c, nullptr); |
986 | | } |
987 | | #else |
988 | | bool apply (hb_ot_apply_context_t *c) const |
989 | 0 | { |
990 | 0 | return digest.may_have (c->buffer->cur().codepoint) && apply_func (obj, c, external_cache); |
991 | 0 | } |
992 | | bool apply_cached (hb_ot_apply_context_t *c) const |
993 | 0 | { |
994 | 0 | return digest.may_have (c->buffer->cur().codepoint) && apply_cached_func (obj, c, external_cache); |
995 | 0 | } |
996 | | |
997 | | bool cache_enter (hb_ot_apply_context_t *c) const |
998 | 0 | { |
999 | 0 | return cache_func (c, hb_ot_subtable_cache_op_t::ENTER); |
1000 | 0 | } |
1001 | | void cache_leave (hb_ot_apply_context_t *c) const |
1002 | 0 | { |
1003 | 0 | cache_func (c, hb_ot_subtable_cache_op_t::LEAVE); |
1004 | 0 | } |
1005 | | #endif |
1006 | | |
1007 | | private: |
1008 | | const void *obj; |
1009 | | hb_apply_func_t apply_func; |
1010 | | #ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE |
1011 | | hb_apply_func_t apply_cached_func; |
1012 | | hb_cache_func_t cache_func; |
1013 | | void *external_cache; |
1014 | | #endif |
1015 | | hb_set_digest_t digest; |
1016 | | }; |
1017 | | |
1018 | | #ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE |
1019 | | template <typename T> |
1020 | | auto cache_cost (const T &obj, hb_priority<1>) HB_AUTO_RETURN ( obj.cache_cost () ) |
1021 | | template <typename T> |
1022 | | auto cache_cost (const T &obj, hb_priority<0>) HB_AUTO_RETURN ( 0u ) |
1023 | | |
1024 | | template <typename T> |
1025 | | auto external_cache_create (const T &obj, hb_priority<1>) HB_AUTO_RETURN ( obj.external_cache_create () ) |
1026 | | template <typename T> |
1027 | | auto external_cache_create (const T &obj, hb_priority<0>) HB_AUTO_RETURN ( nullptr ) |
1028 | | #endif |
1029 | | |
1030 | | /* Dispatch interface. */ |
1031 | | template <typename T> |
1032 | | return_t dispatch (const T &obj) |
1033 | 0 | { |
1034 | 0 | #ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE |
1035 | 0 | void *external_cache = nullptr; |
1036 | 0 | if (i < 8) |
1037 | 0 | external_cache = external_cache_create (obj, hb_prioritize); |
1038 | 0 | #endif |
1039 | |
|
1040 | 0 | hb_applicable_t *entry = &array[i++]; |
1041 | |
|
1042 | 0 | entry->init (obj, |
1043 | 0 | apply_to<T> |
1044 | 0 | #ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE |
1045 | 0 | , apply_cached_to<T> |
1046 | 0 | , cache_func_to<T> |
1047 | 0 | , external_cache |
1048 | 0 | #endif |
1049 | 0 | ); |
1050 | |
|
1051 | 0 | #ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE |
1052 | | /* Cache handling |
1053 | | * |
1054 | | * We allow one subtable from each lookup to use a cache. The assumption |
1055 | | * being that multiple subtables of the same lookup cannot use a cache |
1056 | | * because the resources they would use will collide. As such, we ask |
1057 | | * each subtable to tell us how much it costs (which a cache would avoid), |
1058 | | * and we allocate the cache opportunity to the costliest subtable. |
1059 | | */ |
1060 | 0 | unsigned cost = cache_cost (obj, hb_prioritize); |
1061 | 0 | if (cost > subtable_cache_user_cost) |
1062 | 0 | { |
1063 | 0 | subtable_cache_user_idx = i - 1; |
1064 | 0 | subtable_cache_user_cost = cost; |
1065 | 0 | } |
1066 | 0 | #endif |
1067 | |
|
1068 | 0 | return hb_empty_t (); |
1069 | 0 | } Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GPOS_impl::SinglePosFormat1>(OT::Layout::GPOS_impl::SinglePosFormat1 const&) Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GPOS_impl::SinglePosFormat2>(OT::Layout::GPOS_impl::SinglePosFormat2 const&) Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::SmallTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::SmallTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::PairPosFormat1_3<OT::Layout::MediumTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::PairPosFormat2_4<OT::Layout::MediumTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GPOS_impl::CursivePosFormat1>(OT::Layout::GPOS_impl::CursivePosFormat1 const&) Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::SmallTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::MarkBasePosFormat1_2<OT::Layout::MediumTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::SmallTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::MarkLigPosFormat1_2<OT::Layout::MediumTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::SmallTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GPOS_impl::MarkMarkPosFormat1_2<OT::Layout::MediumTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::ContextFormat1_4<OT::Layout::SmallTypes> >(OT::ContextFormat1_4<OT::Layout::SmallTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::ContextFormat2_5<OT::Layout::SmallTypes> >(OT::ContextFormat2_5<OT::Layout::SmallTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::ContextFormat3>(OT::ContextFormat3 const&) Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::ContextFormat1_4<OT::Layout::MediumTypes> >(OT::ContextFormat1_4<OT::Layout::MediumTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::ContextFormat2_5<OT::Layout::MediumTypes> >(OT::ContextFormat2_5<OT::Layout::MediumTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::ChainContextFormat1_4<OT::Layout::SmallTypes> >(OT::ChainContextFormat1_4<OT::Layout::SmallTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::ChainContextFormat2_5<OT::Layout::SmallTypes> >(OT::ChainContextFormat2_5<OT::Layout::SmallTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::ChainContextFormat3>(OT::ChainContextFormat3 const&) Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::ChainContextFormat1_4<OT::Layout::MediumTypes> >(OT::ChainContextFormat1_4<OT::Layout::MediumTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::ChainContextFormat2_5<OT::Layout::MediumTypes> >(OT::ChainContextFormat2_5<OT::Layout::MediumTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::SmallTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::SmallTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat1_3<OT::Layout::MediumTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::SingleSubstFormat2_4<OT::Layout::MediumTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::SmallTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::MultipleSubstFormat1_2<OT::Layout::MediumTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::SmallTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::AlternateSubstFormat1_2<OT::Layout::MediumTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::SmallTypes> >(OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::SmallTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::MediumTypes> >(OT::Layout::GSUB_impl::LigatureSubstFormat1_2<OT::Layout::MediumTypes> const&) Unexecuted instantiation: hb_empty_t OT::hb_accelerate_subtables_context_t::dispatch<OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1>(OT::Layout::GSUB_impl::ReverseChainSingleSubstFormat1 const&) |
1070 | 0 | static return_t default_return_value () { return hb_empty_t (); } |
1071 | | |
1072 | | hb_accelerate_subtables_context_t (hb_applicable_t *array_) : |
1073 | 0 | array (array_) {} |
1074 | | |
1075 | | hb_applicable_t *array; |
1076 | | unsigned i = 0; |
1077 | | |
1078 | | #ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE |
1079 | | unsigned subtable_cache_user_idx = (unsigned) -1; |
1080 | | unsigned subtable_cache_user_cost = 0; |
1081 | | #endif |
1082 | | }; |
1083 | | |
1084 | | |
1085 | | typedef bool (*intersects_func_t) (const hb_set_t *glyphs, unsigned value, const void *data, void *cache); |
1086 | | typedef void (*intersected_glyphs_func_t) (const hb_set_t *glyphs, const void *data, unsigned value, hb_set_t *intersected_glyphs, void *cache); |
1087 | | typedef void (*collect_glyphs_func_t) (hb_set_t *glyphs, unsigned value, const void *data); |
1088 | | typedef bool (*match_func_t) (hb_glyph_info_t &info, unsigned value, const void *data); |
1089 | | |
1090 | | struct ContextClosureFuncs |
1091 | | { |
1092 | | intersects_func_t intersects; |
1093 | | intersected_glyphs_func_t intersected_glyphs; |
1094 | | }; |
1095 | | struct ContextCollectGlyphsFuncs |
1096 | | { |
1097 | | collect_glyphs_func_t collect; |
1098 | | }; |
1099 | | struct ContextApplyFuncs |
1100 | | { |
1101 | | match_func_t match; |
1102 | | }; |
1103 | | struct ChainContextApplyFuncs |
1104 | | { |
1105 | | match_func_t match[3]; |
1106 | | }; |
1107 | | |
1108 | | |
1109 | | static inline bool intersects_glyph (const hb_set_t *glyphs, unsigned value, const void *data HB_UNUSED, void *cache HB_UNUSED) |
1110 | 0 | { |
1111 | 0 | return glyphs->has (value); |
1112 | 0 | } Unexecuted instantiation: hb-ot-face.cc:OT::intersects_glyph(hb_set_t const*, unsigned int, void const*, void*) Unexecuted instantiation: hb-ot-layout.cc:OT::intersects_glyph(hb_set_t const*, unsigned int, void const*, void*) Unexecuted instantiation: hb-aat-layout.cc:OT::intersects_glyph(hb_set_t const*, unsigned int, void const*, void*) Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::intersects_glyph(hb_set_t const*, unsigned int, void const*, void*) Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::intersects_glyph(hb_set_t const*, unsigned int, void const*, void*) |
1113 | | static inline bool intersects_class (const hb_set_t *glyphs, unsigned value, const void *data, void *cache) |
1114 | 0 | { |
1115 | 0 | const ClassDef &class_def = *reinterpret_cast<const ClassDef *>(data); |
1116 | 0 | hb_map_t *map = (hb_map_t *) cache; |
1117 | |
|
1118 | 0 | hb_codepoint_t *cached_v; |
1119 | 0 | if (map->has (value, &cached_v)) |
1120 | 0 | return *cached_v; |
1121 | | |
1122 | 0 | bool v = class_def.intersects_class (glyphs, value); |
1123 | 0 | map->set (value, v); |
1124 | |
|
1125 | 0 | return v; |
1126 | 0 | } Unexecuted instantiation: hb-ot-face.cc:OT::intersects_class(hb_set_t const*, unsigned int, void const*, void*) Unexecuted instantiation: hb-ot-layout.cc:OT::intersects_class(hb_set_t const*, unsigned int, void const*, void*) Unexecuted instantiation: hb-aat-layout.cc:OT::intersects_class(hb_set_t const*, unsigned int, void const*, void*) Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::intersects_class(hb_set_t const*, unsigned int, void const*, void*) Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::intersects_class(hb_set_t const*, unsigned int, void const*, void*) |
1127 | | static inline bool intersects_coverage (const hb_set_t *glyphs, unsigned value, const void *data, void *cache HB_UNUSED) |
1128 | 0 | { |
1129 | 0 | Offset16To<Coverage> coverage; |
1130 | 0 | coverage = value; |
1131 | 0 | return (data+coverage).intersects (glyphs); |
1132 | 0 | } Unexecuted instantiation: hb-ot-face.cc:OT::intersects_coverage(hb_set_t const*, unsigned int, void const*, void*) Unexecuted instantiation: hb-ot-layout.cc:OT::intersects_coverage(hb_set_t const*, unsigned int, void const*, void*) Unexecuted instantiation: hb-aat-layout.cc:OT::intersects_coverage(hb_set_t const*, unsigned int, void const*, void*) Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::intersects_coverage(hb_set_t const*, unsigned int, void const*, void*) Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::intersects_coverage(hb_set_t const*, unsigned int, void const*, void*) |
1133 | | |
1134 | | |
1135 | | static inline void intersected_glyph (const hb_set_t *glyphs HB_UNUSED, const void *data, unsigned value, hb_set_t *intersected_glyphs, HB_UNUSED void *cache) |
1136 | 0 | { |
1137 | 0 | unsigned g = reinterpret_cast<const HBUINT16 *>(data)[value]; |
1138 | 0 | intersected_glyphs->add (g); |
1139 | 0 | } Unexecuted instantiation: hb-ot-face.cc:OT::intersected_glyph(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*) Unexecuted instantiation: hb-ot-layout.cc:OT::intersected_glyph(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*) Unexecuted instantiation: hb-aat-layout.cc:OT::intersected_glyph(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*) Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::intersected_glyph(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*) Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::intersected_glyph(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*) |
1140 | | |
1141 | | using intersected_class_cache_t = hb_hashmap_t<unsigned, hb_set_t>; |
1142 | | |
1143 | | static inline void intersected_class_glyphs (const hb_set_t *glyphs, const void *data, unsigned value, hb_set_t *intersected_glyphs, void *cache) |
1144 | 0 | { |
1145 | 0 | const ClassDef &class_def = *reinterpret_cast<const ClassDef *>(data); |
1146 | |
|
1147 | 0 | intersected_class_cache_t *map = (intersected_class_cache_t *) cache; |
1148 | |
|
1149 | 0 | hb_set_t *cached_v; |
1150 | 0 | if (map->has (value, &cached_v)) |
1151 | 0 | { |
1152 | 0 | intersected_glyphs->union_ (*cached_v); |
1153 | 0 | return; |
1154 | 0 | } |
1155 | | |
1156 | 0 | hb_set_t v; |
1157 | 0 | class_def.intersected_class_glyphs (glyphs, value, &v); |
1158 | |
|
1159 | 0 | intersected_glyphs->union_ (v); |
1160 | |
|
1161 | 0 | map->set (value, std::move (v)); |
1162 | 0 | } Unexecuted instantiation: hb-ot-face.cc:OT::intersected_class_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*) Unexecuted instantiation: hb-ot-layout.cc:OT::intersected_class_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*) Unexecuted instantiation: hb-aat-layout.cc:OT::intersected_class_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*) Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::intersected_class_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*) Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::intersected_class_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*) |
1163 | | |
1164 | | static inline void intersected_coverage_glyphs (const hb_set_t *glyphs, const void *data, unsigned value, hb_set_t *intersected_glyphs, HB_UNUSED void *cache) |
1165 | 0 | { |
1166 | 0 | Offset16To<Coverage> coverage; |
1167 | 0 | coverage = value; |
1168 | 0 | (data+coverage).intersect_set (*glyphs, *intersected_glyphs); |
1169 | 0 | } Unexecuted instantiation: hb-ot-face.cc:OT::intersected_coverage_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*) Unexecuted instantiation: hb-ot-layout.cc:OT::intersected_coverage_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*) Unexecuted instantiation: hb-aat-layout.cc:OT::intersected_coverage_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*) Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::intersected_coverage_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*) Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::intersected_coverage_glyphs(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*) |
1170 | | |
1171 | | |
1172 | | template <typename HBUINT> |
1173 | | static inline bool array_is_subset_of (const hb_set_t *glyphs, |
1174 | | unsigned int count, |
1175 | | const HBUINT values[], |
1176 | | intersects_func_t intersects_func, |
1177 | | const void *intersects_data, |
1178 | | void *cache) |
1179 | 0 | { |
1180 | 0 | for (const auto &_ : + hb_iter (values, count)) |
1181 | 0 | if (!intersects_func (glyphs, _, intersects_data, cache)) return false; |
1182 | 0 | return true; |
1183 | 0 | } Unexecuted instantiation: hb-ot-face.cc:bool OT::array_is_subset_of<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_set_t const*, unsigned int, void const*, void*), void const*, void*) Unexecuted instantiation: hb-ot-face.cc:bool OT::array_is_subset_of<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_set_t const*, unsigned int, void const*, void*), void const*, void*) Unexecuted instantiation: hb-ot-layout.cc:bool OT::array_is_subset_of<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_set_t const*, unsigned int, void const*, void*), void const*, void*) Unexecuted instantiation: hb-ot-layout.cc:bool OT::array_is_subset_of<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_set_t const*, unsigned int, void const*, void*), void const*, void*) Unexecuted instantiation: hb-aat-layout.cc:bool OT::array_is_subset_of<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_set_t const*, unsigned int, void const*, void*), void const*, void*) Unexecuted instantiation: hb-aat-layout.cc:bool OT::array_is_subset_of<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_set_t const*, unsigned int, void const*, void*), void const*, void*) Unexecuted instantiation: hb-ot-shaper-arabic.cc:bool OT::array_is_subset_of<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_set_t const*, unsigned int, void const*, void*), void const*, void*) Unexecuted instantiation: hb-ot-shaper-arabic.cc:bool OT::array_is_subset_of<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_set_t const*, unsigned int, void const*, void*), void const*, void*) Unexecuted instantiation: hb-ot-shape-fallback.cc:bool OT::array_is_subset_of<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_set_t const*, unsigned int, void const*, void*), void const*, void*) Unexecuted instantiation: hb-ot-shape-fallback.cc:bool OT::array_is_subset_of<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_set_t const*, unsigned int, void const*, void*), void const*, void*) |
1184 | | |
1185 | | |
1186 | | static inline void collect_glyph (hb_set_t *glyphs, unsigned value, const void *data HB_UNUSED) |
1187 | 0 | { |
1188 | 0 | glyphs->add (value); |
1189 | 0 | } Unexecuted instantiation: hb-ot-face.cc:OT::collect_glyph(hb_set_t*, unsigned int, void const*) Unexecuted instantiation: hb-ot-layout.cc:OT::collect_glyph(hb_set_t*, unsigned int, void const*) Unexecuted instantiation: hb-aat-layout.cc:OT::collect_glyph(hb_set_t*, unsigned int, void const*) Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::collect_glyph(hb_set_t*, unsigned int, void const*) Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::collect_glyph(hb_set_t*, unsigned int, void const*) |
1190 | | static inline void collect_class (hb_set_t *glyphs, unsigned value, const void *data) |
1191 | 0 | { |
1192 | 0 | const ClassDef &class_def = *reinterpret_cast<const ClassDef *>(data); |
1193 | 0 | class_def.collect_class (glyphs, value); |
1194 | 0 | } Unexecuted instantiation: hb-ot-face.cc:OT::collect_class(hb_set_t*, unsigned int, void const*) Unexecuted instantiation: hb-ot-layout.cc:OT::collect_class(hb_set_t*, unsigned int, void const*) Unexecuted instantiation: hb-aat-layout.cc:OT::collect_class(hb_set_t*, unsigned int, void const*) Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::collect_class(hb_set_t*, unsigned int, void const*) Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::collect_class(hb_set_t*, unsigned int, void const*) |
1195 | | static inline void collect_coverage (hb_set_t *glyphs, unsigned value, const void *data) |
1196 | 0 | { |
1197 | 0 | Offset16To<Coverage> coverage; |
1198 | 0 | coverage = value; |
1199 | 0 | (data+coverage).collect_coverage (glyphs); |
1200 | 0 | } Unexecuted instantiation: hb-ot-face.cc:OT::collect_coverage(hb_set_t*, unsigned int, void const*) Unexecuted instantiation: hb-ot-layout.cc:OT::collect_coverage(hb_set_t*, unsigned int, void const*) Unexecuted instantiation: hb-aat-layout.cc:OT::collect_coverage(hb_set_t*, unsigned int, void const*) Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::collect_coverage(hb_set_t*, unsigned int, void const*) Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::collect_coverage(hb_set_t*, unsigned int, void const*) |
1201 | | template <typename HBUINT> |
1202 | | static inline void collect_array (hb_collect_glyphs_context_t *c HB_UNUSED, |
1203 | | hb_set_t *glyphs, |
1204 | | unsigned int count, |
1205 | | const HBUINT values[], |
1206 | | collect_glyphs_func_t collect_func, |
1207 | | const void *collect_data) |
1208 | 0 | { |
1209 | 0 | return |
1210 | 0 | + hb_iter (values, count) |
1211 | 0 | | hb_apply ([&] (const HBUINT &_) { collect_func (glyphs, _, collect_data); })Unexecuted instantiation: hb-ot-layout.cc:OT::collect_array<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, hb_set_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, void (*)(hb_set_t*, unsigned int, void const*), void const*)::{lambda(OT::NumType<true, unsigned short, 2u> const&)#1}::operator()(OT::NumType<true, unsigned short, 2u> const&) constUnexecuted instantiation: hb-ot-layout.cc:OT::collect_array<OT::NumType<true, unsigned int, 3u> >(OT::hb_collect_glyphs_context_t*, hb_set_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, void (*)(hb_set_t*, unsigned int, void const*), void const*)::{lambda(OT::NumType<true, unsigned int, 3u> const&)#1}::operator()(OT::NumType<true, unsigned int, 3u> const&) const |
1212 | 0 | ; |
1213 | 0 | } Unexecuted instantiation: hb-ot-face.cc:void OT::collect_array<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, hb_set_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, void (*)(hb_set_t*, unsigned int, void const*), void const*) Unexecuted instantiation: hb-ot-face.cc:void OT::collect_array<OT::NumType<true, unsigned int, 3u> >(OT::hb_collect_glyphs_context_t*, hb_set_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, void (*)(hb_set_t*, unsigned int, void const*), void const*) Unexecuted instantiation: hb-ot-layout.cc:void OT::collect_array<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, hb_set_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, void (*)(hb_set_t*, unsigned int, void const*), void const*) Unexecuted instantiation: hb-ot-layout.cc:void OT::collect_array<OT::NumType<true, unsigned int, 3u> >(OT::hb_collect_glyphs_context_t*, hb_set_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, void (*)(hb_set_t*, unsigned int, void const*), void const*) Unexecuted instantiation: hb-aat-layout.cc:void OT::collect_array<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, hb_set_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, void (*)(hb_set_t*, unsigned int, void const*), void const*) Unexecuted instantiation: hb-aat-layout.cc:void OT::collect_array<OT::NumType<true, unsigned int, 3u> >(OT::hb_collect_glyphs_context_t*, hb_set_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, void (*)(hb_set_t*, unsigned int, void const*), void const*) Unexecuted instantiation: hb-ot-shaper-arabic.cc:void OT::collect_array<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, hb_set_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, void (*)(hb_set_t*, unsigned int, void const*), void const*) Unexecuted instantiation: hb-ot-shaper-arabic.cc:void OT::collect_array<OT::NumType<true, unsigned int, 3u> >(OT::hb_collect_glyphs_context_t*, hb_set_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, void (*)(hb_set_t*, unsigned int, void const*), void const*) Unexecuted instantiation: hb-ot-shape-fallback.cc:void OT::collect_array<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, hb_set_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, void (*)(hb_set_t*, unsigned int, void const*), void const*) Unexecuted instantiation: hb-ot-shape-fallback.cc:void OT::collect_array<OT::NumType<true, unsigned int, 3u> >(OT::hb_collect_glyphs_context_t*, hb_set_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, void (*)(hb_set_t*, unsigned int, void const*), void const*) |
1214 | | |
1215 | | |
1216 | | static inline bool match_always (hb_glyph_info_t &info HB_UNUSED, unsigned value HB_UNUSED, const void *data HB_UNUSED) |
1217 | 0 | { |
1218 | 0 | return true; |
1219 | 0 | } Unexecuted instantiation: hb-ot-face.cc:OT::match_always(hb_glyph_info_t&, unsigned int, void const*) Unexecuted instantiation: hb-ot-layout.cc:OT::match_always(hb_glyph_info_t&, unsigned int, void const*) Unexecuted instantiation: hb-aat-layout.cc:OT::match_always(hb_glyph_info_t&, unsigned int, void const*) Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::match_always(hb_glyph_info_t&, unsigned int, void const*) Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::match_always(hb_glyph_info_t&, unsigned int, void const*) |
1220 | | static inline bool match_glyph (hb_glyph_info_t &info, unsigned value, const void *data HB_UNUSED) |
1221 | 0 | { |
1222 | 0 | return info.codepoint == value; |
1223 | 0 | } Unexecuted instantiation: hb-ot-face.cc:OT::match_glyph(hb_glyph_info_t&, unsigned int, void const*) Unexecuted instantiation: hb-ot-layout.cc:OT::match_glyph(hb_glyph_info_t&, unsigned int, void const*) Unexecuted instantiation: hb-aat-layout.cc:OT::match_glyph(hb_glyph_info_t&, unsigned int, void const*) Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::match_glyph(hb_glyph_info_t&, unsigned int, void const*) Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::match_glyph(hb_glyph_info_t&, unsigned int, void const*) |
1224 | | static inline bool match_class (hb_glyph_info_t &info, unsigned value, const void *data) |
1225 | 0 | { |
1226 | 0 | const ClassDef &class_def = *reinterpret_cast<const ClassDef *>(data); |
1227 | 0 | return class_def.get_class (info.codepoint) == value; |
1228 | 0 | } Unexecuted instantiation: hb-ot-face.cc:OT::match_class(hb_glyph_info_t&, unsigned int, void const*) Unexecuted instantiation: hb-ot-layout.cc:OT::match_class(hb_glyph_info_t&, unsigned int, void const*) Unexecuted instantiation: hb-aat-layout.cc:OT::match_class(hb_glyph_info_t&, unsigned int, void const*) Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::match_class(hb_glyph_info_t&, unsigned int, void const*) Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::match_class(hb_glyph_info_t&, unsigned int, void const*) |
1229 | | static inline unsigned get_class_cached (const ClassDef &class_def, hb_glyph_info_t &info) |
1230 | 0 | { |
1231 | 0 | unsigned klass = info.syllable(); |
1232 | 0 | if (klass < 255) |
1233 | 0 | return klass; |
1234 | 0 | klass = class_def.get_class (info.codepoint); |
1235 | 0 | if (likely (klass < 255)) |
1236 | 0 | info.syllable() = klass; |
1237 | 0 | return klass; |
1238 | 0 | } Unexecuted instantiation: hb-ot-face.cc:OT::get_class_cached(OT::ClassDef const&, hb_glyph_info_t&) Unexecuted instantiation: hb-ot-layout.cc:OT::get_class_cached(OT::ClassDef const&, hb_glyph_info_t&) Unexecuted instantiation: hb-aat-layout.cc:OT::get_class_cached(OT::ClassDef const&, hb_glyph_info_t&) Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::get_class_cached(OT::ClassDef const&, hb_glyph_info_t&) Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::get_class_cached(OT::ClassDef const&, hb_glyph_info_t&) |
1239 | | static inline bool match_class_cached (hb_glyph_info_t &info, unsigned value, const void *data) |
1240 | 0 | { |
1241 | 0 | const ClassDef &class_def = *reinterpret_cast<const ClassDef *>(data); |
1242 | 0 | return get_class_cached (class_def, info) == value; |
1243 | 0 | } Unexecuted instantiation: hb-ot-face.cc:OT::match_class_cached(hb_glyph_info_t&, unsigned int, void const*) Unexecuted instantiation: hb-ot-layout.cc:OT::match_class_cached(hb_glyph_info_t&, unsigned int, void const*) Unexecuted instantiation: hb-aat-layout.cc:OT::match_class_cached(hb_glyph_info_t&, unsigned int, void const*) Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::match_class_cached(hb_glyph_info_t&, unsigned int, void const*) Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::match_class_cached(hb_glyph_info_t&, unsigned int, void const*) |
1244 | | static inline unsigned get_class_cached1 (const ClassDef &class_def, hb_glyph_info_t &info) |
1245 | 0 | { |
1246 | 0 | unsigned klass = info.syllable() & 0x0F; |
1247 | 0 | if (klass < 15) |
1248 | 0 | return klass; |
1249 | 0 | klass = class_def.get_class (info.codepoint); |
1250 | 0 | if (likely (klass < 15)) |
1251 | 0 | info.syllable() = (info.syllable() & 0xF0) | klass; |
1252 | 0 | return klass; |
1253 | 0 | } Unexecuted instantiation: hb-ot-face.cc:OT::get_class_cached1(OT::ClassDef const&, hb_glyph_info_t&) Unexecuted instantiation: hb-ot-layout.cc:OT::get_class_cached1(OT::ClassDef const&, hb_glyph_info_t&) Unexecuted instantiation: hb-aat-layout.cc:OT::get_class_cached1(OT::ClassDef const&, hb_glyph_info_t&) Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::get_class_cached1(OT::ClassDef const&, hb_glyph_info_t&) Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::get_class_cached1(OT::ClassDef const&, hb_glyph_info_t&) |
1254 | | static inline bool match_class_cached1 (hb_glyph_info_t &info, unsigned value, const void *data) |
1255 | 0 | { |
1256 | 0 | const ClassDef &class_def = *reinterpret_cast<const ClassDef *>(data); |
1257 | 0 | return get_class_cached1 (class_def, info) == value; |
1258 | 0 | } Unexecuted instantiation: hb-ot-face.cc:OT::match_class_cached1(hb_glyph_info_t&, unsigned int, void const*) Unexecuted instantiation: hb-ot-layout.cc:OT::match_class_cached1(hb_glyph_info_t&, unsigned int, void const*) Unexecuted instantiation: hb-aat-layout.cc:OT::match_class_cached1(hb_glyph_info_t&, unsigned int, void const*) Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::match_class_cached1(hb_glyph_info_t&, unsigned int, void const*) Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::match_class_cached1(hb_glyph_info_t&, unsigned int, void const*) |
1259 | | static inline unsigned get_class_cached2 (const ClassDef &class_def, hb_glyph_info_t &info) |
1260 | 0 | { |
1261 | 0 | unsigned klass = (info.syllable() & 0xF0) >> 4; |
1262 | 0 | if (klass < 15) |
1263 | 0 | return klass; |
1264 | 0 | klass = class_def.get_class (info.codepoint); |
1265 | 0 | if (likely (klass < 15)) |
1266 | 0 | info.syllable() = (info.syllable() & 0x0F) | (klass << 4); |
1267 | 0 | return klass; |
1268 | 0 | } Unexecuted instantiation: hb-ot-face.cc:OT::get_class_cached2(OT::ClassDef const&, hb_glyph_info_t&) Unexecuted instantiation: hb-ot-layout.cc:OT::get_class_cached2(OT::ClassDef const&, hb_glyph_info_t&) Unexecuted instantiation: hb-aat-layout.cc:OT::get_class_cached2(OT::ClassDef const&, hb_glyph_info_t&) Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::get_class_cached2(OT::ClassDef const&, hb_glyph_info_t&) Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::get_class_cached2(OT::ClassDef const&, hb_glyph_info_t&) |
1269 | | static inline bool match_class_cached2 (hb_glyph_info_t &info, unsigned value, const void *data) |
1270 | 0 | { |
1271 | 0 | const ClassDef &class_def = *reinterpret_cast<const ClassDef *>(data); |
1272 | 0 | return get_class_cached2 (class_def, info) == value; |
1273 | 0 | } Unexecuted instantiation: hb-ot-face.cc:OT::match_class_cached2(hb_glyph_info_t&, unsigned int, void const*) Unexecuted instantiation: hb-ot-layout.cc:OT::match_class_cached2(hb_glyph_info_t&, unsigned int, void const*) Unexecuted instantiation: hb-aat-layout.cc:OT::match_class_cached2(hb_glyph_info_t&, unsigned int, void const*) Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::match_class_cached2(hb_glyph_info_t&, unsigned int, void const*) Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::match_class_cached2(hb_glyph_info_t&, unsigned int, void const*) |
1274 | | static inline bool match_coverage (hb_glyph_info_t &info, unsigned value, const void *data) |
1275 | 0 | { |
1276 | 0 | Offset16To<Coverage> coverage; |
1277 | 0 | coverage = value; |
1278 | 0 | return (data+coverage).get_coverage (info.codepoint) != NOT_COVERED; |
1279 | 0 | } Unexecuted instantiation: hb-ot-face.cc:OT::match_coverage(hb_glyph_info_t&, unsigned int, void const*) Unexecuted instantiation: hb-ot-layout.cc:OT::match_coverage(hb_glyph_info_t&, unsigned int, void const*) Unexecuted instantiation: hb-aat-layout.cc:OT::match_coverage(hb_glyph_info_t&, unsigned int, void const*) Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::match_coverage(hb_glyph_info_t&, unsigned int, void const*) Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::match_coverage(hb_glyph_info_t&, unsigned int, void const*) |
1280 | | |
1281 | | template <typename HBUINT> |
1282 | | static inline bool would_match_input (hb_would_apply_context_t *c, |
1283 | | unsigned int count, /* Including the first glyph (not matched) */ |
1284 | | const HBUINT input[], /* Array of input values--start with second glyph */ |
1285 | | match_func_t match_func, |
1286 | | const void *match_data) |
1287 | 0 | { |
1288 | 0 | if (count != c->len) |
1289 | 0 | return false; |
1290 | | |
1291 | 0 | for (unsigned int i = 1; i < count; i++) |
1292 | 0 | { |
1293 | 0 | hb_glyph_info_t info; |
1294 | 0 | info.codepoint = c->glyphs[i]; |
1295 | 0 | if (likely (!match_func (info, input[i - 1], match_data))) |
1296 | 0 | return false; |
1297 | 0 | } |
1298 | | |
1299 | 0 | return true; |
1300 | 0 | } Unexecuted instantiation: hb-ot-face.cc:bool OT::would_match_input<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*) Unexecuted instantiation: hb-ot-face.cc:bool OT::would_match_input<OT::NumType<true, unsigned int, 3u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*) Unexecuted instantiation: hb-ot-layout.cc:bool OT::would_match_input<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*) Unexecuted instantiation: hb-ot-layout.cc:bool OT::would_match_input<OT::NumType<true, unsigned int, 3u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*) Unexecuted instantiation: hb-aat-layout.cc:bool OT::would_match_input<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*) Unexecuted instantiation: hb-aat-layout.cc:bool OT::would_match_input<OT::NumType<true, unsigned int, 3u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*) Unexecuted instantiation: hb-ot-shaper-arabic.cc:bool OT::would_match_input<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*) Unexecuted instantiation: hb-ot-shaper-arabic.cc:bool OT::would_match_input<OT::NumType<true, unsigned int, 3u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*) Unexecuted instantiation: hb-ot-shape-fallback.cc:bool OT::would_match_input<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*) |
1301 | | template <typename HBUINT> |
1302 | | #ifndef HB_OPTIMIZE_SIZE |
1303 | | HB_ALWAYS_INLINE |
1304 | | #endif |
1305 | | static bool match_input (hb_ot_apply_context_t *c, |
1306 | | unsigned int count, /* Including the first glyph (not matched) */ |
1307 | | const HBUINT input[], /* Array of input values--start with second glyph */ |
1308 | | match_func_t match_func, |
1309 | | const void *match_data, |
1310 | | unsigned int *end_position, |
1311 | | unsigned int *p_total_component_count = nullptr) |
1312 | 0 | { |
1313 | 0 | TRACE_APPLY (nullptr); |
1314 | |
|
1315 | 0 | if (unlikely (count > HB_MAX_CONTEXT_LENGTH)) return_trace (false); |
1316 | | |
1317 | 0 | hb_buffer_t *buffer = c->buffer; |
1318 | |
|
1319 | 0 | auto &skippy_iter = c->iter_input; |
1320 | 0 | skippy_iter.reset (buffer->idx); |
1321 | 0 | skippy_iter.set_match_func (match_func, match_data); |
1322 | 0 | skippy_iter.set_glyph_data (input); |
1323 | | |
1324 | | /* |
1325 | | * This is perhaps the trickiest part of OpenType... Remarks: |
1326 | | * |
1327 | | * - If all components of the ligature were marks, we call this a mark ligature. |
1328 | | * |
1329 | | * - If there is no GDEF, and the ligature is NOT a mark ligature, we categorize |
1330 | | * it as a ligature glyph. |
1331 | | * |
1332 | | * - Ligatures cannot be formed across glyphs attached to different components |
1333 | | * of previous ligatures. Eg. the sequence is LAM,SHADDA,LAM,FATHA,HEH, and |
1334 | | * LAM,LAM,HEH form a ligature, leaving SHADDA,FATHA next to eachother. |
1335 | | * However, it would be wrong to ligate that SHADDA,FATHA sequence. |
1336 | | * There are a couple of exceptions to this: |
1337 | | * |
1338 | | * o If a ligature tries ligating with marks that belong to it itself, go ahead, |
1339 | | * assuming that the font designer knows what they are doing (otherwise it can |
1340 | | * break Indic stuff when a matra wants to ligate with a conjunct, |
1341 | | * |
1342 | | * o If two marks want to ligate and they belong to different components of the |
1343 | | * same ligature glyph, and said ligature glyph is to be ignored according to |
1344 | | * mark-filtering rules, then allow. |
1345 | | * https://github.com/harfbuzz/harfbuzz/issues/545 |
1346 | | */ |
1347 | |
|
1348 | 0 | unsigned int total_component_count = 0; |
1349 | |
|
1350 | 0 | unsigned int first_lig_id = _hb_glyph_info_get_lig_id (&buffer->cur()); |
1351 | 0 | unsigned int first_lig_comp = _hb_glyph_info_get_lig_comp (&buffer->cur()); |
1352 | |
|
1353 | 0 | enum { |
1354 | 0 | LIGBASE_NOT_CHECKED, |
1355 | 0 | LIGBASE_MAY_NOT_SKIP, |
1356 | 0 | LIGBASE_MAY_SKIP |
1357 | 0 | } ligbase = LIGBASE_NOT_CHECKED; |
1358 | |
|
1359 | 0 | for (unsigned int i = 1; i < count; i++) |
1360 | 0 | { |
1361 | 0 | unsigned unsafe_to; |
1362 | 0 | if (!skippy_iter.next (&unsafe_to)) |
1363 | 0 | { |
1364 | 0 | *end_position = unsafe_to; |
1365 | 0 | return_trace (false); |
1366 | 0 | } |
1367 | | |
1368 | 0 | if (unlikely (i + 1 > c->match_positions.length && |
1369 | 0 | !c->match_positions.resize_dirty (i + 1))) |
1370 | 0 | return_trace (false); |
1371 | 0 | c->match_positions.arrayZ[i] = skippy_iter.idx; |
1372 | |
|
1373 | 0 | unsigned int this_lig_id = _hb_glyph_info_get_lig_id (&buffer->info[skippy_iter.idx]); |
1374 | 0 | unsigned int this_lig_comp = _hb_glyph_info_get_lig_comp (&buffer->info[skippy_iter.idx]); |
1375 | |
|
1376 | 0 | if (first_lig_id && first_lig_comp) |
1377 | 0 | { |
1378 | | /* If first component was attached to a previous ligature component, |
1379 | | * all subsequent components should be attached to the same ligature |
1380 | | * component, otherwise we shouldn't ligate them... */ |
1381 | 0 | if (first_lig_id != this_lig_id || first_lig_comp != this_lig_comp) |
1382 | 0 | { |
1383 | | /* ...unless, we are attached to a base ligature and that base |
1384 | | * ligature is ignorable. */ |
1385 | 0 | if (ligbase == LIGBASE_NOT_CHECKED) |
1386 | 0 | { |
1387 | 0 | bool found = false; |
1388 | 0 | const auto *out = buffer->out_info; |
1389 | 0 | unsigned int j = buffer->out_len; |
1390 | 0 | while (j && _hb_glyph_info_get_lig_id (&out[j - 1]) == first_lig_id) |
1391 | 0 | { |
1392 | 0 | if (_hb_glyph_info_get_lig_comp (&out[j - 1]) == 0) |
1393 | 0 | { |
1394 | 0 | j--; |
1395 | 0 | found = true; |
1396 | 0 | break; |
1397 | 0 | } |
1398 | 0 | j--; |
1399 | 0 | } |
1400 | |
|
1401 | 0 | if (found && skippy_iter.may_skip (out[j]) == matcher_t::SKIP_YES) |
1402 | 0 | ligbase = LIGBASE_MAY_SKIP; |
1403 | 0 | else |
1404 | 0 | ligbase = LIGBASE_MAY_NOT_SKIP; |
1405 | 0 | } |
1406 | |
|
1407 | 0 | if (ligbase == LIGBASE_MAY_NOT_SKIP) |
1408 | 0 | return_trace (false); |
1409 | 0 | } |
1410 | 0 | } |
1411 | 0 | else |
1412 | 0 | { |
1413 | | /* If first component was NOT attached to a previous ligature component, |
1414 | | * all subsequent components should also NOT be attached to any ligature |
1415 | | * component, unless they are attached to the first component itself! */ |
1416 | 0 | if (this_lig_id && this_lig_comp && (this_lig_id != first_lig_id)) |
1417 | 0 | return_trace (false); |
1418 | 0 | } |
1419 | | |
1420 | 0 | total_component_count += _hb_glyph_info_get_lig_num_comps (&buffer->info[skippy_iter.idx]); |
1421 | 0 | } |
1422 | | |
1423 | 0 | *end_position = skippy_iter.idx + 1; |
1424 | |
|
1425 | 0 | if (p_total_component_count) |
1426 | 0 | { |
1427 | 0 | total_component_count += _hb_glyph_info_get_lig_num_comps (&buffer->cur()); |
1428 | 0 | *p_total_component_count = total_component_count; |
1429 | 0 | } |
1430 | |
|
1431 | 0 | c->match_positions.arrayZ[0] = buffer->idx; |
1432 | |
|
1433 | 0 | return_trace (true); |
1434 | 0 | } Unexecuted instantiation: hb-ot-face.cc:bool OT::match_input<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*) Unexecuted instantiation: hb-ot-face.cc:bool OT::match_input<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*) Unexecuted instantiation: hb-ot-face.cc:bool OT::match_input<OT::HBGlyphID16>(OT::hb_ot_apply_context_t*, unsigned int, OT::HBGlyphID16 const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*) Unexecuted instantiation: hb-ot-face.cc:bool OT::match_input<OT::HBGlyphID24>(OT::hb_ot_apply_context_t*, unsigned int, OT::HBGlyphID24 const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*) Unexecuted instantiation: hb-ot-layout.cc:bool OT::match_input<OT::HBGlyphID16>(OT::hb_ot_apply_context_t*, unsigned int, OT::HBGlyphID16 const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*) Unexecuted instantiation: hb-ot-layout.cc:bool OT::match_input<OT::HBGlyphID24>(OT::hb_ot_apply_context_t*, unsigned int, OT::HBGlyphID24 const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*) Unexecuted instantiation: hb-ot-layout.cc:bool OT::match_input<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*) Unexecuted instantiation: hb-ot-layout.cc:bool OT::match_input<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*) Unexecuted instantiation: hb-aat-layout.cc:bool OT::match_input<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*) Unexecuted instantiation: hb-aat-layout.cc:bool OT::match_input<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*) Unexecuted instantiation: hb-aat-layout.cc:bool OT::match_input<OT::HBGlyphID16>(OT::hb_ot_apply_context_t*, unsigned int, OT::HBGlyphID16 const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*) Unexecuted instantiation: hb-aat-layout.cc:bool OT::match_input<OT::HBGlyphID24>(OT::hb_ot_apply_context_t*, unsigned int, OT::HBGlyphID24 const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*) Unexecuted instantiation: hb-ot-shaper-arabic.cc:bool OT::match_input<OT::HBGlyphID16>(OT::hb_ot_apply_context_t*, unsigned int, OT::HBGlyphID16 const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*) Unexecuted instantiation: hb-ot-shaper-arabic.cc:bool OT::match_input<OT::HBGlyphID24>(OT::hb_ot_apply_context_t*, unsigned int, OT::HBGlyphID24 const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*) Unexecuted instantiation: hb-ot-shaper-arabic.cc:bool OT::match_input<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*) Unexecuted instantiation: hb-ot-shaper-arabic.cc:bool OT::match_input<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*) Unexecuted instantiation: hb-ot-shape-fallback.cc:bool OT::match_input<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*) Unexecuted instantiation: hb-ot-shape-fallback.cc:bool OT::match_input<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*, unsigned int*) |
1435 | | static inline bool ligate_input (hb_ot_apply_context_t *c, |
1436 | | unsigned int count, /* Including the first glyph */ |
1437 | | unsigned int match_end, |
1438 | | hb_codepoint_t lig_glyph, |
1439 | | unsigned int total_component_count) |
1440 | 0 | { |
1441 | 0 | TRACE_APPLY (nullptr); |
1442 | |
|
1443 | 0 | hb_buffer_t *buffer = c->buffer; |
1444 | |
|
1445 | 0 | buffer->merge_clusters (buffer->idx, match_end); |
1446 | | |
1447 | | /* - If a base and one or more marks ligate, consider that as a base, NOT |
1448 | | * ligature, such that all following marks can still attach to it. |
1449 | | * https://github.com/harfbuzz/harfbuzz/issues/1109 |
1450 | | * |
1451 | | * - If all components of the ligature were marks, we call this a mark ligature. |
1452 | | * If it *is* a mark ligature, we don't allocate a new ligature id, and leave |
1453 | | * the ligature to keep its old ligature id. This will allow it to attach to |
1454 | | * a base ligature in GPOS. Eg. if the sequence is: LAM,LAM,SHADDA,FATHA,HEH, |
1455 | | * and LAM,LAM,HEH for a ligature, they will leave SHADDA and FATHA with a |
1456 | | * ligature id and component value of 2. Then if SHADDA,FATHA form a ligature |
1457 | | * later, we don't want them to lose their ligature id/component, otherwise |
1458 | | * GPOS will fail to correctly position the mark ligature on top of the |
1459 | | * LAM,LAM,HEH ligature. See: |
1460 | | * https://bugzilla.gnome.org/show_bug.cgi?id=676343 |
1461 | | * |
1462 | | * - If a ligature is formed of components that some of which are also ligatures |
1463 | | * themselves, and those ligature components had marks attached to *their* |
1464 | | * components, we have to attach the marks to the new ligature component |
1465 | | * positions! Now *that*'s tricky! And these marks may be following the |
1466 | | * last component of the whole sequence, so we should loop forward looking |
1467 | | * for them and update them. |
1468 | | * |
1469 | | * Eg. the sequence is LAM,LAM,SHADDA,FATHA,HEH, and the font first forms a |
1470 | | * 'calt' ligature of LAM,HEH, leaving the SHADDA and FATHA with a ligature |
1471 | | * id and component == 1. Now, during 'liga', the LAM and the LAM-HEH ligature |
1472 | | * form a LAM-LAM-HEH ligature. We need to reassign the SHADDA and FATHA to |
1473 | | * the new ligature with a component value of 2. |
1474 | | * |
1475 | | * This in fact happened to a font... See: |
1476 | | * https://bugzilla.gnome.org/show_bug.cgi?id=437633 |
1477 | | */ |
1478 | |
|
1479 | 0 | bool is_base_ligature = _hb_glyph_info_is_base_glyph (&buffer->info[c->match_positions.arrayZ[0]]); |
1480 | 0 | bool is_mark_ligature = _hb_glyph_info_is_mark (&buffer->info[c->match_positions.arrayZ[0]]); |
1481 | 0 | for (unsigned int i = 1; i < count; i++) |
1482 | 0 | if (!_hb_glyph_info_is_mark (&buffer->info[c->match_positions.arrayZ[i]])) |
1483 | 0 | { |
1484 | 0 | is_base_ligature = false; |
1485 | 0 | is_mark_ligature = false; |
1486 | 0 | break; |
1487 | 0 | } |
1488 | 0 | bool is_ligature = !is_base_ligature && !is_mark_ligature; |
1489 | |
|
1490 | 0 | unsigned int klass = is_ligature ? HB_OT_LAYOUT_GLYPH_PROPS_LIGATURE : 0; |
1491 | 0 | unsigned int lig_id = is_ligature ? _hb_allocate_lig_id (buffer) : 0; |
1492 | 0 | unsigned int last_lig_id = _hb_glyph_info_get_lig_id (&buffer->cur()); |
1493 | 0 | unsigned int last_num_components = _hb_glyph_info_get_lig_num_comps (&buffer->cur()); |
1494 | 0 | unsigned int components_so_far = last_num_components; |
1495 | |
|
1496 | 0 | if (is_ligature) |
1497 | 0 | { |
1498 | 0 | _hb_glyph_info_set_lig_props_for_ligature (&buffer->cur(), lig_id, total_component_count); |
1499 | 0 | if (_hb_glyph_info_get_general_category (&buffer->cur()) == HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK) |
1500 | 0 | { |
1501 | 0 | _hb_glyph_info_set_general_category (&buffer->cur(), HB_UNICODE_GENERAL_CATEGORY_OTHER_LETTER); |
1502 | 0 | } |
1503 | 0 | } |
1504 | 0 | c->replace_glyph_with_ligature (lig_glyph, klass); |
1505 | |
|
1506 | 0 | for (unsigned int i = 1; i < count; i++) |
1507 | 0 | { |
1508 | 0 | while (buffer->idx < c->match_positions.arrayZ[i] && buffer->successful) |
1509 | 0 | { |
1510 | 0 | if (is_ligature) |
1511 | 0 | { |
1512 | 0 | unsigned int this_comp = _hb_glyph_info_get_lig_comp (&buffer->cur()); |
1513 | 0 | if (this_comp == 0) |
1514 | 0 | this_comp = last_num_components; |
1515 | 0 | assert (components_so_far >= last_num_components); |
1516 | 0 | unsigned int new_lig_comp = components_so_far - last_num_components + |
1517 | 0 | hb_min (this_comp, last_num_components); |
1518 | 0 | _hb_glyph_info_set_lig_props_for_mark (&buffer->cur(), lig_id, new_lig_comp); |
1519 | 0 | } |
1520 | 0 | (void) buffer->next_glyph (); |
1521 | 0 | } |
1522 | | |
1523 | 0 | last_lig_id = _hb_glyph_info_get_lig_id (&buffer->cur()); |
1524 | 0 | last_num_components = _hb_glyph_info_get_lig_num_comps (&buffer->cur()); |
1525 | 0 | components_so_far += last_num_components; |
1526 | | |
1527 | | /* Skip the base glyph */ |
1528 | 0 | buffer->idx++; |
1529 | 0 | } |
1530 | | |
1531 | 0 | if (!is_mark_ligature && last_lig_id) |
1532 | 0 | { |
1533 | | /* Re-adjust components for any marks following. */ |
1534 | 0 | for (unsigned i = buffer->idx; i < buffer->len; ++i) |
1535 | 0 | { |
1536 | 0 | if (last_lig_id != _hb_glyph_info_get_lig_id (&buffer->info[i])) break; |
1537 | | |
1538 | 0 | unsigned this_comp = _hb_glyph_info_get_lig_comp (&buffer->info[i]); |
1539 | 0 | if (!this_comp) break; |
1540 | | |
1541 | 0 | assert (components_so_far >= last_num_components); |
1542 | 0 | unsigned new_lig_comp = components_so_far - last_num_components + |
1543 | 0 | hb_min (this_comp, last_num_components); |
1544 | 0 | _hb_glyph_info_set_lig_props_for_mark (&buffer->info[i], lig_id, new_lig_comp); |
1545 | 0 | } |
1546 | 0 | } |
1547 | 0 | return_trace (true); |
1548 | 0 | } Unexecuted instantiation: hb-ot-face.cc:OT::ligate_input(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: hb-ot-layout.cc:OT::ligate_input(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: hb-aat-layout.cc:OT::ligate_input(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::ligate_input(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, unsigned int, unsigned int) Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::ligate_input(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, unsigned int, unsigned int) |
1549 | | |
1550 | | template <typename HBUINT> |
1551 | | #ifndef HB_OPTIMIZE_SIZE |
1552 | | HB_ALWAYS_INLINE |
1553 | | #endif |
1554 | | static bool match_backtrack (hb_ot_apply_context_t *c, |
1555 | | unsigned int count, |
1556 | | const HBUINT backtrack[], |
1557 | | match_func_t match_func, |
1558 | | const void *match_data, |
1559 | | unsigned int *match_start) |
1560 | 0 | { |
1561 | 0 | TRACE_APPLY (nullptr); |
1562 | |
|
1563 | 0 | auto &skippy_iter = c->iter_context; |
1564 | 0 | skippy_iter.reset_back (c->buffer->backtrack_len ()); |
1565 | 0 | skippy_iter.set_match_func (match_func, match_data); |
1566 | 0 | skippy_iter.set_glyph_data (backtrack); |
1567 | |
|
1568 | 0 | for (unsigned int i = 0; i < count; i++) |
1569 | 0 | { |
1570 | 0 | unsigned unsafe_from; |
1571 | 0 | if (!skippy_iter.prev (&unsafe_from)) |
1572 | 0 | { |
1573 | 0 | *match_start = unsafe_from; |
1574 | 0 | return_trace (false); |
1575 | 0 | } |
1576 | 0 | } |
1577 | | |
1578 | 0 | *match_start = skippy_iter.idx; |
1579 | 0 | return_trace (true); |
1580 | 0 | } Unexecuted instantiation: hb-ot-face.cc:bool OT::match_backtrack<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*) Unexecuted instantiation: hb-ot-face.cc:bool OT::match_backtrack<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*) Unexecuted instantiation: hb-ot-layout.cc:bool OT::match_backtrack<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*) Unexecuted instantiation: hb-ot-layout.cc:bool OT::match_backtrack<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*) Unexecuted instantiation: hb-aat-layout.cc:bool OT::match_backtrack<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*) Unexecuted instantiation: hb-aat-layout.cc:bool OT::match_backtrack<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*) Unexecuted instantiation: hb-ot-shaper-arabic.cc:bool OT::match_backtrack<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*) Unexecuted instantiation: hb-ot-shaper-arabic.cc:bool OT::match_backtrack<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*) Unexecuted instantiation: hb-ot-shape-fallback.cc:bool OT::match_backtrack<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*) Unexecuted instantiation: hb-ot-shape-fallback.cc:bool OT::match_backtrack<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int*) |
1581 | | |
1582 | | template <typename HBUINT> |
1583 | | #ifndef HB_OPTIMIZE_SIZE |
1584 | | HB_ALWAYS_INLINE |
1585 | | #endif |
1586 | | static bool match_lookahead (hb_ot_apply_context_t *c, |
1587 | | unsigned int count, |
1588 | | const HBUINT lookahead[], |
1589 | | match_func_t match_func, |
1590 | | const void *match_data, |
1591 | | unsigned int start_index, |
1592 | | unsigned int *end_index) |
1593 | 0 | { |
1594 | 0 | TRACE_APPLY (nullptr); |
1595 | |
|
1596 | 0 | auto &skippy_iter = c->iter_context; |
1597 | 0 | assert (start_index >= 1); |
1598 | 0 | skippy_iter.reset (start_index - 1); |
1599 | 0 | skippy_iter.set_match_func (match_func, match_data); |
1600 | 0 | skippy_iter.set_glyph_data (lookahead); |
1601 | |
|
1602 | 0 | for (unsigned int i = 0; i < count; i++) |
1603 | 0 | { |
1604 | 0 | unsigned unsafe_to; |
1605 | 0 | if (!skippy_iter.next (&unsafe_to)) |
1606 | 0 | { |
1607 | 0 | *end_index = unsafe_to; |
1608 | 0 | return_trace (false); |
1609 | 0 | } |
1610 | 0 | } |
1611 | | |
1612 | 0 | *end_index = skippy_iter.idx + 1; |
1613 | 0 | return_trace (true); |
1614 | 0 | } Unexecuted instantiation: hb-ot-face.cc:bool OT::match_lookahead<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int, unsigned int*) Unexecuted instantiation: hb-ot-face.cc:bool OT::match_lookahead<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int, unsigned int*) Unexecuted instantiation: hb-ot-layout.cc:bool OT::match_lookahead<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int, unsigned int*) Unexecuted instantiation: hb-ot-layout.cc:bool OT::match_lookahead<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int, unsigned int*) Unexecuted instantiation: hb-aat-layout.cc:bool OT::match_lookahead<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int, unsigned int*) Unexecuted instantiation: hb-aat-layout.cc:bool OT::match_lookahead<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int, unsigned int*) Unexecuted instantiation: hb-ot-shaper-arabic.cc:bool OT::match_lookahead<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int, unsigned int*) Unexecuted instantiation: hb-ot-shaper-arabic.cc:bool OT::match_lookahead<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int, unsigned int*) Unexecuted instantiation: hb-ot-shape-fallback.cc:bool OT::match_lookahead<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int, unsigned int*) Unexecuted instantiation: hb-ot-shape-fallback.cc:bool OT::match_lookahead<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, bool (*)(hb_glyph_info_t&, unsigned int, void const*), void const*, unsigned int, unsigned int*) |
1615 | | |
1616 | | |
1617 | | |
1618 | | struct LookupRecord |
1619 | | { |
1620 | | bool serialize (hb_serialize_context_t *c, |
1621 | | const hb_map_t *lookup_map) const |
1622 | 0 | { |
1623 | 0 | TRACE_SERIALIZE (this); |
1624 | 0 | auto *out = c->embed (*this); |
1625 | 0 | if (unlikely (!out)) return_trace (false); |
1626 | 0 |
|
1627 | 0 | return_trace (c->check_assign (out->lookupListIndex, lookup_map->get (lookupListIndex), HB_SERIALIZE_ERROR_INT_OVERFLOW)); |
1628 | 0 | } |
1629 | | |
1630 | | bool sanitize (hb_sanitize_context_t *c) const |
1631 | 0 | { |
1632 | 0 | TRACE_SANITIZE (this); |
1633 | 0 | return_trace (c->check_struct (this)); |
1634 | 0 | } |
1635 | | |
1636 | | HBUINT16 sequenceIndex; /* Index into current glyph |
1637 | | * sequence--first glyph = 0 */ |
1638 | | HBUINT16 lookupListIndex; /* Lookup to apply to that |
1639 | | * position--zero--based */ |
1640 | | public: |
1641 | | DEFINE_SIZE_STATIC (4); |
1642 | | }; |
1643 | | |
1644 | | static unsigned serialize_lookuprecord_array (hb_serialize_context_t *c, |
1645 | | const hb_array_t<const LookupRecord> lookupRecords, |
1646 | | const hb_map_t *lookup_map) |
1647 | 0 | { |
1648 | 0 | unsigned count = 0; |
1649 | 0 | for (const LookupRecord& r : lookupRecords) |
1650 | 0 | { |
1651 | 0 | if (!lookup_map->has (r.lookupListIndex)) |
1652 | 0 | continue; |
1653 | 0 |
|
1654 | 0 | if (!r.serialize (c, lookup_map)) |
1655 | 0 | return 0; |
1656 | 0 |
|
1657 | 0 | count++; |
1658 | 0 | } |
1659 | 0 | return count; |
1660 | 0 | } Unexecuted instantiation: hb-ot-face.cc:OT::serialize_lookuprecord_array(hb_serialize_context_t*, hb_array_t<OT::LookupRecord const>, hb_map_t const*) Unexecuted instantiation: hb-ot-layout.cc:OT::serialize_lookuprecord_array(hb_serialize_context_t*, hb_array_t<OT::LookupRecord const>, hb_map_t const*) Unexecuted instantiation: hb-aat-layout.cc:OT::serialize_lookuprecord_array(hb_serialize_context_t*, hb_array_t<OT::LookupRecord const>, hb_map_t const*) Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::serialize_lookuprecord_array(hb_serialize_context_t*, hb_array_t<OT::LookupRecord const>, hb_map_t const*) Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::serialize_lookuprecord_array(hb_serialize_context_t*, hb_array_t<OT::LookupRecord const>, hb_map_t const*) |
1661 | | |
1662 | | enum ContextFormat { SimpleContext = 1, ClassBasedContext = 2, CoverageBasedContext = 3 }; |
1663 | | |
1664 | | template <typename HBUINT> |
1665 | | static void context_closure_recurse_lookups (hb_closure_context_t *c, |
1666 | | unsigned inputCount, const HBUINT input[], |
1667 | | unsigned lookupCount, |
1668 | | const LookupRecord lookupRecord[] /* Array of LookupRecords--in design order */, |
1669 | | unsigned value, |
1670 | | ContextFormat context_format, |
1671 | | const void *data, |
1672 | | intersected_glyphs_func_t intersected_glyphs_func, |
1673 | | void *cache) |
1674 | 0 | { |
1675 | 0 | hb_set_t covered_seq_indicies; |
1676 | 0 | hb_set_t pos_glyphs; |
1677 | 0 | for (unsigned int i = 0; i < lookupCount; i++) |
1678 | 0 | { |
1679 | 0 | unsigned seqIndex = lookupRecord[i].sequenceIndex; |
1680 | 0 | if (seqIndex >= inputCount) continue; |
1681 | | |
1682 | 0 | bool has_pos_glyphs = false; |
1683 | |
|
1684 | 0 | if (!covered_seq_indicies.has (seqIndex)) |
1685 | 0 | { |
1686 | 0 | has_pos_glyphs = true; |
1687 | 0 | pos_glyphs.clear (); |
1688 | 0 | if (seqIndex == 0) |
1689 | 0 | { |
1690 | 0 | switch (context_format) { |
1691 | 0 | case ContextFormat::SimpleContext: |
1692 | 0 | pos_glyphs.add (value); |
1693 | 0 | break; |
1694 | 0 | case ContextFormat::ClassBasedContext: |
1695 | 0 | intersected_glyphs_func (&c->parent_active_glyphs (), data, value, &pos_glyphs, cache); |
1696 | 0 | break; |
1697 | 0 | case ContextFormat::CoverageBasedContext: |
1698 | 0 | pos_glyphs.set (c->parent_active_glyphs ()); |
1699 | 0 | break; |
1700 | 0 | } |
1701 | 0 | } |
1702 | 0 | else |
1703 | 0 | { |
1704 | 0 | const void *input_data = input; |
1705 | 0 | unsigned input_value = seqIndex - 1; |
1706 | 0 | if (context_format != ContextFormat::SimpleContext) |
1707 | 0 | { |
1708 | 0 | input_data = data; |
1709 | 0 | input_value = input[seqIndex - 1]; |
1710 | 0 | } |
1711 | |
|
1712 | 0 | intersected_glyphs_func (c->glyphs, input_data, input_value, &pos_glyphs, cache); |
1713 | 0 | } |
1714 | 0 | } |
1715 | | |
1716 | 0 | covered_seq_indicies.add (seqIndex); |
1717 | 0 | hb_set_t *cur_active_glyphs = c->push_cur_active_glyphs (); |
1718 | 0 | if (unlikely (!cur_active_glyphs)) |
1719 | 0 | return; |
1720 | 0 | if (has_pos_glyphs) { |
1721 | 0 | *cur_active_glyphs = std::move (pos_glyphs); |
1722 | 0 | } else { |
1723 | 0 | *cur_active_glyphs = *c->glyphs; |
1724 | 0 | } |
1725 | |
|
1726 | 0 | unsigned endIndex = inputCount; |
1727 | 0 | if (context_format == ContextFormat::CoverageBasedContext) |
1728 | 0 | endIndex += 1; |
1729 | |
|
1730 | 0 | c->recurse (lookupRecord[i].lookupListIndex, &covered_seq_indicies, seqIndex, endIndex); |
1731 | |
|
1732 | 0 | c->pop_cur_done_glyphs (); |
1733 | 0 | } |
1734 | 0 | } Unexecuted instantiation: hb-ot-face.cc:void OT::context_closure_recurse_lookups<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextFormat, void const*, void (*)(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*), void*) Unexecuted instantiation: hb-ot-face.cc:void OT::context_closure_recurse_lookups<OT::NumType<true, unsigned int, 3u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextFormat, void const*, void (*)(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*), void*) Unexecuted instantiation: hb-ot-layout.cc:void OT::context_closure_recurse_lookups<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextFormat, void const*, void (*)(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*), void*) Unexecuted instantiation: hb-ot-layout.cc:void OT::context_closure_recurse_lookups<OT::NumType<true, unsigned int, 3u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextFormat, void const*, void (*)(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*), void*) Unexecuted instantiation: hb-aat-layout.cc:void OT::context_closure_recurse_lookups<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextFormat, void const*, void (*)(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*), void*) Unexecuted instantiation: hb-aat-layout.cc:void OT::context_closure_recurse_lookups<OT::NumType<true, unsigned int, 3u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextFormat, void const*, void (*)(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*), void*) Unexecuted instantiation: hb-ot-shaper-arabic.cc:void OT::context_closure_recurse_lookups<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextFormat, void const*, void (*)(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*), void*) Unexecuted instantiation: hb-ot-shaper-arabic.cc:void OT::context_closure_recurse_lookups<OT::NumType<true, unsigned int, 3u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextFormat, void const*, void (*)(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*), void*) Unexecuted instantiation: hb-ot-shape-fallback.cc:void OT::context_closure_recurse_lookups<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextFormat, void const*, void (*)(hb_set_t const*, void const*, unsigned int, hb_set_t*, void*), void*) |
1735 | | |
1736 | | template <typename context_t> |
1737 | | static inline void recurse_lookups (context_t *c, |
1738 | | unsigned int lookupCount, |
1739 | | const LookupRecord lookupRecord[] /* Array of LookupRecords--in design order */) |
1740 | 0 | { |
1741 | 0 | for (unsigned int i = 0; i < lookupCount; i++) |
1742 | 0 | c->recurse (lookupRecord[i].lookupListIndex); |
1743 | 0 | } Unexecuted instantiation: hb-ot-face.cc:void OT::recurse_lookups<OT::hb_closure_lookups_context_t>(OT::hb_closure_lookups_context_t*, unsigned int, OT::LookupRecord const*) Unexecuted instantiation: hb-ot-face.cc:void OT::recurse_lookups<OT::hb_collect_glyphs_context_t>(OT::hb_collect_glyphs_context_t*, unsigned int, OT::LookupRecord const*) Unexecuted instantiation: hb-ot-layout.cc:void OT::recurse_lookups<OT::hb_collect_glyphs_context_t>(OT::hb_collect_glyphs_context_t*, unsigned int, OT::LookupRecord const*) Unexecuted instantiation: hb-ot-layout.cc:void OT::recurse_lookups<OT::hb_closure_lookups_context_t>(OT::hb_closure_lookups_context_t*, unsigned int, OT::LookupRecord const*) Unexecuted instantiation: hb-aat-layout.cc:void OT::recurse_lookups<OT::hb_closure_lookups_context_t>(OT::hb_closure_lookups_context_t*, unsigned int, OT::LookupRecord const*) Unexecuted instantiation: hb-aat-layout.cc:void OT::recurse_lookups<OT::hb_collect_glyphs_context_t>(OT::hb_collect_glyphs_context_t*, unsigned int, OT::LookupRecord const*) Unexecuted instantiation: hb-ot-shaper-arabic.cc:void OT::recurse_lookups<OT::hb_closure_lookups_context_t>(OT::hb_closure_lookups_context_t*, unsigned int, OT::LookupRecord const*) Unexecuted instantiation: hb-ot-shaper-arabic.cc:void OT::recurse_lookups<OT::hb_collect_glyphs_context_t>(OT::hb_collect_glyphs_context_t*, unsigned int, OT::LookupRecord const*) Unexecuted instantiation: hb-ot-shape-fallback.cc:void OT::recurse_lookups<OT::hb_closure_lookups_context_t>(OT::hb_closure_lookups_context_t*, unsigned int, OT::LookupRecord const*) Unexecuted instantiation: hb-ot-shape-fallback.cc:void OT::recurse_lookups<OT::hb_collect_glyphs_context_t>(OT::hb_collect_glyphs_context_t*, unsigned int, OT::LookupRecord const*) |
1744 | | |
1745 | | static inline void apply_lookup (hb_ot_apply_context_t *c, |
1746 | | unsigned int count, /* Including the first glyph */ |
1747 | | unsigned int lookupCount, |
1748 | | const LookupRecord lookupRecord[], /* Array of LookupRecords--in design order */ |
1749 | | unsigned int match_end) |
1750 | 0 | { |
1751 | 0 | hb_buffer_t *buffer = c->buffer; |
1752 | 0 | int end; |
1753 | | |
1754 | | /* All positions are distance from beginning of *output* buffer. |
1755 | | * Adjust. */ |
1756 | 0 | { |
1757 | 0 | unsigned int bl = buffer->backtrack_len (); |
1758 | 0 | end = bl + match_end - buffer->idx; |
1759 | |
|
1760 | 0 | int delta = bl - buffer->idx; |
1761 | | /* Convert positions to new indexing. */ |
1762 | 0 | for (unsigned int j = 0; j < count; j++) |
1763 | 0 | c->match_positions.arrayZ[j] += delta; |
1764 | 0 | } |
1765 | |
|
1766 | 0 | for (unsigned int i = 0; i < lookupCount && buffer->successful; i++) |
1767 | 0 | { |
1768 | 0 | unsigned int idx = lookupRecord[i].sequenceIndex; |
1769 | 0 | if (idx >= count) |
1770 | 0 | continue; |
1771 | | |
1772 | 0 | unsigned int orig_len = buffer->backtrack_len () + buffer->lookahead_len (); |
1773 | | |
1774 | | /* This can happen if earlier recursed lookups deleted many entries. */ |
1775 | 0 | if (unlikely (c->match_positions.arrayZ[idx] >= orig_len)) |
1776 | 0 | continue; |
1777 | | |
1778 | 0 | if (unlikely (!buffer->move_to (c->match_positions.arrayZ[idx]))) |
1779 | 0 | break; |
1780 | | |
1781 | 0 | if (unlikely (buffer->max_ops <= 0)) |
1782 | 0 | break; |
1783 | | |
1784 | 0 | if (HB_BUFFER_MESSAGE_MORE && c->buffer->messaging ()) |
1785 | 0 | { |
1786 | 0 | if (buffer->have_output) |
1787 | 0 | c->buffer->sync_so_far (); |
1788 | 0 | c->buffer->message (c->font, |
1789 | 0 | "recursing to lookup %u at %u", |
1790 | 0 | (unsigned) lookupRecord[i].lookupListIndex, |
1791 | 0 | buffer->idx); |
1792 | 0 | } |
1793 | |
|
1794 | 0 | if (!c->recurse (lookupRecord[i].lookupListIndex)) |
1795 | 0 | continue; |
1796 | | |
1797 | 0 | if (HB_BUFFER_MESSAGE_MORE && c->buffer->messaging ()) |
1798 | 0 | { |
1799 | 0 | if (buffer->have_output) |
1800 | 0 | c->buffer->sync_so_far (); |
1801 | 0 | c->buffer->message (c->font, |
1802 | 0 | "recursed to lookup %u", |
1803 | 0 | (unsigned) lookupRecord[i].lookupListIndex); |
1804 | 0 | } |
1805 | |
|
1806 | 0 | unsigned int new_len = buffer->backtrack_len () + buffer->lookahead_len (); |
1807 | 0 | int delta = new_len - orig_len; |
1808 | |
|
1809 | 0 | if (!delta) |
1810 | 0 | continue; |
1811 | | |
1812 | | /* Recursed lookup changed buffer len. Adjust. |
1813 | | * |
1814 | | * TODO: |
1815 | | * |
1816 | | * Right now, if buffer length increased by n, we assume n new glyphs |
1817 | | * were added right after the current position, and if buffer length |
1818 | | * was decreased by n, we assume n match positions after the current |
1819 | | * one where removed. The former (buffer length increased) case is |
1820 | | * fine, but the decrease case can be improved in at least two ways, |
1821 | | * both of which are significant: |
1822 | | * |
1823 | | * - If recursed-to lookup is MultipleSubst and buffer length |
1824 | | * decreased, then it's current match position that was deleted, |
1825 | | * NOT the one after it. |
1826 | | * |
1827 | | * - If buffer length was decreased by n, it does not necessarily |
1828 | | * mean that n match positions where removed, as there recursed-to |
1829 | | * lookup might had a different LookupFlag. Here's a constructed |
1830 | | * case of that: |
1831 | | * https://github.com/harfbuzz/harfbuzz/discussions/3538 |
1832 | | * |
1833 | | * It should be possible to construct tests for both of these cases. |
1834 | | */ |
1835 | | |
1836 | 0 | end += delta; |
1837 | 0 | if (end < int (c->match_positions.arrayZ[idx])) |
1838 | 0 | { |
1839 | | /* End might end up being smaller than match_positions.arrayZ[idx] if the recursed |
1840 | | * lookup ended up removing many items. |
1841 | | * Just never rewind end beyond start of current position, since that is |
1842 | | * not possible in the recursed lookup. Also adjust delta as such. |
1843 | | * |
1844 | | * https://bugs.chromium.org/p/chromium/issues/detail?id=659496 |
1845 | | * https://github.com/harfbuzz/harfbuzz/issues/1611 |
1846 | | */ |
1847 | 0 | delta += c->match_positions.arrayZ[idx] - end; |
1848 | 0 | end = c->match_positions.arrayZ[idx]; |
1849 | 0 | } |
1850 | |
|
1851 | 0 | unsigned int next = idx + 1; /* next now is the position after the recursed lookup. */ |
1852 | |
|
1853 | 0 | if (delta > 0) |
1854 | 0 | { |
1855 | 0 | if (unlikely (delta + count > HB_MAX_CONTEXT_LENGTH)) |
1856 | 0 | break; |
1857 | 0 | if (unlikely (count + delta > c->match_positions.length && |
1858 | 0 | !c->match_positions.resize_dirty (count + delta))) |
1859 | 0 | return; |
1860 | 0 | } |
1861 | 0 | else |
1862 | 0 | { |
1863 | | /* NOTE: delta is non-positive. */ |
1864 | 0 | delta = hb_max (delta, (int) next - (int) count); |
1865 | 0 | next -= delta; |
1866 | 0 | } |
1867 | | |
1868 | | /* Shift! */ |
1869 | 0 | memmove (c->match_positions + next + delta, c->match_positions + next, |
1870 | 0 | (count - next) * sizeof (c->match_positions.arrayZ[0])); |
1871 | 0 | next += delta; |
1872 | 0 | count += delta; |
1873 | | |
1874 | | /* Fill in new entries. */ |
1875 | 0 | for (unsigned int j = idx + 1; j < next; j++) |
1876 | 0 | c->match_positions.arrayZ[j] = c->match_positions.arrayZ[j - 1] + 1; |
1877 | | |
1878 | | /* And fixup the rest. */ |
1879 | 0 | for (; next < count; next++) |
1880 | 0 | c->match_positions.arrayZ[next] += delta; |
1881 | 0 | } |
1882 | | |
1883 | 0 | assert (end >= 0); |
1884 | 0 | (void) buffer->move_to (end); |
1885 | 0 | } Unexecuted instantiation: hb-ot-face.cc:OT::apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, OT::LookupRecord const*, unsigned int) Unexecuted instantiation: hb-ot-layout.cc:OT::apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, OT::LookupRecord const*, unsigned int) Unexecuted instantiation: hb-aat-layout.cc:OT::apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, OT::LookupRecord const*, unsigned int) Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, OT::LookupRecord const*, unsigned int) Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::apply_lookup(OT::hb_ot_apply_context_t*, unsigned int, unsigned int, OT::LookupRecord const*, unsigned int) |
1886 | | |
1887 | | |
1888 | | |
1889 | | /* Contextual lookups */ |
1890 | | |
1891 | | struct ContextClosureLookupContext |
1892 | | { |
1893 | | ContextClosureFuncs funcs; |
1894 | | ContextFormat context_format; |
1895 | | const void *intersects_data; |
1896 | | void *intersects_cache; |
1897 | | void *intersected_glyphs_cache; |
1898 | | }; |
1899 | | |
1900 | | struct ContextCollectGlyphsLookupContext |
1901 | | { |
1902 | | ContextCollectGlyphsFuncs funcs; |
1903 | | const void *collect_data; |
1904 | | }; |
1905 | | |
1906 | | struct ContextApplyLookupContext |
1907 | | { |
1908 | | ContextApplyFuncs funcs; |
1909 | | const void *match_data; |
1910 | | }; |
1911 | | |
1912 | | template <typename HBUINT> |
1913 | | static inline bool context_intersects (const hb_set_t *glyphs, |
1914 | | unsigned int inputCount, /* Including the first glyph (not matched) */ |
1915 | | const HBUINT input[], /* Array of input values--start with second glyph */ |
1916 | | ContextClosureLookupContext &lookup_context) |
1917 | 0 | { |
1918 | 0 | return array_is_subset_of (glyphs, |
1919 | 0 | inputCount ? inputCount - 1 : 0, input, |
1920 | 0 | lookup_context.funcs.intersects, |
1921 | 0 | lookup_context.intersects_data, |
1922 | 0 | lookup_context.intersects_cache); |
1923 | 0 | } Unexecuted instantiation: hb-ot-face.cc:bool OT::context_intersects<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, OT::ContextClosureLookupContext&) Unexecuted instantiation: hb-ot-face.cc:bool OT::context_intersects<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, OT::ContextClosureLookupContext&) Unexecuted instantiation: hb-ot-layout.cc:bool OT::context_intersects<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, OT::ContextClosureLookupContext&) Unexecuted instantiation: hb-ot-layout.cc:bool OT::context_intersects<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, OT::ContextClosureLookupContext&) Unexecuted instantiation: hb-aat-layout.cc:bool OT::context_intersects<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, OT::ContextClosureLookupContext&) Unexecuted instantiation: hb-aat-layout.cc:bool OT::context_intersects<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, OT::ContextClosureLookupContext&) Unexecuted instantiation: hb-ot-shaper-arabic.cc:bool OT::context_intersects<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, OT::ContextClosureLookupContext&) Unexecuted instantiation: hb-ot-shaper-arabic.cc:bool OT::context_intersects<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, OT::ContextClosureLookupContext&) Unexecuted instantiation: hb-ot-shape-fallback.cc:bool OT::context_intersects<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, OT::ContextClosureLookupContext&) Unexecuted instantiation: hb-ot-shape-fallback.cc:bool OT::context_intersects<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, OT::ContextClosureLookupContext&) |
1924 | | |
1925 | | template <typename HBUINT> |
1926 | | static inline void context_closure_lookup (hb_closure_context_t *c, |
1927 | | unsigned int inputCount, /* Including the first glyph (not matched) */ |
1928 | | const HBUINT input[], /* Array of input values--start with second glyph */ |
1929 | | unsigned int lookupCount, |
1930 | | const LookupRecord lookupRecord[], |
1931 | | unsigned value, /* Index of first glyph in Coverage or Class value in ClassDef table */ |
1932 | | ContextClosureLookupContext &lookup_context) |
1933 | 0 | { |
1934 | 0 | if (context_intersects (c->glyphs, |
1935 | 0 | inputCount, input, |
1936 | 0 | lookup_context)) |
1937 | 0 | context_closure_recurse_lookups (c, |
1938 | 0 | inputCount, input, |
1939 | 0 | lookupCount, lookupRecord, |
1940 | 0 | value, |
1941 | 0 | lookup_context.context_format, |
1942 | 0 | lookup_context.intersects_data, |
1943 | 0 | lookup_context.funcs.intersected_glyphs, |
1944 | 0 | lookup_context.intersected_glyphs_cache); |
1945 | 0 | } Unexecuted instantiation: hb-ot-face.cc:void OT::context_closure_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextClosureLookupContext&) Unexecuted instantiation: hb-ot-face.cc:void OT::context_closure_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextClosureLookupContext&) Unexecuted instantiation: hb-ot-layout.cc:void OT::context_closure_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextClosureLookupContext&) Unexecuted instantiation: hb-ot-layout.cc:void OT::context_closure_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextClosureLookupContext&) Unexecuted instantiation: hb-aat-layout.cc:void OT::context_closure_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextClosureLookupContext&) Unexecuted instantiation: hb-aat-layout.cc:void OT::context_closure_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextClosureLookupContext&) Unexecuted instantiation: hb-ot-shaper-arabic.cc:void OT::context_closure_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextClosureLookupContext&) Unexecuted instantiation: hb-ot-shaper-arabic.cc:void OT::context_closure_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextClosureLookupContext&) Unexecuted instantiation: hb-ot-shape-fallback.cc:void OT::context_closure_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ContextClosureLookupContext&) |
1946 | | |
1947 | | template <typename HBUINT> |
1948 | | static inline void context_collect_glyphs_lookup (hb_collect_glyphs_context_t *c, |
1949 | | unsigned int inputCount, /* Including the first glyph (not matched) */ |
1950 | | const HBUINT input[], /* Array of input values--start with second glyph */ |
1951 | | unsigned int lookupCount, |
1952 | | const LookupRecord lookupRecord[], |
1953 | | ContextCollectGlyphsLookupContext &lookup_context) |
1954 | 0 | { |
1955 | 0 | collect_array (c, c->input, |
1956 | 0 | inputCount ? inputCount - 1 : 0, input, |
1957 | 0 | lookup_context.funcs.collect, lookup_context.collect_data); |
1958 | 0 | recurse_lookups (c, |
1959 | 0 | lookupCount, lookupRecord); |
1960 | 0 | } Unexecuted instantiation: hb-ot-face.cc:void OT::context_collect_glyphs_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextCollectGlyphsLookupContext&) Unexecuted instantiation: hb-ot-face.cc:void OT::context_collect_glyphs_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ContextCollectGlyphsLookupContext&) Unexecuted instantiation: hb-ot-layout.cc:void OT::context_collect_glyphs_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextCollectGlyphsLookupContext&) Unexecuted instantiation: hb-ot-layout.cc:void OT::context_collect_glyphs_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ContextCollectGlyphsLookupContext&) Unexecuted instantiation: hb-aat-layout.cc:void OT::context_collect_glyphs_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextCollectGlyphsLookupContext&) Unexecuted instantiation: hb-aat-layout.cc:void OT::context_collect_glyphs_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ContextCollectGlyphsLookupContext&) Unexecuted instantiation: hb-ot-shaper-arabic.cc:void OT::context_collect_glyphs_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextCollectGlyphsLookupContext&) Unexecuted instantiation: hb-ot-shaper-arabic.cc:void OT::context_collect_glyphs_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ContextCollectGlyphsLookupContext&) Unexecuted instantiation: hb-ot-shape-fallback.cc:void OT::context_collect_glyphs_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextCollectGlyphsLookupContext&) Unexecuted instantiation: hb-ot-shape-fallback.cc:void OT::context_collect_glyphs_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ContextCollectGlyphsLookupContext&) |
1961 | | |
1962 | | template <typename HBUINT> |
1963 | | static inline bool context_would_apply_lookup (hb_would_apply_context_t *c, |
1964 | | unsigned int inputCount, /* Including the first glyph (not matched) */ |
1965 | | const HBUINT input[], /* Array of input values--start with second glyph */ |
1966 | | unsigned int lookupCount HB_UNUSED, |
1967 | | const LookupRecord lookupRecord[] HB_UNUSED, |
1968 | | const ContextApplyLookupContext &lookup_context) |
1969 | 0 | { |
1970 | 0 | return would_match_input (c, |
1971 | 0 | inputCount, input, |
1972 | 0 | lookup_context.funcs.match, lookup_context.match_data); |
1973 | 0 | } Unexecuted instantiation: hb-ot-face.cc:bool OT::context_would_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&) Unexecuted instantiation: hb-ot-face.cc:bool OT::context_would_apply_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&) Unexecuted instantiation: hb-ot-layout.cc:bool OT::context_would_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&) Unexecuted instantiation: hb-ot-layout.cc:bool OT::context_would_apply_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&) Unexecuted instantiation: hb-aat-layout.cc:bool OT::context_would_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&) Unexecuted instantiation: hb-aat-layout.cc:bool OT::context_would_apply_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&) Unexecuted instantiation: hb-ot-shaper-arabic.cc:bool OT::context_would_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&) Unexecuted instantiation: hb-ot-shaper-arabic.cc:bool OT::context_would_apply_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&) Unexecuted instantiation: hb-ot-shape-fallback.cc:bool OT::context_would_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&) |
1974 | | |
1975 | | template <typename HBUINT> |
1976 | | HB_ALWAYS_INLINE |
1977 | | static bool context_apply_lookup (hb_ot_apply_context_t *c, |
1978 | | unsigned int inputCount, /* Including the first glyph (not matched) */ |
1979 | | const HBUINT input[], /* Array of input values--start with second glyph */ |
1980 | | unsigned int lookupCount, |
1981 | | const LookupRecord lookupRecord[], |
1982 | | const ContextApplyLookupContext &lookup_context) |
1983 | 0 | { |
1984 | 0 | if (unlikely (inputCount > HB_MAX_CONTEXT_LENGTH)) return false; |
1985 | | |
1986 | 0 | unsigned match_end = 0; |
1987 | 0 | bool ret = false; |
1988 | 0 | if (match_input (c, |
1989 | 0 | inputCount, input, |
1990 | 0 | lookup_context.funcs.match, lookup_context.match_data, |
1991 | 0 | &match_end)) |
1992 | 0 | { |
1993 | 0 | c->buffer->unsafe_to_break (c->buffer->idx, match_end); |
1994 | 0 | apply_lookup (c, |
1995 | 0 | inputCount, |
1996 | 0 | lookupCount, lookupRecord, |
1997 | 0 | match_end); |
1998 | 0 | ret = true; |
1999 | 0 | } |
2000 | 0 | else |
2001 | 0 | { |
2002 | 0 | c->buffer->unsafe_to_concat (c->buffer->idx, match_end); |
2003 | 0 | ret = false; |
2004 | 0 | } |
2005 | |
|
2006 | 0 | return ret; |
2007 | 0 | } Unexecuted instantiation: hb-ot-face.cc:bool OT::context_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&) Unexecuted instantiation: hb-ot-face.cc:bool OT::context_apply_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&) Unexecuted instantiation: hb-ot-layout.cc:bool OT::context_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&) Unexecuted instantiation: hb-ot-layout.cc:bool OT::context_apply_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&) Unexecuted instantiation: hb-aat-layout.cc:bool OT::context_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&) Unexecuted instantiation: hb-aat-layout.cc:bool OT::context_apply_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&) Unexecuted instantiation: hb-ot-shaper-arabic.cc:bool OT::context_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&) Unexecuted instantiation: hb-ot-shaper-arabic.cc:bool OT::context_apply_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&) Unexecuted instantiation: hb-ot-shape-fallback.cc:bool OT::context_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&) Unexecuted instantiation: hb-ot-shape-fallback.cc:bool OT::context_apply_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ContextApplyLookupContext const&) |
2008 | | |
2009 | | static inline bool context_cache_func (hb_ot_apply_context_t *c, hb_ot_subtable_cache_op_t op) |
2010 | 0 | { |
2011 | 0 | switch (op) |
2012 | 0 | { |
2013 | 0 | case hb_ot_subtable_cache_op_t::ENTER: |
2014 | 0 | { |
2015 | 0 | if (!HB_BUFFER_TRY_ALLOCATE_VAR (c->buffer, syllable)) |
2016 | 0 | return false; |
2017 | 0 | auto &info = c->buffer->info; |
2018 | 0 | unsigned count = c->buffer->len; |
2019 | 0 | for (unsigned i = 0; i < count; i++) |
2020 | 0 | info[i].syllable() = 255; |
2021 | 0 | c->new_syllables = 255; |
2022 | 0 | return true; |
2023 | 0 | } |
2024 | 0 | case hb_ot_subtable_cache_op_t::LEAVE: |
2025 | 0 | { |
2026 | 0 | c->new_syllables = (unsigned) -1; |
2027 | 0 | HB_BUFFER_DEALLOCATE_VAR (c->buffer, syllable); |
2028 | 0 | break; |
2029 | 0 | } |
2030 | 0 | } |
2031 | 0 | return false; |
2032 | 0 | } Unexecuted instantiation: hb-ot-face.cc:OT::context_cache_func(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t) Unexecuted instantiation: hb-ot-layout.cc:OT::context_cache_func(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t) Unexecuted instantiation: hb-aat-layout.cc:OT::context_cache_func(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t) Unexecuted instantiation: hb-ot-shaper-arabic.cc:OT::context_cache_func(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t) Unexecuted instantiation: hb-ot-shape-fallback.cc:OT::context_cache_func(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t) |
2033 | | |
2034 | | template <typename Types> |
2035 | | struct Rule |
2036 | | { |
2037 | | template <typename T> |
2038 | | friend struct RuleSet; |
2039 | | |
2040 | | bool intersects (const hb_set_t *glyphs, ContextClosureLookupContext &lookup_context) const |
2041 | 0 | { |
2042 | 0 | return context_intersects (glyphs, |
2043 | 0 | inputCount, inputZ.arrayZ, |
2044 | 0 | lookup_context); |
2045 | 0 | } Unexecuted instantiation: OT::Rule<OT::Layout::SmallTypes>::intersects(hb_set_t const*, OT::ContextClosureLookupContext&) const Unexecuted instantiation: OT::Rule<OT::Layout::MediumTypes>::intersects(hb_set_t const*, OT::ContextClosureLookupContext&) const |
2046 | | |
2047 | | void closure (hb_closure_context_t *c, unsigned value, ContextClosureLookupContext &lookup_context) const |
2048 | 0 | { |
2049 | 0 | if (unlikely (c->lookup_limit_exceeded ())) return; |
2050 | | |
2051 | 0 | const auto &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>> |
2052 | 0 | (inputZ.as_array ((inputCount ? inputCount - 1 : 0))); |
2053 | 0 | context_closure_lookup (c, |
2054 | 0 | inputCount, inputZ.arrayZ, |
2055 | 0 | lookupCount, lookupRecord.arrayZ, |
2056 | 0 | value, lookup_context); |
2057 | 0 | } Unexecuted instantiation: OT::Rule<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*, unsigned int, OT::ContextClosureLookupContext&) const Unexecuted instantiation: OT::Rule<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*, unsigned int, OT::ContextClosureLookupContext&) const |
2058 | | |
2059 | | void closure_lookups (hb_closure_lookups_context_t *c, |
2060 | | ContextClosureLookupContext &lookup_context) const |
2061 | 0 | { |
2062 | 0 | if (unlikely (c->lookup_limit_exceeded ())) return; |
2063 | 0 | if (!intersects (c->glyphs, lookup_context)) return; |
2064 | 0 |
|
2065 | 0 | const auto &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>> |
2066 | 0 | (inputZ.as_array (inputCount ? inputCount - 1 : 0)); |
2067 | 0 | recurse_lookups (c, lookupCount, lookupRecord.arrayZ); |
2068 | 0 | } Unexecuted instantiation: OT::Rule<OT::Layout::SmallTypes>::closure_lookups(OT::hb_closure_lookups_context_t*, OT::ContextClosureLookupContext&) const Unexecuted instantiation: OT::Rule<OT::Layout::MediumTypes>::closure_lookups(OT::hb_closure_lookups_context_t*, OT::ContextClosureLookupContext&) const |
2069 | | |
2070 | | void collect_glyphs (hb_collect_glyphs_context_t *c, |
2071 | | ContextCollectGlyphsLookupContext &lookup_context) const |
2072 | 0 | { |
2073 | 0 | const auto &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>> |
2074 | 0 | (inputZ.as_array (inputCount ? inputCount - 1 : 0)); |
2075 | 0 | context_collect_glyphs_lookup (c, |
2076 | 0 | inputCount, inputZ.arrayZ, |
2077 | 0 | lookupCount, lookupRecord.arrayZ, |
2078 | 0 | lookup_context); |
2079 | 0 | } Unexecuted instantiation: OT::Rule<OT::Layout::SmallTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*, OT::ContextCollectGlyphsLookupContext&) const Unexecuted instantiation: OT::Rule<OT::Layout::MediumTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*, OT::ContextCollectGlyphsLookupContext&) const |
2080 | | |
2081 | | bool would_apply (hb_would_apply_context_t *c, |
2082 | | const ContextApplyLookupContext &lookup_context) const |
2083 | 0 | { |
2084 | 0 | const auto &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>> |
2085 | 0 | (inputZ.as_array (inputCount ? inputCount - 1 : 0)); |
2086 | 0 | return context_would_apply_lookup (c, |
2087 | 0 | inputCount, inputZ.arrayZ, |
2088 | 0 | lookupCount, lookupRecord.arrayZ, |
2089 | 0 | lookup_context); |
2090 | 0 | } Unexecuted instantiation: OT::Rule<OT::Layout::SmallTypes>::would_apply(OT::hb_would_apply_context_t*, OT::ContextApplyLookupContext const&) const Unexecuted instantiation: OT::Rule<OT::Layout::MediumTypes>::would_apply(OT::hb_would_apply_context_t*, OT::ContextApplyLookupContext const&) const |
2091 | | |
2092 | | bool apply (hb_ot_apply_context_t *c, |
2093 | | const ContextApplyLookupContext &lookup_context) const |
2094 | 0 | { |
2095 | 0 | TRACE_APPLY (this); |
2096 | 0 | const auto &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>> |
2097 | 0 | (inputZ.as_array (inputCount ? inputCount - 1 : 0)); |
2098 | 0 | return_trace (context_apply_lookup (c, inputCount, inputZ.arrayZ, lookupCount, lookupRecord.arrayZ, lookup_context)); |
2099 | 0 | } Unexecuted instantiation: OT::Rule<OT::Layout::SmallTypes>::apply(OT::hb_ot_apply_context_t*, OT::ContextApplyLookupContext const&) const Unexecuted instantiation: OT::Rule<OT::Layout::MediumTypes>::apply(OT::hb_ot_apply_context_t*, OT::ContextApplyLookupContext const&) const |
2100 | | |
2101 | | bool serialize (hb_serialize_context_t *c, |
2102 | | const hb_map_t *input_mapping, /* old->new glyphid or class mapping */ |
2103 | | const hb_map_t *lookup_map) const |
2104 | 0 | { |
2105 | 0 | TRACE_SERIALIZE (this); |
2106 | 0 | auto *out = c->start_embed (this); |
2107 | 0 | if (unlikely (!c->extend_min (out))) return_trace (false); |
2108 | 0 |
|
2109 | 0 | out->inputCount = inputCount; |
2110 | 0 | const auto input = inputZ.as_array (inputCount - 1); |
2111 | 0 | for (const auto org : input) |
2112 | 0 | { |
2113 | 0 | HBUINT16 d; |
2114 | 0 | d = input_mapping->get (org); |
2115 | 0 | c->copy (d); |
2116 | 0 | } |
2117 | 0 |
|
2118 | 0 | const auto &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>> |
2119 | 0 | (inputZ.as_array ((inputCount ? inputCount - 1 : 0))); |
2120 | 0 |
|
2121 | 0 | unsigned count = serialize_lookuprecord_array (c, lookupRecord.as_array (lookupCount), lookup_map); |
2122 | 0 | return_trace (c->check_assign (out->lookupCount, count, HB_SERIALIZE_ERROR_INT_OVERFLOW)); |
2123 | 0 | } Unexecuted instantiation: OT::Rule<OT::Layout::SmallTypes>::serialize(hb_serialize_context_t*, hb_map_t const*, hb_map_t const*) const Unexecuted instantiation: OT::Rule<OT::Layout::MediumTypes>::serialize(hb_serialize_context_t*, hb_map_t const*, hb_map_t const*) const |
2124 | | |
2125 | | bool subset (hb_subset_context_t *c, |
2126 | | const hb_map_t *lookup_map, |
2127 | | const hb_map_t *klass_map = nullptr) const |
2128 | 0 | { |
2129 | 0 | TRACE_SUBSET (this); |
2130 | 0 | if (unlikely (!inputCount)) return_trace (false); |
2131 | 0 | const auto input = inputZ.as_array (inputCount - 1); |
2132 | 0 |
|
2133 | 0 | const hb_map_t *mapping = klass_map == nullptr ? c->plan->glyph_map : klass_map; |
2134 | 0 | if (!hb_all (input, mapping)) return_trace (false); |
2135 | 0 | return_trace (serialize (c->serializer, mapping, lookup_map)); |
2136 | 0 | } Unexecuted instantiation: OT::Rule<OT::Layout::SmallTypes>::subset(hb_subset_context_t*, hb_map_t const*, hb_map_t const*) const Unexecuted instantiation: OT::Rule<OT::Layout::MediumTypes>::subset(hb_subset_context_t*, hb_map_t const*, hb_map_t const*) const |
2137 | | |
2138 | | public: |
2139 | | bool sanitize (hb_sanitize_context_t *c) const |
2140 | 225k | { |
2141 | 225k | TRACE_SANITIZE (this); |
2142 | 225k | return_trace (c->check_struct (this) && |
2143 | 225k | hb_barrier () && |
2144 | 225k | c->check_range (inputZ.arrayZ, |
2145 | 225k | inputZ.item_size * (inputCount ? inputCount - 1 : 0) + |
2146 | 225k | LookupRecord::static_size * lookupCount)); |
2147 | 225k | } OT::Rule<OT::Layout::SmallTypes>::sanitize(hb_sanitize_context_t*) const Line | Count | Source | 2140 | 221k | { | 2141 | 221k | TRACE_SANITIZE (this); | 2142 | 221k | return_trace (c->check_struct (this) && | 2143 | 221k | hb_barrier () && | 2144 | 221k | c->check_range (inputZ.arrayZ, | 2145 | 221k | inputZ.item_size * (inputCount ? inputCount - 1 : 0) + | 2146 | 221k | LookupRecord::static_size * lookupCount)); | 2147 | 221k | } |
OT::Rule<OT::Layout::MediumTypes>::sanitize(hb_sanitize_context_t*) const Line | Count | Source | 2140 | 3.27k | { | 2141 | 3.27k | TRACE_SANITIZE (this); | 2142 | 3.27k | return_trace (c->check_struct (this) && | 2143 | 3.27k | hb_barrier () && | 2144 | 3.27k | c->check_range (inputZ.arrayZ, | 2145 | 3.27k | inputZ.item_size * (inputCount ? inputCount - 1 : 0) + | 2146 | 3.27k | LookupRecord::static_size * lookupCount)); | 2147 | 3.27k | } |
|
2148 | | |
2149 | | protected: |
2150 | | HBUINT16 inputCount; /* Total number of glyphs in input |
2151 | | * glyph sequence--includes the first |
2152 | | * glyph */ |
2153 | | HBUINT16 lookupCount; /* Number of LookupRecords */ |
2154 | | UnsizedArrayOf<typename Types::HBUINT> |
2155 | | inputZ; /* Array of match inputs--start with |
2156 | | * second glyph */ |
2157 | | /*UnsizedArrayOf<LookupRecord> |
2158 | | lookupRecordX;*/ /* Array of LookupRecords--in |
2159 | | * design order */ |
2160 | | public: |
2161 | | DEFINE_SIZE_ARRAY (4, inputZ); |
2162 | | }; |
2163 | | |
2164 | | template <typename Types> |
2165 | | struct RuleSet |
2166 | | { |
2167 | | using Rule = OT::Rule<Types>; |
2168 | | |
2169 | | bool intersects (const hb_set_t *glyphs, |
2170 | | ContextClosureLookupContext &lookup_context) const |
2171 | 0 | { |
2172 | 0 | return |
2173 | 0 | + hb_iter (rule) |
2174 | 0 | | hb_map (hb_add (this)) |
2175 | 0 | | hb_map ([&] (const Rule &_) { return _.intersects (glyphs, lookup_context); }) |
2176 | 0 | | hb_any |
2177 | 0 | ; |
2178 | 0 | } Unexecuted instantiation: OT::RuleSet<OT::Layout::SmallTypes>::intersects(hb_set_t const*, OT::ContextClosureLookupContext&) const Unexecuted instantiation: OT::RuleSet<OT::Layout::MediumTypes>::intersects(hb_set_t const*, OT::ContextClosureLookupContext&) const |
2179 | | |
2180 | | void closure (hb_closure_context_t *c, unsigned value, |
2181 | | ContextClosureLookupContext &lookup_context) const |
2182 | 0 | { |
2183 | 0 | if (unlikely (c->lookup_limit_exceeded ())) return; |
2184 | | |
2185 | 0 | return |
2186 | 0 | + hb_iter (rule) |
2187 | 0 | | hb_map (hb_add (this)) |
2188 | 0 | | hb_apply ([&] (const Rule &_) { _.closure (c, value, lookup_context); })Unexecuted instantiation: OT::RuleSet<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*, unsigned int, OT::ContextClosureLookupContext&) const::{lambda(OT::Rule<OT::Layout::SmallTypes> const&)#1}::operator()(OT::Rule<OT::Layout::SmallTypes> const&) constUnexecuted instantiation: OT::RuleSet<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*, unsigned int, OT::ContextClosureLookupContext&) const::{lambda(OT::Rule<OT::Layout::MediumTypes> const&)#1}::operator()(OT::Rule<OT::Layout::MediumTypes> const&) const |
2189 | 0 | ; |
2190 | 0 | } Unexecuted instantiation: OT::RuleSet<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*, unsigned int, OT::ContextClosureLookupContext&) const Unexecuted instantiation: OT::RuleSet<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*, unsigned int, OT::ContextClosureLookupContext&) const |
2191 | | |
2192 | | void closure_lookups (hb_closure_lookups_context_t *c, |
2193 | | ContextClosureLookupContext &lookup_context) const |
2194 | 0 | { |
2195 | 0 | if (unlikely (c->lookup_limit_exceeded ())) return; |
2196 | 0 | + hb_iter (rule) |
2197 | 0 | | hb_map (hb_add (this)) |
2198 | 0 | | hb_apply ([&] (const Rule &_) { _.closure_lookups (c, lookup_context); }) |
2199 | 0 | ; |
2200 | 0 | } Unexecuted instantiation: OT::RuleSet<OT::Layout::SmallTypes>::closure_lookups(OT::hb_closure_lookups_context_t*, OT::ContextClosureLookupContext&) const Unexecuted instantiation: OT::RuleSet<OT::Layout::MediumTypes>::closure_lookups(OT::hb_closure_lookups_context_t*, OT::ContextClosureLookupContext&) const |
2201 | | |
2202 | | void collect_glyphs (hb_collect_glyphs_context_t *c, |
2203 | | ContextCollectGlyphsLookupContext &lookup_context) const |
2204 | 0 | { |
2205 | 0 | return |
2206 | 0 | + hb_iter (rule) |
2207 | 0 | | hb_map (hb_add (this)) |
2208 | 0 | | hb_apply ([&] (const Rule &_) { _.collect_glyphs (c, lookup_context); })Unexecuted instantiation: OT::RuleSet<OT::Layout::SmallTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*, OT::ContextCollectGlyphsLookupContext&) const::{lambda(OT::Rule<OT::Layout::SmallTypes> const&)#1}::operator()(OT::Rule<OT::Layout::SmallTypes> const&) constUnexecuted instantiation: OT::RuleSet<OT::Layout::MediumTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*, OT::ContextCollectGlyphsLookupContext&) const::{lambda(OT::Rule<OT::Layout::MediumTypes> const&)#1}::operator()(OT::Rule<OT::Layout::MediumTypes> const&) const |
2209 | 0 | ; |
2210 | 0 | } Unexecuted instantiation: OT::RuleSet<OT::Layout::SmallTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*, OT::ContextCollectGlyphsLookupContext&) const Unexecuted instantiation: OT::RuleSet<OT::Layout::MediumTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*, OT::ContextCollectGlyphsLookupContext&) const |
2211 | | |
2212 | | bool would_apply (hb_would_apply_context_t *c, |
2213 | | const ContextApplyLookupContext &lookup_context) const |
2214 | 0 | { |
2215 | 0 | return |
2216 | 0 | + hb_iter (rule) |
2217 | 0 | | hb_map (hb_add (this)) |
2218 | 0 | | hb_map ([&] (const Rule &_) { return _.would_apply (c, lookup_context); })Unexecuted instantiation: OT::RuleSet<OT::Layout::SmallTypes>::would_apply(OT::hb_would_apply_context_t*, OT::ContextApplyLookupContext const&) const::{lambda(OT::Rule<OT::Layout::SmallTypes> const&)#1}::operator()(OT::Rule<OT::Layout::SmallTypes> const&) constUnexecuted instantiation: OT::RuleSet<OT::Layout::MediumTypes>::would_apply(OT::hb_would_apply_context_t*, OT::ContextApplyLookupContext const&) const::{lambda(OT::Rule<OT::Layout::MediumTypes> const&)#1}::operator()(OT::Rule<OT::Layout::MediumTypes> const&) const |
2219 | 0 | | hb_any |
2220 | 0 | ; |
2221 | 0 | } Unexecuted instantiation: OT::RuleSet<OT::Layout::SmallTypes>::would_apply(OT::hb_would_apply_context_t*, OT::ContextApplyLookupContext const&) const Unexecuted instantiation: OT::RuleSet<OT::Layout::MediumTypes>::would_apply(OT::hb_would_apply_context_t*, OT::ContextApplyLookupContext const&) const |
2222 | | |
2223 | | bool apply (hb_ot_apply_context_t *c, |
2224 | | const ContextApplyLookupContext &lookup_context) const |
2225 | 0 | { |
2226 | 0 | TRACE_APPLY (this); |
2227 | |
|
2228 | 0 | unsigned num_rules = rule.len; |
2229 | |
|
2230 | 0 | #ifndef HB_NO_OT_RULESETS_FAST_PATH |
2231 | 0 | if (HB_OPTIMIZE_SIZE_VAL || num_rules <= 4) |
2232 | 0 | #endif |
2233 | 0 | { |
2234 | 0 | slow: |
2235 | 0 | return_trace ( |
2236 | 0 | + hb_iter (rule) |
2237 | 0 | | hb_map (hb_add (this)) |
2238 | 0 | | hb_map ([&] (const Rule &_) { return _.apply (c, lookup_context); }) |
2239 | 0 | | hb_any |
2240 | 0 | ) |
2241 | 0 | ; |
2242 | 0 | } |
2243 | | |
2244 | | /* This version is optimized for speed by matching the first & second |
2245 | | * components of the rule here, instead of calling into the matching code. |
2246 | | * |
2247 | | * Replicated from LigatureSet::apply(). */ |
2248 | | |
2249 | 0 | auto &skippy_iter = c->iter_input; |
2250 | 0 | skippy_iter.reset (c->buffer->idx); |
2251 | 0 | skippy_iter.set_match_func (match_always, nullptr); |
2252 | 0 | skippy_iter.set_glyph_data ((HBUINT16 *) nullptr); |
2253 | 0 | unsigned unsafe_to = (unsigned) -1, unsafe_to1 = 0, unsafe_to2 = 0; |
2254 | 0 | hb_glyph_info_t *first = nullptr, *second = nullptr; |
2255 | 0 | bool matched = skippy_iter.next (); |
2256 | 0 | if (likely (matched)) |
2257 | 0 | { |
2258 | 0 | first = &c->buffer->info[skippy_iter.idx]; |
2259 | 0 | unsafe_to = skippy_iter.idx + 1; |
2260 | |
|
2261 | 0 | if (skippy_iter.may_skip (c->buffer->info[skippy_iter.idx])) |
2262 | 0 | { |
2263 | | /* Can't use the fast path if eg. the next char is a default-ignorable |
2264 | | * or other skippable. */ |
2265 | 0 | goto slow; |
2266 | 0 | } |
2267 | 0 | } |
2268 | 0 | else |
2269 | 0 | { |
2270 | | /* Failed to match a next glyph. Only try applying rules that have |
2271 | | * no further input. */ |
2272 | 0 | return_trace ( |
2273 | 0 | + hb_iter (rule) |
2274 | 0 | | hb_map (hb_add (this)) |
2275 | 0 | | hb_filter ([&] (const Rule &_) { return _.inputCount <= 1; }) |
2276 | 0 | | hb_map ([&] (const Rule &_) { return _.apply (c, lookup_context); }) |
2277 | 0 | | hb_any |
2278 | 0 | ) |
2279 | 0 | ; |
2280 | 0 | } |
2281 | 0 | matched = skippy_iter.next (); |
2282 | 0 | if (likely (matched && !skippy_iter.may_skip (c->buffer->info[skippy_iter.idx]))) |
2283 | 0 | { |
2284 | 0 | second = &c->buffer->info[skippy_iter.idx]; |
2285 | 0 | unsafe_to2 = skippy_iter.idx + 1; |
2286 | 0 | } |
2287 | |
|
2288 | 0 | auto match_input = lookup_context.funcs.match; |
2289 | 0 | auto *input_data = lookup_context.match_data; |
2290 | 0 | for (unsigned int i = 0; i < num_rules; i++) |
2291 | 0 | { |
2292 | 0 | const auto &r = this+rule.arrayZ[i]; |
2293 | |
|
2294 | 0 | const auto &input = r.inputZ; |
2295 | |
|
2296 | 0 | if (r.inputCount <= 1 || |
2297 | 0 | (!match_input || |
2298 | 0 | match_input (*first, input.arrayZ[0], input_data))) |
2299 | 0 | { |
2300 | 0 | if (!second || |
2301 | 0 | (r.inputCount <= 2 || |
2302 | 0 | (!match_input || |
2303 | 0 | match_input (*second, input.arrayZ[1], input_data))) |
2304 | 0 | ) |
2305 | 0 | { |
2306 | 0 | if (r.apply (c, lookup_context)) |
2307 | 0 | { |
2308 | 0 | if (unsafe_to != (unsigned) -1) |
2309 | 0 | c->buffer->unsafe_to_concat (c->buffer->idx, unsafe_to); |
2310 | 0 | return_trace (true); |
2311 | 0 | } |
2312 | 0 | } |
2313 | 0 | else |
2314 | 0 | unsafe_to = unsafe_to2; |
2315 | 0 | } |
2316 | 0 | else |
2317 | 0 | { |
2318 | 0 | if (unsafe_to == (unsigned) -1) |
2319 | 0 | unsafe_to = unsafe_to1; |
2320 | 0 | } |
2321 | 0 | } |
2322 | 0 | if (likely (unsafe_to != (unsigned) -1)) |
2323 | 0 | c->buffer->unsafe_to_concat (c->buffer->idx, unsafe_to); |
2324 | |
|
2325 | 0 | return_trace (false); |
2326 | 0 | } Unexecuted instantiation: OT::RuleSet<OT::Layout::SmallTypes>::apply(OT::hb_ot_apply_context_t*, OT::ContextApplyLookupContext const&) const Unexecuted instantiation: OT::RuleSet<OT::Layout::MediumTypes>::apply(OT::hb_ot_apply_context_t*, OT::ContextApplyLookupContext const&) const |
2327 | | |
2328 | | bool subset (hb_subset_context_t *c, |
2329 | | const hb_map_t *lookup_map, |
2330 | | const hb_map_t *klass_map = nullptr) const |
2331 | 0 | { |
2332 | 0 | TRACE_SUBSET (this); |
2333 | 0 |
|
2334 | 0 | auto snap = c->serializer->snapshot (); |
2335 | 0 | auto *out = c->serializer->start_embed (*this); |
2336 | 0 | if (unlikely (!c->serializer->extend_min (out))) return_trace (false); |
2337 | 0 |
|
2338 | 0 | for (const Offset16To<Rule>& _ : rule) |
2339 | 0 | { |
2340 | 0 | if (!_) continue; |
2341 | 0 | auto o_snap = c->serializer->snapshot (); |
2342 | 0 | auto *o = out->rule.serialize_append (c->serializer); |
2343 | 0 | if (unlikely (!o)) continue; |
2344 | 0 |
|
2345 | 0 | if (!o->serialize_subset (c, _, this, lookup_map, klass_map)) |
2346 | 0 | { |
2347 | 0 | out->rule.pop (); |
2348 | 0 | c->serializer->revert (o_snap); |
2349 | 0 | } |
2350 | 0 | } |
2351 | 0 |
|
2352 | 0 | bool ret = bool (out->rule); |
2353 | 0 | if (!ret) c->serializer->revert (snap); |
2354 | 0 |
|
2355 | 0 | return_trace (ret); |
2356 | 0 | } Unexecuted instantiation: OT::RuleSet<OT::Layout::SmallTypes>::subset(hb_subset_context_t*, hb_map_t const*, hb_map_t const*) const Unexecuted instantiation: OT::RuleSet<OT::Layout::MediumTypes>::subset(hb_subset_context_t*, hb_map_t const*, hb_map_t const*) const |
2357 | | |
2358 | | bool sanitize (hb_sanitize_context_t *c) const |
2359 | 4.52k | { |
2360 | 4.52k | TRACE_SANITIZE (this); |
2361 | 4.52k | return_trace (rule.sanitize (c, this)); |
2362 | 4.52k | } OT::RuleSet<OT::Layout::SmallTypes>::sanitize(hb_sanitize_context_t*) const Line | Count | Source | 2359 | 3.95k | { | 2360 | 3.95k | TRACE_SANITIZE (this); | 2361 | 3.95k | return_trace (rule.sanitize (c, this)); | 2362 | 3.95k | } |
OT::RuleSet<OT::Layout::MediumTypes>::sanitize(hb_sanitize_context_t*) const Line | Count | Source | 2359 | 571 | { | 2360 | 571 | TRACE_SANITIZE (this); | 2361 | 571 | return_trace (rule.sanitize (c, this)); | 2362 | 571 | } |
|
2363 | | |
2364 | | protected: |
2365 | | Array16OfOffset16To<Rule> |
2366 | | rule; /* Array of Rule tables |
2367 | | * ordered by preference */ |
2368 | | public: |
2369 | | DEFINE_SIZE_ARRAY (2, rule); |
2370 | | }; |
2371 | | |
2372 | | |
2373 | | template <typename Types> |
2374 | | struct ContextFormat1_4 |
2375 | | { |
2376 | | using RuleSet = OT::RuleSet<Types>; |
2377 | | |
2378 | | bool intersects (const hb_set_t *glyphs) const |
2379 | 0 | { |
2380 | 0 | struct ContextClosureLookupContext lookup_context = { |
2381 | 0 | {intersects_glyph, intersected_glyph}, |
2382 | 0 | ContextFormat::SimpleContext, |
2383 | 0 | nullptr |
2384 | 0 | }; |
2385 | 0 |
|
2386 | 0 | return |
2387 | 0 | + hb_zip (this+coverage, ruleSet) |
2388 | 0 | | hb_filter (*glyphs, hb_first) |
2389 | 0 | | hb_map (hb_second) |
2390 | 0 | | hb_map (hb_add (this)) |
2391 | 0 | | hb_map ([&] (const RuleSet &_) { return _.intersects (glyphs, lookup_context); }) |
2392 | 0 | | hb_any |
2393 | 0 | ; |
2394 | 0 | } Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::SmallTypes>::intersects(hb_set_t const*) const Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::MediumTypes>::intersects(hb_set_t const*) const |
2395 | | |
2396 | | bool may_have_non_1to1 () const |
2397 | 0 | { return true; }Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::SmallTypes>::may_have_non_1to1() const Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::MediumTypes>::may_have_non_1to1() const |
2398 | | |
2399 | | void closure (hb_closure_context_t *c) const |
2400 | 0 | { |
2401 | 0 | hb_set_t* cur_active_glyphs = c->push_cur_active_glyphs (); |
2402 | 0 | if (unlikely (!cur_active_glyphs)) return; |
2403 | 0 | get_coverage ().intersect_set (c->previous_parent_active_glyphs (), *cur_active_glyphs); |
2404 | |
|
2405 | 0 | struct ContextClosureLookupContext lookup_context = { |
2406 | 0 | {intersects_glyph, intersected_glyph}, |
2407 | 0 | ContextFormat::SimpleContext, |
2408 | 0 | nullptr |
2409 | 0 | }; |
2410 | |
|
2411 | 0 | + hb_zip (this+coverage, hb_range ((unsigned) ruleSet.len)) |
2412 | 0 | | hb_filter ([&] (hb_codepoint_t _) { |
2413 | 0 | return c->previous_parent_active_glyphs ().has (_); |
2414 | 0 | }, hb_first) Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*) const::{lambda(unsigned int)#1}::operator()(unsigned int) constUnexecuted instantiation: OT::ContextFormat1_4<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*) const::{lambda(unsigned int)#1}::operator()(unsigned int) const |
2415 | 0 | | hb_map ([&](const hb_pair_t<hb_codepoint_t, unsigned> _) { return hb_pair_t<unsigned, const RuleSet&> (_.first, this+ruleSet[_.second]); })Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*) const::{lambda(hb_pair_t<unsigned int, unsigned int>)#1}::operator()(hb_pair_t<unsigned int, unsigned int>) constUnexecuted instantiation: OT::ContextFormat1_4<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*) const::{lambda(hb_pair_t<unsigned int, unsigned int>)#1}::operator()(hb_pair_t<unsigned int, unsigned int>) const |
2416 | 0 | | hb_apply ([&] (const hb_pair_t<unsigned, const RuleSet&>& _) { _.second.closure (c, _.first, lookup_context); })Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*) const::{lambda(hb_pair_t<unsigned int, OT::RuleSet<OT::Layout::SmallTypes> const&> const&)#1}::operator()(hb_pair_t<unsigned int, OT::RuleSet<OT::Layout::SmallTypes> const&> const&) constUnexecuted instantiation: OT::ContextFormat1_4<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*) const::{lambda(hb_pair_t<unsigned int, OT::RuleSet<OT::Layout::MediumTypes> const&> const&)#1}::operator()(hb_pair_t<unsigned int, OT::RuleSet<OT::Layout::MediumTypes> const&> const&) const |
2417 | 0 | ; |
2418 | |
|
2419 | 0 | c->pop_cur_done_glyphs (); |
2420 | 0 | } Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*) const Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*) const |
2421 | | |
2422 | | void closure_lookups (hb_closure_lookups_context_t *c) const |
2423 | 0 | { |
2424 | 0 | struct ContextClosureLookupContext lookup_context = { |
2425 | 0 | {intersects_glyph, nullptr}, |
2426 | 0 | ContextFormat::SimpleContext, |
2427 | 0 | nullptr |
2428 | 0 | }; |
2429 | 0 |
|
2430 | 0 | + hb_zip (this+coverage, ruleSet) |
2431 | 0 | | hb_filter (*c->glyphs, hb_first) |
2432 | 0 | | hb_map (hb_second) |
2433 | 0 | | hb_map (hb_add (this)) |
2434 | 0 | | hb_apply ([&] (const RuleSet &_) { _.closure_lookups (c, lookup_context); }) |
2435 | 0 | ; |
2436 | 0 | } Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::SmallTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::MediumTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const |
2437 | | |
2438 | 0 | void collect_variation_indices (hb_collect_variation_indices_context_t *c) const {}Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::SmallTypes>::collect_variation_indices(OT::hb_collect_variation_indices_context_t*) const Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::MediumTypes>::collect_variation_indices(OT::hb_collect_variation_indices_context_t*) const |
2439 | | |
2440 | | void collect_glyphs (hb_collect_glyphs_context_t *c) const |
2441 | 0 | { |
2442 | 0 | (this+coverage).collect_coverage (c->input); |
2443 | |
|
2444 | 0 | struct ContextCollectGlyphsLookupContext lookup_context = { |
2445 | 0 | {collect_glyph}, |
2446 | 0 | nullptr |
2447 | 0 | }; |
2448 | |
|
2449 | 0 | + hb_iter (ruleSet) |
2450 | 0 | | hb_map (hb_add (this)) |
2451 | 0 | | hb_apply ([&] (const RuleSet &_) { _.collect_glyphs (c, lookup_context); })Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::SmallTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*) const::{lambda(OT::RuleSet<OT::Layout::SmallTypes> const&)#1}::operator()(OT::RuleSet<OT::Layout::SmallTypes> const&) constUnexecuted instantiation: OT::ContextFormat1_4<OT::Layout::MediumTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*) const::{lambda(OT::RuleSet<OT::Layout::MediumTypes> const&)#1}::operator()(OT::RuleSet<OT::Layout::MediumTypes> const&) const |
2452 | 0 | ; |
2453 | 0 | } Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::SmallTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*) const Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::MediumTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*) const |
2454 | | |
2455 | | bool would_apply (hb_would_apply_context_t *c) const |
2456 | 0 | { |
2457 | 0 | const RuleSet &rule_set = this+ruleSet[(this+coverage).get_coverage (c->glyphs[0])]; |
2458 | 0 | struct ContextApplyLookupContext lookup_context = { |
2459 | 0 | {match_glyph}, |
2460 | 0 | nullptr |
2461 | 0 | }; |
2462 | 0 | return rule_set.would_apply (c, lookup_context); |
2463 | 0 | } Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::SmallTypes>::would_apply(OT::hb_would_apply_context_t*) const Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::MediumTypes>::would_apply(OT::hb_would_apply_context_t*) const |
2464 | | |
2465 | 0 | const Coverage &get_coverage () const { return this+coverage; }Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::SmallTypes>::get_coverage() const Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::MediumTypes>::get_coverage() const |
2466 | | |
2467 | | bool apply (hb_ot_apply_context_t *c) const |
2468 | 0 | { |
2469 | 0 | TRACE_APPLY (this); |
2470 | 0 | unsigned int index = (this+coverage).get_coverage (c->buffer->cur().codepoint); |
2471 | 0 | if (likely (index == NOT_COVERED)) |
2472 | 0 | return_trace (false); |
2473 | | |
2474 | 0 | const RuleSet &rule_set = this+ruleSet[index]; |
2475 | 0 | struct ContextApplyLookupContext lookup_context = { |
2476 | 0 | {match_glyph}, |
2477 | 0 | nullptr |
2478 | 0 | }; |
2479 | 0 | return_trace (rule_set.apply (c, lookup_context)); |
2480 | 0 | } Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::SmallTypes>::apply(OT::hb_ot_apply_context_t*) const Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::MediumTypes>::apply(OT::hb_ot_apply_context_t*) const |
2481 | | |
2482 | | bool subset (hb_subset_context_t *c) const |
2483 | 0 | { |
2484 | 0 | TRACE_SUBSET (this); |
2485 | 0 | const hb_set_t &glyphset = *c->plan->glyphset_gsub (); |
2486 | 0 | const hb_map_t &glyph_map = *c->plan->glyph_map; |
2487 | 0 |
|
2488 | 0 | auto *out = c->serializer->start_embed (*this); |
2489 | 0 | if (unlikely (!c->serializer->extend_min (out))) return_trace (false); |
2490 | 0 | out->format = format; |
2491 | 0 |
|
2492 | 0 | const hb_map_t *lookup_map = c->table_tag == HB_OT_TAG_GSUB ? &c->plan->gsub_lookups : &c->plan->gpos_lookups; |
2493 | 0 | hb_sorted_vector_t<hb_codepoint_t> new_coverage; |
2494 | 0 | + hb_zip (this+coverage, ruleSet) |
2495 | 0 | | hb_filter (glyphset, hb_first) |
2496 | 0 | | hb_filter (subset_offset_array (c, out->ruleSet, this, lookup_map), hb_second) |
2497 | 0 | | hb_map (hb_first) |
2498 | 0 | | hb_map (glyph_map) |
2499 | 0 | | hb_sink (new_coverage) |
2500 | 0 | ; |
2501 | 0 |
|
2502 | 0 | out->coverage.serialize_serialize (c->serializer, new_coverage.iter ()); |
2503 | 0 | return_trace (bool (new_coverage)); |
2504 | 0 | } Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::SmallTypes>::subset(hb_subset_context_t*) const Unexecuted instantiation: OT::ContextFormat1_4<OT::Layout::MediumTypes>::subset(hb_subset_context_t*) const |
2505 | | |
2506 | | bool sanitize (hb_sanitize_context_t *c) const |
2507 | 3.78k | { |
2508 | 3.78k | TRACE_SANITIZE (this); |
2509 | 3.78k | return_trace (coverage.sanitize (c, this) && ruleSet.sanitize (c, this)); |
2510 | 3.78k | } OT::ContextFormat1_4<OT::Layout::SmallTypes>::sanitize(hb_sanitize_context_t*) const Line | Count | Source | 2507 | 2.56k | { | 2508 | 2.56k | TRACE_SANITIZE (this); | 2509 | 2.56k | return_trace (coverage.sanitize (c, this) && ruleSet.sanitize (c, this)); | 2510 | 2.56k | } |
OT::ContextFormat1_4<OT::Layout::MediumTypes>::sanitize(hb_sanitize_context_t*) const Line | Count | Source | 2507 | 1.21k | { | 2508 | 1.21k | TRACE_SANITIZE (this); | 2509 | 1.21k | return_trace (coverage.sanitize (c, this) && ruleSet.sanitize (c, this)); | 2510 | 1.21k | } |
|
2511 | | |
2512 | | protected: |
2513 | | HBUINT16 format; /* Format identifier--format = 1 */ |
2514 | | typename Types::template OffsetTo<Coverage> |
2515 | | coverage; /* Offset to Coverage table--from |
2516 | | * beginning of table */ |
2517 | | Array16Of<typename Types::template OffsetTo<RuleSet>> |
2518 | | ruleSet; /* Array of RuleSet tables |
2519 | | * ordered by Coverage Index */ |
2520 | | public: |
2521 | | DEFINE_SIZE_ARRAY (2 + 2 * Types::size, ruleSet); |
2522 | | }; |
2523 | | |
2524 | | |
2525 | | template <typename Types> |
2526 | | struct ContextFormat2_5 |
2527 | | { |
2528 | | using RuleSet = OT::RuleSet<SmallTypes>; |
2529 | | |
2530 | | bool intersects (const hb_set_t *glyphs) const |
2531 | 0 | { |
2532 | 0 | if (!(this+coverage).intersects (glyphs)) |
2533 | 0 | return false; |
2534 | 0 |
|
2535 | 0 | const ClassDef &class_def = this+classDef; |
2536 | 0 |
|
2537 | 0 | hb_map_t cache; |
2538 | 0 | struct ContextClosureLookupContext lookup_context = { |
2539 | 0 | {intersects_class, nullptr}, |
2540 | 0 | ContextFormat::ClassBasedContext, |
2541 | 0 | &class_def, |
2542 | 0 | &cache |
2543 | 0 | }; |
2544 | 0 |
|
2545 | 0 | hb_set_t retained_coverage_glyphs; |
2546 | 0 | (this+coverage).intersect_set (*glyphs, retained_coverage_glyphs); |
2547 | 0 |
|
2548 | 0 | hb_set_t coverage_glyph_classes; |
2549 | 0 | class_def.intersected_classes (&retained_coverage_glyphs, &coverage_glyph_classes); |
2550 | 0 |
|
2551 | 0 |
|
2552 | 0 | return |
2553 | 0 | + hb_iter (ruleSet) |
2554 | 0 | | hb_map (hb_add (this)) |
2555 | 0 | | hb_enumerate |
2556 | 0 | | hb_map ([&] (const hb_pair_t<unsigned, const RuleSet &> p) |
2557 | 0 | { return class_def.intersects_class (glyphs, p.first) && |
2558 | 0 | coverage_glyph_classes.has (p.first) && |
2559 | 0 | p.second.intersects (glyphs, lookup_context); }) |
2560 | 0 | | hb_any |
2561 | 0 | ; |
2562 | 0 | } Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::SmallTypes>::intersects(hb_set_t const*) const Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::intersects(hb_set_t const*) const |
2563 | | |
2564 | | bool may_have_non_1to1 () const |
2565 | 0 | { return true; }Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::SmallTypes>::may_have_non_1to1() const Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::may_have_non_1to1() const |
2566 | | |
2567 | | void closure (hb_closure_context_t *c) const |
2568 | 0 | { |
2569 | 0 | if (!(this+coverage).intersects (c->glyphs)) |
2570 | 0 | return; |
2571 | | |
2572 | 0 | hb_set_t* cur_active_glyphs = c->push_cur_active_glyphs (); |
2573 | 0 | if (unlikely (!cur_active_glyphs)) return; |
2574 | 0 | get_coverage ().intersect_set (c->previous_parent_active_glyphs (), |
2575 | 0 | *cur_active_glyphs); |
2576 | |
|
2577 | 0 | const ClassDef &class_def = this+classDef; |
2578 | |
|
2579 | 0 | hb_map_t cache; |
2580 | 0 | intersected_class_cache_t intersected_cache; |
2581 | 0 | struct ContextClosureLookupContext lookup_context = { |
2582 | 0 | {intersects_class, intersected_class_glyphs}, |
2583 | 0 | ContextFormat::ClassBasedContext, |
2584 | 0 | &class_def, |
2585 | 0 | &cache, |
2586 | 0 | &intersected_cache |
2587 | 0 | }; |
2588 | |
|
2589 | 0 | + hb_enumerate (ruleSet) |
2590 | 0 | | hb_filter ([&] (unsigned _) |
2591 | 0 | { return class_def.intersects_class (&c->parent_active_glyphs (), _); },Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*) const::{lambda(unsigned int)#1}::operator()(unsigned int) constUnexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*) const::{lambda(unsigned int)#1}::operator()(unsigned int) const |
2592 | 0 | hb_first) |
2593 | 0 | | hb_apply ([&] (const hb_pair_t<unsigned, const typename Types::template OffsetTo<RuleSet>&> _) |
2594 | 0 | { |
2595 | 0 | const RuleSet& rule_set = this+_.second; |
2596 | 0 | rule_set.closure (c, _.first, lookup_context); |
2597 | 0 | }) Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*) const::{lambda(hb_pair_t<unsigned int, OT::OffsetTo<OT::RuleSet<OT::Layout::SmallTypes>, OT::NumType<true, unsigned short, 2u>, void, true> const&>)#1}::operator()(hb_pair_t<unsigned int, OT::OffsetTo<OT::RuleSet<OT::Layout::SmallTypes>, OT::NumType<true, unsigned short, 2u>, void, true> const&>) constUnexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*) const::{lambda(hb_pair_t<unsigned int, OT::OffsetTo<OT::RuleSet<OT::Layout::SmallTypes>, OT::NumType<true, unsigned int, 3u>, void, true> const&>)#1}::operator()(hb_pair_t<unsigned int, OT::OffsetTo<OT::RuleSet<OT::Layout::SmallTypes>, OT::NumType<true, unsigned int, 3u>, void, true> const&>) const |
2598 | 0 | ; |
2599 | |
|
2600 | 0 | c->pop_cur_done_glyphs (); |
2601 | 0 | } Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*) const Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*) const |
2602 | | |
2603 | | void closure_lookups (hb_closure_lookups_context_t *c) const |
2604 | 0 | { |
2605 | 0 | if (!(this+coverage).intersects (c->glyphs)) |
2606 | 0 | return; |
2607 | 0 |
|
2608 | 0 | const ClassDef &class_def = this+classDef; |
2609 | 0 |
|
2610 | 0 | hb_map_t cache; |
2611 | 0 | struct ContextClosureLookupContext lookup_context = { |
2612 | 0 | {intersects_class, nullptr}, |
2613 | 0 | ContextFormat::ClassBasedContext, |
2614 | 0 | &class_def, |
2615 | 0 | &cache |
2616 | 0 | }; |
2617 | 0 |
|
2618 | 0 | + hb_iter (ruleSet) |
2619 | 0 | | hb_map (hb_add (this)) |
2620 | 0 | | hb_enumerate |
2621 | 0 | | hb_filter ([&] (const hb_pair_t<unsigned, const RuleSet &> p) |
2622 | 0 | { return class_def.intersects_class (c->glyphs, p.first); }) |
2623 | 0 | | hb_map (hb_second) |
2624 | 0 | | hb_apply ([&] (const RuleSet & _) |
2625 | 0 | { _.closure_lookups (c, lookup_context); }); |
2626 | 0 | } Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::SmallTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const |
2627 | | |
2628 | 0 | void collect_variation_indices (hb_collect_variation_indices_context_t *c) const {}Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::SmallTypes>::collect_variation_indices(OT::hb_collect_variation_indices_context_t*) const Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::collect_variation_indices(OT::hb_collect_variation_indices_context_t*) const |
2629 | | |
2630 | | void collect_glyphs (hb_collect_glyphs_context_t *c) const |
2631 | 0 | { |
2632 | 0 | (this+coverage).collect_coverage (c->input); |
2633 | |
|
2634 | 0 | const ClassDef &class_def = this+classDef; |
2635 | 0 | struct ContextCollectGlyphsLookupContext lookup_context = { |
2636 | 0 | {collect_class}, |
2637 | 0 | &class_def |
2638 | 0 | }; |
2639 | |
|
2640 | 0 | + hb_iter (ruleSet) |
2641 | 0 | | hb_map (hb_add (this)) |
2642 | 0 | | hb_apply ([&] (const RuleSet &_) { _.collect_glyphs (c, lookup_context); })Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::SmallTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*) const::{lambda(OT::RuleSet<OT::Layout::SmallTypes> const&)#1}::operator()(OT::RuleSet<OT::Layout::SmallTypes> const&) constUnexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*) const::{lambda(OT::RuleSet<OT::Layout::SmallTypes> const&)#1}::operator()(OT::RuleSet<OT::Layout::SmallTypes> const&) const |
2643 | 0 | ; |
2644 | 0 | } Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::SmallTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*) const Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*) const |
2645 | | |
2646 | | bool would_apply (hb_would_apply_context_t *c) const |
2647 | 0 | { |
2648 | 0 | const ClassDef &class_def = this+classDef; |
2649 | 0 | unsigned int index = class_def.get_class (c->glyphs[0]); |
2650 | 0 | const RuleSet &rule_set = this+ruleSet[index]; |
2651 | 0 | struct ContextApplyLookupContext lookup_context = { |
2652 | 0 | {match_class}, |
2653 | 0 | &class_def |
2654 | 0 | }; |
2655 | 0 | return rule_set.would_apply (c, lookup_context); |
2656 | 0 | } Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::SmallTypes>::would_apply(OT::hb_would_apply_context_t*) const Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::would_apply(OT::hb_would_apply_context_t*) const |
2657 | | |
2658 | 0 | const Coverage &get_coverage () const { return this+coverage; }Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::SmallTypes>::get_coverage() const Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::get_coverage() const |
2659 | | |
2660 | | unsigned cache_cost () const |
2661 | 0 | { |
2662 | 0 | return (this+classDef).cost (); |
2663 | 0 | } Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::SmallTypes>::cache_cost() const Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::cache_cost() const |
2664 | | static bool cache_func (hb_ot_apply_context_t *c, hb_ot_subtable_cache_op_t op) |
2665 | 0 | { |
2666 | 0 | return context_cache_func (c, op); |
2667 | 0 | } Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::SmallTypes>::cache_func(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t) Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::cache_func(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t) |
2668 | | |
2669 | 0 | bool apply_cached (hb_ot_apply_context_t *c, void *external_cache HB_UNUSED) const { return _apply (c, true); }Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::SmallTypes>::apply_cached(OT::hb_ot_apply_context_t*, void*) const Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::apply_cached(OT::hb_ot_apply_context_t*, void*) const |
2670 | 0 | bool apply (hb_ot_apply_context_t *c) const { return _apply (c, false); }Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::SmallTypes>::apply(OT::hb_ot_apply_context_t*) const Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::apply(OT::hb_ot_apply_context_t*) const |
2671 | | bool _apply (hb_ot_apply_context_t *c, bool cached) const |
2672 | 0 | { |
2673 | 0 | TRACE_APPLY (this); |
2674 | 0 | unsigned int index = (this+coverage).get_coverage (c->buffer->cur().codepoint); |
2675 | 0 | if (index == NOT_COVERED) return_trace (false); |
2676 | | |
2677 | 0 | const ClassDef &class_def = this+classDef; |
2678 | |
|
2679 | 0 | struct ContextApplyLookupContext lookup_context = { |
2680 | 0 | {cached ? match_class_cached : match_class}, |
2681 | 0 | &class_def |
2682 | 0 | }; |
2683 | |
|
2684 | 0 | index = cached ? get_class_cached (class_def, c->buffer->cur()) : class_def.get_class (c->buffer->cur().codepoint); |
2685 | 0 | const RuleSet &rule_set = this+ruleSet[index]; |
2686 | 0 | return_trace (rule_set.apply (c, lookup_context)); |
2687 | 0 | } Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::SmallTypes>::_apply(OT::hb_ot_apply_context_t*, bool) const Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::_apply(OT::hb_ot_apply_context_t*, bool) const |
2688 | | |
2689 | | bool subset (hb_subset_context_t *c) const |
2690 | 0 | { |
2691 | 0 | TRACE_SUBSET (this); |
2692 | 0 | auto *out = c->serializer->start_embed (*this); |
2693 | 0 | if (unlikely (!c->serializer->extend_min (out))) return_trace (false); |
2694 | 0 | out->format = format; |
2695 | 0 | if (unlikely (!out->coverage.serialize_subset (c, coverage, this))) |
2696 | 0 | return_trace (false); |
2697 | 0 |
|
2698 | 0 | hb_map_t klass_map; |
2699 | 0 | out->classDef.serialize_subset (c, classDef, this, &klass_map); |
2700 | 0 |
|
2701 | 0 | const hb_set_t* glyphset = c->plan->glyphset_gsub (); |
2702 | 0 | hb_set_t retained_coverage_glyphs; |
2703 | 0 | (this+coverage).intersect_set (*glyphset, retained_coverage_glyphs); |
2704 | 0 |
|
2705 | 0 | hb_set_t coverage_glyph_classes; |
2706 | 0 | (this+classDef).intersected_classes (&retained_coverage_glyphs, &coverage_glyph_classes); |
2707 | 0 |
|
2708 | 0 | const hb_map_t *lookup_map = c->table_tag == HB_OT_TAG_GSUB ? &c->plan->gsub_lookups : &c->plan->gpos_lookups; |
2709 | 0 | bool ret = true; |
2710 | 0 | int non_zero_index = -1, index = 0; |
2711 | 0 | auto snapshot = c->serializer->snapshot(); |
2712 | 0 | for (const auto& _ : + hb_enumerate (ruleSet) |
2713 | 0 | | hb_filter (klass_map, hb_first)) |
2714 | 0 | { |
2715 | 0 | auto *o = out->ruleSet.serialize_append (c->serializer); |
2716 | 0 | if (unlikely (!o)) |
2717 | 0 | { |
2718 | 0 | ret = false; |
2719 | 0 | break; |
2720 | 0 | } |
2721 | 0 |
|
2722 | 0 | if (coverage_glyph_classes.has (_.first) && |
2723 | 0 | o->serialize_subset (c, _.second, this, lookup_map, &klass_map)) { |
2724 | 0 | non_zero_index = index; |
2725 | 0 | snapshot = c->serializer->snapshot(); |
2726 | 0 | } |
2727 | 0 |
|
2728 | 0 | index++; |
2729 | 0 | } |
2730 | 0 |
|
2731 | 0 | if (!ret || non_zero_index == -1) return_trace (false); |
2732 | 0 |
|
2733 | 0 | //prune empty trailing ruleSets |
2734 | 0 | --index; |
2735 | 0 | while (index > non_zero_index) |
2736 | 0 | { |
2737 | 0 | out->ruleSet.pop (); |
2738 | 0 | index--; |
2739 | 0 | } |
2740 | 0 | c->serializer->revert (snapshot); |
2741 | 0 |
|
2742 | 0 | return_trace (bool (out->ruleSet)); |
2743 | 0 | } Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::SmallTypes>::subset(hb_subset_context_t*) const Unexecuted instantiation: OT::ContextFormat2_5<OT::Layout::MediumTypes>::subset(hb_subset_context_t*) const |
2744 | | |
2745 | | bool sanitize (hb_sanitize_context_t *c) const |
2746 | 4.31k | { |
2747 | 4.31k | TRACE_SANITIZE (this); |
2748 | 4.31k | return_trace (coverage.sanitize (c, this) && classDef.sanitize (c, this) && ruleSet.sanitize (c, this)); |
2749 | 4.31k | } OT::ContextFormat2_5<OT::Layout::SmallTypes>::sanitize(hb_sanitize_context_t*) const Line | Count | Source | 2746 | 2.53k | { | 2747 | 2.53k | TRACE_SANITIZE (this); | 2748 | 2.53k | return_trace (coverage.sanitize (c, this) && classDef.sanitize (c, this) && ruleSet.sanitize (c, this)); | 2749 | 2.53k | } |
OT::ContextFormat2_5<OT::Layout::MediumTypes>::sanitize(hb_sanitize_context_t*) const Line | Count | Source | 2746 | 1.77k | { | 2747 | 1.77k | TRACE_SANITIZE (this); | 2748 | 1.77k | return_trace (coverage.sanitize (c, this) && classDef.sanitize (c, this) && ruleSet.sanitize (c, this)); | 2749 | 1.77k | } |
|
2750 | | |
2751 | | protected: |
2752 | | HBUINT16 format; /* Format identifier--format = 2 */ |
2753 | | typename Types::template OffsetTo<Coverage> |
2754 | | coverage; /* Offset to Coverage table--from |
2755 | | * beginning of table */ |
2756 | | typename Types::template OffsetTo<ClassDef> |
2757 | | classDef; /* Offset to glyph ClassDef table--from |
2758 | | * beginning of table */ |
2759 | | Array16Of<typename Types::template OffsetTo<RuleSet>> |
2760 | | ruleSet; /* Array of RuleSet tables |
2761 | | * ordered by class */ |
2762 | | public: |
2763 | | DEFINE_SIZE_ARRAY (4 + 2 * Types::size, ruleSet); |
2764 | | }; |
2765 | | |
2766 | | |
2767 | | struct ContextFormat3 |
2768 | | { |
2769 | | using RuleSet = OT::RuleSet<SmallTypes>; |
2770 | | |
2771 | | bool intersects (const hb_set_t *glyphs) const |
2772 | 0 | { |
2773 | 0 | if (!(this+coverageZ[0]).intersects (glyphs)) |
2774 | 0 | return false; |
2775 | 0 |
|
2776 | 0 | struct ContextClosureLookupContext lookup_context = { |
2777 | 0 | {intersects_coverage, nullptr}, |
2778 | 0 | ContextFormat::CoverageBasedContext, |
2779 | 0 | this |
2780 | 0 | }; |
2781 | 0 | return context_intersects (glyphs, |
2782 | 0 | glyphCount, (const HBUINT16 *) (coverageZ.arrayZ + 1), |
2783 | 0 | lookup_context); |
2784 | 0 | } |
2785 | | |
2786 | | bool may_have_non_1to1 () const |
2787 | 0 | { return true; } |
2788 | | |
2789 | | void closure (hb_closure_context_t *c) const |
2790 | 0 | { |
2791 | 0 | if (!(this+coverageZ[0]).intersects (c->glyphs)) |
2792 | 0 | return; |
2793 | | |
2794 | 0 | hb_set_t* cur_active_glyphs = c->push_cur_active_glyphs (); |
2795 | 0 | if (unlikely (!cur_active_glyphs)) return; |
2796 | 0 | get_coverage ().intersect_set (c->previous_parent_active_glyphs (), |
2797 | 0 | *cur_active_glyphs); |
2798 | |
|
2799 | 0 | const LookupRecord *lookupRecord = &StructAfter<LookupRecord> (coverageZ.as_array (glyphCount)); |
2800 | 0 | struct ContextClosureLookupContext lookup_context = { |
2801 | 0 | {intersects_coverage, intersected_coverage_glyphs}, |
2802 | 0 | ContextFormat::CoverageBasedContext, |
2803 | 0 | this |
2804 | 0 | }; |
2805 | 0 | context_closure_lookup (c, |
2806 | 0 | glyphCount, (const HBUINT16 *) (coverageZ.arrayZ + 1), |
2807 | 0 | lookupCount, lookupRecord, |
2808 | 0 | 0, lookup_context); |
2809 | |
|
2810 | 0 | c->pop_cur_done_glyphs (); |
2811 | 0 | } |
2812 | | |
2813 | | void closure_lookups (hb_closure_lookups_context_t *c) const |
2814 | 0 | { |
2815 | 0 | if (!intersects (c->glyphs)) |
2816 | 0 | return; |
2817 | 0 | const LookupRecord *lookupRecord = &StructAfter<LookupRecord> (coverageZ.as_array (glyphCount)); |
2818 | 0 | recurse_lookups (c, lookupCount, lookupRecord); |
2819 | 0 | } |
2820 | | |
2821 | 0 | void collect_variation_indices (hb_collect_variation_indices_context_t *c) const {} |
2822 | | |
2823 | | void collect_glyphs (hb_collect_glyphs_context_t *c) const |
2824 | 0 | { |
2825 | 0 | (this+coverageZ[0]).collect_coverage (c->input); |
2826 | |
|
2827 | 0 | const LookupRecord *lookupRecord = &StructAfter<LookupRecord> (coverageZ.as_array (glyphCount)); |
2828 | 0 | struct ContextCollectGlyphsLookupContext lookup_context = { |
2829 | 0 | {collect_coverage}, |
2830 | 0 | this |
2831 | 0 | }; |
2832 | |
|
2833 | 0 | context_collect_glyphs_lookup (c, |
2834 | 0 | glyphCount, (const HBUINT16 *) (coverageZ.arrayZ + 1), |
2835 | 0 | lookupCount, lookupRecord, |
2836 | 0 | lookup_context); |
2837 | 0 | } |
2838 | | |
2839 | | bool would_apply (hb_would_apply_context_t *c) const |
2840 | 0 | { |
2841 | 0 | const LookupRecord *lookupRecord = &StructAfter<LookupRecord> (coverageZ.as_array (glyphCount)); |
2842 | 0 | struct ContextApplyLookupContext lookup_context = { |
2843 | 0 | {match_coverage}, |
2844 | 0 | this |
2845 | 0 | }; |
2846 | 0 | return context_would_apply_lookup (c, |
2847 | 0 | glyphCount, (const HBUINT16 *) (coverageZ.arrayZ + 1), |
2848 | 0 | lookupCount, lookupRecord, |
2849 | 0 | lookup_context); |
2850 | 0 | } |
2851 | | |
2852 | 0 | const Coverage &get_coverage () const { return this+coverageZ[0]; } |
2853 | | |
2854 | | bool apply (hb_ot_apply_context_t *c) const |
2855 | 0 | { |
2856 | 0 | TRACE_APPLY (this); |
2857 | 0 | unsigned int index = (this+coverageZ[0]).get_coverage (c->buffer->cur().codepoint); |
2858 | 0 | if (index == NOT_COVERED) return_trace (false); |
2859 | | |
2860 | 0 | const LookupRecord *lookupRecord = &StructAfter<LookupRecord> (coverageZ.as_array (glyphCount)); |
2861 | 0 | struct ContextApplyLookupContext lookup_context = { |
2862 | 0 | {match_coverage}, |
2863 | 0 | this |
2864 | 0 | }; |
2865 | 0 | return_trace (context_apply_lookup (c, glyphCount, (const HBUINT16 *) (coverageZ.arrayZ + 1), lookupCount, lookupRecord, lookup_context)); |
2866 | 0 | } |
2867 | | |
2868 | | bool subset (hb_subset_context_t *c) const |
2869 | 0 | { |
2870 | 0 | TRACE_SUBSET (this); |
2871 | 0 | auto *out = c->serializer->start_embed (this); |
2872 | 0 | if (unlikely (!c->serializer->extend_min (out))) return_trace (false); |
2873 | 0 |
|
2874 | 0 | out->format = format; |
2875 | 0 | out->glyphCount = glyphCount; |
2876 | 0 |
|
2877 | 0 | auto coverages = coverageZ.as_array (glyphCount); |
2878 | 0 |
|
2879 | 0 | for (const Offset16To<Coverage>& offset : coverages) |
2880 | 0 | { |
2881 | 0 | /* TODO(subset) This looks like should not be necessary to write this way. */ |
2882 | 0 | auto *o = c->serializer->allocate_size<Offset16To<Coverage>> (Offset16To<Coverage>::static_size); |
2883 | 0 | if (unlikely (!o)) return_trace (false); |
2884 | 0 | if (!o->serialize_subset (c, offset, this)) return_trace (false); |
2885 | 0 | } |
2886 | 0 |
|
2887 | 0 | const auto& lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>> (coverageZ.as_array (glyphCount)); |
2888 | 0 | const hb_map_t *lookup_map = c->table_tag == HB_OT_TAG_GSUB ? &c->plan->gsub_lookups : &c->plan->gpos_lookups; |
2889 | 0 |
|
2890 | 0 |
|
2891 | 0 | unsigned count = serialize_lookuprecord_array (c->serializer, lookupRecord.as_array (lookupCount), lookup_map); |
2892 | 0 | return_trace (c->serializer->check_assign (out->lookupCount, count, HB_SERIALIZE_ERROR_INT_OVERFLOW)); |
2893 | 0 | } |
2894 | | |
2895 | | bool sanitize (hb_sanitize_context_t *c) const |
2896 | 868 | { |
2897 | 868 | TRACE_SANITIZE (this); |
2898 | 868 | if (unlikely (!c->check_struct (this))) return_trace (false); |
2899 | 867 | hb_barrier (); |
2900 | 867 | unsigned int count = glyphCount; |
2901 | 867 | if (unlikely (!count)) return_trace (false); /* We want to access coverageZ[0] freely. */ |
2902 | 858 | if (unlikely (!c->check_array (coverageZ.arrayZ, count))) return_trace (false); |
2903 | 940k | for (unsigned int i = 0; i < count; i++) |
2904 | 940k | if (unlikely (!coverageZ[i].sanitize (c, this))) return_trace (false); |
2905 | 830 | const LookupRecord *lookupRecord = &StructAfter<LookupRecord> (coverageZ.as_array (glyphCount)); |
2906 | 830 | return_trace (likely (c->check_array (lookupRecord, lookupCount))); |
2907 | 850 | } |
2908 | | |
2909 | | protected: |
2910 | | HBUINT16 format; /* Format identifier--format = 3 */ |
2911 | | HBUINT16 glyphCount; /* Number of glyphs in the input glyph |
2912 | | * sequence */ |
2913 | | HBUINT16 lookupCount; /* Number of LookupRecords */ |
2914 | | UnsizedArrayOf<Offset16To<Coverage>> |
2915 | | coverageZ; /* Array of offsets to Coverage |
2916 | | * table in glyph sequence order */ |
2917 | | /*UnsizedArrayOf<LookupRecord> |
2918 | | lookupRecordX;*/ /* Array of LookupRecords--in |
2919 | | * design order */ |
2920 | | public: |
2921 | | DEFINE_SIZE_ARRAY (6, coverageZ); |
2922 | | }; |
2923 | | |
2924 | | struct Context |
2925 | | { |
2926 | | template <typename context_t, typename ...Ts> |
2927 | | typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const |
2928 | 20.6k | { |
2929 | 20.6k | if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value (); |
2930 | 20.5k | TRACE_DISPATCH (this, u.format.v); |
2931 | 20.5k | switch (u.format.v) { |
2932 | 2.56k | case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...)); |
2933 | 2.53k | case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...)); |
2934 | 868 | case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...)); |
2935 | 0 | #ifndef HB_NO_BEYOND_64K |
2936 | 1.21k | case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...)); |
2937 | 1.77k | case 5: hb_barrier (); return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...)); |
2938 | 0 | #endif |
2939 | 11.5k | default:return_trace (c->default_return_value ()); |
2940 | 20.5k | } |
2941 | 20.5k | } Unexecuted instantiation: OT::hb_intersects_context_t::return_t OT::Context::dispatch<OT::hb_intersects_context_t>(OT::hb_intersects_context_t*) const Unexecuted instantiation: OT::hb_ot_apply_context_t::return_t OT::Context::dispatch<OT::hb_ot_apply_context_t>(OT::hb_ot_apply_context_t*) const Unexecuted instantiation: OT::hb_collect_glyphs_context_t::return_t OT::Context::dispatch<OT::hb_collect_glyphs_context_t>(OT::hb_collect_glyphs_context_t*) const Unexecuted instantiation: OT::hb_closure_lookups_context_t::return_t OT::Context::dispatch<OT::hb_closure_lookups_context_t>(OT::hb_closure_lookups_context_t*) const Unexecuted instantiation: hb_subset_context_t::return_t OT::Context::dispatch<hb_subset_context_t>(hb_subset_context_t*) const hb_sanitize_context_t::return_t OT::Context::dispatch<hb_sanitize_context_t>(hb_sanitize_context_t*) const Line | Count | Source | 2928 | 20.6k | { | 2929 | 20.6k | if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value (); | 2930 | 20.5k | TRACE_DISPATCH (this, u.format.v); | 2931 | 20.5k | switch (u.format.v) { | 2932 | 2.56k | case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...)); | 2933 | 2.53k | case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...)); | 2934 | 868 | case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...)); | 2935 | 0 | #ifndef HB_NO_BEYOND_64K | 2936 | 1.21k | case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...)); | 2937 | 1.77k | case 5: hb_barrier (); return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...)); | 2938 | 0 | #endif | 2939 | 11.5k | default:return_trace (c->default_return_value ()); | 2940 | 20.5k | } | 2941 | 20.5k | } |
Unexecuted instantiation: OT::hb_collect_variation_indices_context_t::return_t OT::Context::dispatch<OT::hb_collect_variation_indices_context_t>(OT::hb_collect_variation_indices_context_t*) const Unexecuted instantiation: OT::hb_accelerate_subtables_context_t::return_t OT::Context::dispatch<OT::hb_accelerate_subtables_context_t>(OT::hb_accelerate_subtables_context_t*) const Unexecuted instantiation: OT::hb_have_non_1to1_context_t::return_t OT::Context::dispatch<OT::hb_have_non_1to1_context_t>(OT::hb_have_non_1to1_context_t*) const Unexecuted instantiation: OT::hb_closure_context_t::return_t OT::Context::dispatch<OT::hb_closure_context_t>(OT::hb_closure_context_t*) const Unexecuted instantiation: OT::hb_would_apply_context_t::return_t OT::Context::dispatch<OT::hb_would_apply_context_t>(OT::hb_would_apply_context_t*) const Unexecuted instantiation: hb_get_glyph_alternates_dispatch_t::return_t OT::Context::dispatch<hb_get_glyph_alternates_dispatch_t, unsigned int&, unsigned int&, unsigned int*&, unsigned int*&>(hb_get_glyph_alternates_dispatch_t*, unsigned int&, unsigned int&, unsigned int*&, unsigned int*&) const Unexecuted instantiation: hb_collect_glyph_alternates_dispatch_t::return_t OT::Context::dispatch<hb_collect_glyph_alternates_dispatch_t, hb_map_t*&, hb_map_t*&>(hb_collect_glyph_alternates_dispatch_t*, hb_map_t*&, hb_map_t*&) const Unexecuted instantiation: hb_position_single_dispatch_t::return_t OT::Context::dispatch<hb_position_single_dispatch_t, hb_font_t*&, hb_blob_t*&, hb_direction_t&, unsigned int&, hb_glyph_position_t&>(hb_position_single_dispatch_t*, hb_font_t*&, hb_blob_t*&, hb_direction_t&, unsigned int&, hb_glyph_position_t&) const |
2942 | | |
2943 | | protected: |
2944 | | union { |
2945 | | struct { HBUINT16 v; } format; /* Format identifier */ |
2946 | | ContextFormat1_4<SmallTypes> format1; |
2947 | | ContextFormat2_5<SmallTypes> format2; |
2948 | | ContextFormat3 format3; |
2949 | | #ifndef HB_NO_BEYOND_64K |
2950 | | ContextFormat1_4<MediumTypes> format4; |
2951 | | ContextFormat2_5<MediumTypes> format5; |
2952 | | #endif |
2953 | | } u; |
2954 | | }; |
2955 | | |
2956 | | |
2957 | | /* Chaining Contextual lookups */ |
2958 | | |
2959 | | struct ChainContextClosureLookupContext |
2960 | | { |
2961 | | ContextClosureFuncs funcs; |
2962 | | ContextFormat context_format; |
2963 | | const void *intersects_data[3]; |
2964 | | void *intersects_cache[3]; |
2965 | | void *intersected_glyphs_cache; |
2966 | | }; |
2967 | | |
2968 | | struct ChainContextCollectGlyphsLookupContext |
2969 | | { |
2970 | | ContextCollectGlyphsFuncs funcs; |
2971 | | const void *collect_data[3]; |
2972 | | }; |
2973 | | |
2974 | | struct ChainContextApplyLookupContext |
2975 | | { |
2976 | | ChainContextApplyFuncs funcs; |
2977 | | const void *match_data[3]; |
2978 | | }; |
2979 | | |
2980 | | template <typename HBUINT> |
2981 | | static inline bool chain_context_intersects (const hb_set_t *glyphs, |
2982 | | unsigned int backtrackCount, |
2983 | | const HBUINT backtrack[], |
2984 | | unsigned int inputCount, /* Including the first glyph (not matched) */ |
2985 | | const HBUINT input[], /* Array of input values--start with second glyph */ |
2986 | | unsigned int lookaheadCount, |
2987 | | const HBUINT lookahead[], |
2988 | | ChainContextClosureLookupContext &lookup_context) |
2989 | 0 | { |
2990 | 0 | return array_is_subset_of (glyphs, |
2991 | 0 | backtrackCount, backtrack, |
2992 | 0 | lookup_context.funcs.intersects, |
2993 | 0 | lookup_context.intersects_data[0], |
2994 | 0 | lookup_context.intersects_cache[0]) |
2995 | 0 | && array_is_subset_of (glyphs, |
2996 | 0 | inputCount ? inputCount - 1 : 0, input, |
2997 | 0 | lookup_context.funcs.intersects, |
2998 | 0 | lookup_context.intersects_data[1], |
2999 | 0 | lookup_context.intersects_cache[1]) |
3000 | 0 | && array_is_subset_of (glyphs, |
3001 | 0 | lookaheadCount, lookahead, |
3002 | 0 | lookup_context.funcs.intersects, |
3003 | 0 | lookup_context.intersects_data[2], |
3004 | 0 | lookup_context.intersects_cache[2]); |
3005 | 0 | } Unexecuted instantiation: hb-ot-face.cc:bool OT::chain_context_intersects<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, OT::ChainContextClosureLookupContext&) Unexecuted instantiation: hb-ot-face.cc:bool OT::chain_context_intersects<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, OT::ChainContextClosureLookupContext&) Unexecuted instantiation: hb-ot-layout.cc:bool OT::chain_context_intersects<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, OT::ChainContextClosureLookupContext&) Unexecuted instantiation: hb-ot-layout.cc:bool OT::chain_context_intersects<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, OT::ChainContextClosureLookupContext&) Unexecuted instantiation: hb-aat-layout.cc:bool OT::chain_context_intersects<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, OT::ChainContextClosureLookupContext&) Unexecuted instantiation: hb-aat-layout.cc:bool OT::chain_context_intersects<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, OT::ChainContextClosureLookupContext&) Unexecuted instantiation: hb-ot-shaper-arabic.cc:bool OT::chain_context_intersects<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, OT::ChainContextClosureLookupContext&) Unexecuted instantiation: hb-ot-shaper-arabic.cc:bool OT::chain_context_intersects<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, OT::ChainContextClosureLookupContext&) Unexecuted instantiation: hb-ot-shape-fallback.cc:bool OT::chain_context_intersects<OT::NumType<true, unsigned short, 2u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, OT::ChainContextClosureLookupContext&) Unexecuted instantiation: hb-ot-shape-fallback.cc:bool OT::chain_context_intersects<OT::NumType<true, unsigned int, 3u> >(hb_set_t const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, OT::ChainContextClosureLookupContext&) |
3006 | | |
3007 | | template <typename HBUINT> |
3008 | | static inline void chain_context_closure_lookup (hb_closure_context_t *c, |
3009 | | unsigned int backtrackCount, |
3010 | | const HBUINT backtrack[], |
3011 | | unsigned int inputCount, /* Including the first glyph (not matched) */ |
3012 | | const HBUINT input[], /* Array of input values--start with second glyph */ |
3013 | | unsigned int lookaheadCount, |
3014 | | const HBUINT lookahead[], |
3015 | | unsigned int lookupCount, |
3016 | | const LookupRecord lookupRecord[], |
3017 | | unsigned value, |
3018 | | ChainContextClosureLookupContext &lookup_context) |
3019 | 0 | { |
3020 | 0 | if (chain_context_intersects (c->glyphs, |
3021 | 0 | backtrackCount, backtrack, |
3022 | 0 | inputCount, input, |
3023 | 0 | lookaheadCount, lookahead, |
3024 | 0 | lookup_context)) |
3025 | 0 | context_closure_recurse_lookups (c, |
3026 | 0 | inputCount, input, |
3027 | 0 | lookupCount, lookupRecord, |
3028 | 0 | value, |
3029 | 0 | lookup_context.context_format, |
3030 | 0 | lookup_context.intersects_data[1], |
3031 | 0 | lookup_context.funcs.intersected_glyphs, |
3032 | 0 | lookup_context.intersected_glyphs_cache); |
3033 | 0 | } Unexecuted instantiation: hb-ot-face.cc:void OT::chain_context_closure_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ChainContextClosureLookupContext&) Unexecuted instantiation: hb-ot-face.cc:void OT::chain_context_closure_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ChainContextClosureLookupContext&) Unexecuted instantiation: hb-ot-layout.cc:void OT::chain_context_closure_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ChainContextClosureLookupContext&) Unexecuted instantiation: hb-ot-layout.cc:void OT::chain_context_closure_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ChainContextClosureLookupContext&) Unexecuted instantiation: hb-aat-layout.cc:void OT::chain_context_closure_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ChainContextClosureLookupContext&) Unexecuted instantiation: hb-aat-layout.cc:void OT::chain_context_closure_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ChainContextClosureLookupContext&) Unexecuted instantiation: hb-ot-shaper-arabic.cc:void OT::chain_context_closure_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ChainContextClosureLookupContext&) Unexecuted instantiation: hb-ot-shaper-arabic.cc:void OT::chain_context_closure_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ChainContextClosureLookupContext&) Unexecuted instantiation: hb-ot-shape-fallback.cc:void OT::chain_context_closure_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_closure_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, unsigned int, OT::ChainContextClosureLookupContext&) |
3034 | | |
3035 | | template <typename HBUINT> |
3036 | | static inline void chain_context_collect_glyphs_lookup (hb_collect_glyphs_context_t *c, |
3037 | | unsigned int backtrackCount, |
3038 | | const HBUINT backtrack[], |
3039 | | unsigned int inputCount, /* Including the first glyph (not matched) */ |
3040 | | const HBUINT input[], /* Array of input values--start with second glyph */ |
3041 | | unsigned int lookaheadCount, |
3042 | | const HBUINT lookahead[], |
3043 | | unsigned int lookupCount, |
3044 | | const LookupRecord lookupRecord[], |
3045 | | ChainContextCollectGlyphsLookupContext &lookup_context) |
3046 | 0 | { |
3047 | 0 | collect_array (c, c->before, |
3048 | 0 | backtrackCount, backtrack, |
3049 | 0 | lookup_context.funcs.collect, lookup_context.collect_data[0]); |
3050 | 0 | collect_array (c, c->input, |
3051 | 0 | inputCount ? inputCount - 1 : 0, input, |
3052 | 0 | lookup_context.funcs.collect, lookup_context.collect_data[1]); |
3053 | 0 | collect_array (c, c->after, |
3054 | 0 | lookaheadCount, lookahead, |
3055 | 0 | lookup_context.funcs.collect, lookup_context.collect_data[2]); |
3056 | 0 | recurse_lookups (c, |
3057 | 0 | lookupCount, lookupRecord); |
3058 | 0 | } Unexecuted instantiation: hb-ot-face.cc:void OT::chain_context_collect_glyphs_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextCollectGlyphsLookupContext&) Unexecuted instantiation: hb-ot-face.cc:void OT::chain_context_collect_glyphs_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextCollectGlyphsLookupContext&) Unexecuted instantiation: hb-ot-layout.cc:void OT::chain_context_collect_glyphs_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextCollectGlyphsLookupContext&) Unexecuted instantiation: hb-ot-layout.cc:void OT::chain_context_collect_glyphs_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextCollectGlyphsLookupContext&) Unexecuted instantiation: hb-aat-layout.cc:void OT::chain_context_collect_glyphs_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextCollectGlyphsLookupContext&) Unexecuted instantiation: hb-aat-layout.cc:void OT::chain_context_collect_glyphs_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextCollectGlyphsLookupContext&) Unexecuted instantiation: hb-ot-shaper-arabic.cc:void OT::chain_context_collect_glyphs_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextCollectGlyphsLookupContext&) Unexecuted instantiation: hb-ot-shaper-arabic.cc:void OT::chain_context_collect_glyphs_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextCollectGlyphsLookupContext&) Unexecuted instantiation: hb-ot-shape-fallback.cc:void OT::chain_context_collect_glyphs_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextCollectGlyphsLookupContext&) Unexecuted instantiation: hb-ot-shape-fallback.cc:void OT::chain_context_collect_glyphs_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_collect_glyphs_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextCollectGlyphsLookupContext&) |
3059 | | |
3060 | | template <typename HBUINT> |
3061 | | static inline bool chain_context_would_apply_lookup (hb_would_apply_context_t *c, |
3062 | | unsigned int backtrackCount, |
3063 | | const HBUINT backtrack[] HB_UNUSED, |
3064 | | unsigned int inputCount, /* Including the first glyph (not matched) */ |
3065 | | const HBUINT input[], /* Array of input values--start with second glyph */ |
3066 | | unsigned int lookaheadCount, |
3067 | | const HBUINT lookahead[] HB_UNUSED, |
3068 | | unsigned int lookupCount HB_UNUSED, |
3069 | | const LookupRecord lookupRecord[] HB_UNUSED, |
3070 | | const ChainContextApplyLookupContext &lookup_context) |
3071 | 0 | { |
3072 | 0 | return (c->zero_context ? !backtrackCount && !lookaheadCount : true) |
3073 | 0 | && would_match_input (c, |
3074 | 0 | inputCount, input, |
3075 | 0 | lookup_context.funcs.match[1], lookup_context.match_data[1]); |
3076 | 0 | } Unexecuted instantiation: hb-ot-face.cc:bool OT::chain_context_would_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&) Unexecuted instantiation: hb-ot-face.cc:bool OT::chain_context_would_apply_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&) Unexecuted instantiation: hb-ot-layout.cc:bool OT::chain_context_would_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&) Unexecuted instantiation: hb-ot-layout.cc:bool OT::chain_context_would_apply_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&) Unexecuted instantiation: hb-aat-layout.cc:bool OT::chain_context_would_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&) Unexecuted instantiation: hb-aat-layout.cc:bool OT::chain_context_would_apply_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&) Unexecuted instantiation: hb-ot-shaper-arabic.cc:bool OT::chain_context_would_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&) Unexecuted instantiation: hb-ot-shaper-arabic.cc:bool OT::chain_context_would_apply_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&) Unexecuted instantiation: hb-ot-shape-fallback.cc:bool OT::chain_context_would_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_would_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&) |
3077 | | |
3078 | | template <typename HBUINT> |
3079 | | HB_ALWAYS_INLINE |
3080 | | static bool chain_context_apply_lookup (hb_ot_apply_context_t *c, |
3081 | | unsigned int backtrackCount, |
3082 | | const HBUINT backtrack[], |
3083 | | unsigned int inputCount, /* Including the first glyph (not matched) */ |
3084 | | const HBUINT input[], /* Array of input values--start with second glyph */ |
3085 | | unsigned int lookaheadCount, |
3086 | | const HBUINT lookahead[], |
3087 | | unsigned int lookupCount, |
3088 | | const LookupRecord lookupRecord[], |
3089 | | const ChainContextApplyLookupContext &lookup_context) |
3090 | 0 | { |
3091 | 0 | if (unlikely (inputCount > HB_MAX_CONTEXT_LENGTH)) return false; |
3092 | | |
3093 | 0 | unsigned start_index = c->buffer->out_len; |
3094 | 0 | unsigned end_index = c->buffer->idx; |
3095 | 0 | unsigned match_end = 0; |
3096 | 0 | bool ret = true; |
3097 | 0 | if (!(match_input (c, |
3098 | 0 | inputCount, input, |
3099 | 0 | lookup_context.funcs.match[1], lookup_context.match_data[1], |
3100 | 0 | &match_end) && (end_index = match_end) |
3101 | 0 | && match_lookahead (c, |
3102 | 0 | lookaheadCount, lookahead, |
3103 | 0 | lookup_context.funcs.match[2], lookup_context.match_data[2], |
3104 | 0 | match_end, &end_index))) |
3105 | 0 | { |
3106 | 0 | c->buffer->unsafe_to_concat (c->buffer->idx, end_index); |
3107 | 0 | return false; |
3108 | 0 | } |
3109 | | |
3110 | 0 | if (!match_backtrack (c, |
3111 | 0 | backtrackCount, backtrack, |
3112 | 0 | lookup_context.funcs.match[0], lookup_context.match_data[0], |
3113 | 0 | &start_index)) |
3114 | 0 | { |
3115 | 0 | c->buffer->unsafe_to_concat_from_outbuffer (start_index, end_index); |
3116 | 0 | return false; |
3117 | 0 | } |
3118 | | |
3119 | 0 | c->buffer->unsafe_to_break_from_outbuffer (start_index, end_index); |
3120 | 0 | apply_lookup (c, |
3121 | 0 | inputCount, |
3122 | 0 | lookupCount, lookupRecord, |
3123 | 0 | match_end); |
3124 | |
|
3125 | 0 | return ret; |
3126 | 0 | } Unexecuted instantiation: hb-ot-face.cc:bool OT::chain_context_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&) Unexecuted instantiation: hb-ot-face.cc:bool OT::chain_context_apply_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&) Unexecuted instantiation: hb-ot-layout.cc:bool OT::chain_context_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&) Unexecuted instantiation: hb-ot-layout.cc:bool OT::chain_context_apply_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&) Unexecuted instantiation: hb-aat-layout.cc:bool OT::chain_context_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&) Unexecuted instantiation: hb-aat-layout.cc:bool OT::chain_context_apply_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&) Unexecuted instantiation: hb-ot-shaper-arabic.cc:bool OT::chain_context_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&) Unexecuted instantiation: hb-ot-shaper-arabic.cc:bool OT::chain_context_apply_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&) Unexecuted instantiation: hb-ot-shape-fallback.cc:bool OT::chain_context_apply_lookup<OT::NumType<true, unsigned short, 2u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::NumType<true, unsigned short, 2u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&) Unexecuted instantiation: hb-ot-shape-fallback.cc:bool OT::chain_context_apply_lookup<OT::NumType<true, unsigned int, 3u> >(OT::hb_ot_apply_context_t*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::NumType<true, unsigned int, 3u> const*, unsigned int, OT::LookupRecord const*, OT::ChainContextApplyLookupContext const&) |
3127 | | |
3128 | | template <typename Types> |
3129 | | struct ChainRule |
3130 | | { |
3131 | | template <typename T> |
3132 | | friend struct ChainRuleSet; |
3133 | | |
3134 | | bool intersects (const hb_set_t *glyphs, ChainContextClosureLookupContext &lookup_context) const |
3135 | 0 | { |
3136 | 0 | const auto &input = StructAfter<decltype (inputX)> (backtrack); |
3137 | 0 | const auto &lookahead = StructAfter<decltype (lookaheadX)> (input); |
3138 | 0 | return chain_context_intersects (glyphs, |
3139 | 0 | backtrack.len, backtrack.arrayZ, |
3140 | 0 | input.lenP1, input.arrayZ, |
3141 | 0 | lookahead.len, lookahead.arrayZ, |
3142 | 0 | lookup_context); |
3143 | 0 | } Unexecuted instantiation: OT::ChainRule<OT::Layout::SmallTypes>::intersects(hb_set_t const*, OT::ChainContextClosureLookupContext&) const Unexecuted instantiation: OT::ChainRule<OT::Layout::MediumTypes>::intersects(hb_set_t const*, OT::ChainContextClosureLookupContext&) const |
3144 | | |
3145 | | void closure (hb_closure_context_t *c, unsigned value, |
3146 | | ChainContextClosureLookupContext &lookup_context) const |
3147 | 0 | { |
3148 | 0 | if (unlikely (c->lookup_limit_exceeded ())) return; |
3149 | | |
3150 | 0 | const auto &input = StructAfter<decltype (inputX)> (backtrack); |
3151 | 0 | const auto &lookahead = StructAfter<decltype (lookaheadX)> (input); |
3152 | 0 | const auto &lookup = StructAfter<decltype (lookupX)> (lookahead); |
3153 | 0 | chain_context_closure_lookup (c, |
3154 | 0 | backtrack.len, backtrack.arrayZ, |
3155 | 0 | input.lenP1, input.arrayZ, |
3156 | 0 | lookahead.len, lookahead.arrayZ, |
3157 | 0 | lookup.len, lookup.arrayZ, |
3158 | 0 | value, |
3159 | 0 | lookup_context); |
3160 | 0 | } Unexecuted instantiation: OT::ChainRule<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*, unsigned int, OT::ChainContextClosureLookupContext&) const Unexecuted instantiation: OT::ChainRule<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*, unsigned int, OT::ChainContextClosureLookupContext&) const |
3161 | | |
3162 | | void closure_lookups (hb_closure_lookups_context_t *c, |
3163 | | ChainContextClosureLookupContext &lookup_context) const |
3164 | 0 | { |
3165 | 0 | if (unlikely (c->lookup_limit_exceeded ())) return; |
3166 | 0 | if (!intersects (c->glyphs, lookup_context)) return; |
3167 | 0 |
|
3168 | 0 | const auto &input = StructAfter<decltype (inputX)> (backtrack); |
3169 | 0 | const auto &lookahead = StructAfter<decltype (lookaheadX)> (input); |
3170 | 0 | const auto &lookup = StructAfter<decltype (lookupX)> (lookahead); |
3171 | 0 | recurse_lookups (c, lookup.len, lookup.arrayZ); |
3172 | 0 | } Unexecuted instantiation: OT::ChainRule<OT::Layout::SmallTypes>::closure_lookups(OT::hb_closure_lookups_context_t*, OT::ChainContextClosureLookupContext&) const Unexecuted instantiation: OT::ChainRule<OT::Layout::MediumTypes>::closure_lookups(OT::hb_closure_lookups_context_t*, OT::ChainContextClosureLookupContext&) const |
3173 | | |
3174 | | void collect_glyphs (hb_collect_glyphs_context_t *c, |
3175 | | ChainContextCollectGlyphsLookupContext &lookup_context) const |
3176 | 0 | { |
3177 | 0 | const auto &input = StructAfter<decltype (inputX)> (backtrack); |
3178 | 0 | const auto &lookahead = StructAfter<decltype (lookaheadX)> (input); |
3179 | 0 | const auto &lookup = StructAfter<decltype (lookupX)> (lookahead); |
3180 | 0 | chain_context_collect_glyphs_lookup (c, |
3181 | 0 | backtrack.len, backtrack.arrayZ, |
3182 | 0 | input.lenP1, input.arrayZ, |
3183 | 0 | lookahead.len, lookahead.arrayZ, |
3184 | 0 | lookup.len, lookup.arrayZ, |
3185 | 0 | lookup_context); |
3186 | 0 | } Unexecuted instantiation: OT::ChainRule<OT::Layout::SmallTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*, OT::ChainContextCollectGlyphsLookupContext&) const Unexecuted instantiation: OT::ChainRule<OT::Layout::MediumTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*, OT::ChainContextCollectGlyphsLookupContext&) const |
3187 | | |
3188 | | bool would_apply (hb_would_apply_context_t *c, |
3189 | | const ChainContextApplyLookupContext &lookup_context) const |
3190 | 0 | { |
3191 | 0 | const auto &input = StructAfter<decltype (inputX)> (backtrack); |
3192 | 0 | const auto &lookahead = StructAfter<decltype (lookaheadX)> (input); |
3193 | 0 | const auto &lookup = StructAfter<decltype (lookupX)> (lookahead); |
3194 | 0 | return chain_context_would_apply_lookup (c, |
3195 | 0 | backtrack.len, backtrack.arrayZ, |
3196 | 0 | input.lenP1, input.arrayZ, |
3197 | 0 | lookahead.len, lookahead.arrayZ, lookup.len, |
3198 | 0 | lookup.arrayZ, lookup_context); |
3199 | 0 | } Unexecuted instantiation: OT::ChainRule<OT::Layout::SmallTypes>::would_apply(OT::hb_would_apply_context_t*, OT::ChainContextApplyLookupContext const&) const Unexecuted instantiation: OT::ChainRule<OT::Layout::MediumTypes>::would_apply(OT::hb_would_apply_context_t*, OT::ChainContextApplyLookupContext const&) const |
3200 | | |
3201 | | bool apply (hb_ot_apply_context_t *c, |
3202 | | const ChainContextApplyLookupContext &lookup_context) const |
3203 | 0 | { |
3204 | 0 | TRACE_APPLY (this); |
3205 | 0 | const auto &input = StructAfter<decltype (inputX)> (backtrack); |
3206 | 0 | const auto &lookahead = StructAfter<decltype (lookaheadX)> (input); |
3207 | 0 | const auto &lookup = StructAfter<decltype (lookupX)> (lookahead); |
3208 | 0 | return_trace (chain_context_apply_lookup (c, |
3209 | 0 | backtrack.len, backtrack.arrayZ, |
3210 | 0 | input.lenP1, input.arrayZ, |
3211 | 0 | lookahead.len, lookahead.arrayZ, lookup.len, |
3212 | 0 | lookup.arrayZ, lookup_context)); |
3213 | 0 | } Unexecuted instantiation: OT::ChainRule<OT::Layout::SmallTypes>::apply(OT::hb_ot_apply_context_t*, OT::ChainContextApplyLookupContext const&) const Unexecuted instantiation: OT::ChainRule<OT::Layout::MediumTypes>::apply(OT::hb_ot_apply_context_t*, OT::ChainContextApplyLookupContext const&) const |
3214 | | |
3215 | | template<typename Iterator, |
3216 | | hb_requires (hb_is_iterator (Iterator))> |
3217 | | void serialize_array (hb_serialize_context_t *c, |
3218 | | HBUINT16 len, |
3219 | | Iterator it) const |
3220 | 0 | { |
3221 | 0 | c->copy (len); |
3222 | 0 | for (const auto g : it) |
3223 | 0 | c->copy ((HBUINT16) g); |
3224 | 0 | } Unexecuted instantiation: _ZNK2OT9ChainRuleINS_6Layout10SmallTypesEE15serialize_arrayI13hb_map_iter_tI10hb_array_tIKNS_7NumTypeILb1EtLj2EEEERPK8hb_map_tL24hb_function_sortedness_t0ELPv0EETnPN12hb_enable_ifIXsr17hb_is_iterator_ofIT_NSJ_6item_tEEE5valueEvE4typeELSG_0EEEvP22hb_serialize_context_tS8_SJ_ Unexecuted instantiation: _ZNK2OT9ChainRuleINS_6Layout11MediumTypesEE15serialize_arrayI13hb_map_iter_tI10hb_array_tIKNS_7NumTypeILb1EjLj3EEEERPK8hb_map_tL24hb_function_sortedness_t0ELPv0EETnPN12hb_enable_ifIXsr17hb_is_iterator_ofIT_NSJ_6item_tEEE5valueEvE4typeELSG_0EEEvP22hb_serialize_context_tNS7_ILb1EtLj2EEESJ_ |
3225 | | |
3226 | | bool serialize (hb_serialize_context_t *c, |
3227 | | const hb_map_t *lookup_map, |
3228 | | const hb_map_t *backtrack_map, |
3229 | | const hb_map_t *input_map = nullptr, |
3230 | | const hb_map_t *lookahead_map = nullptr) const |
3231 | 0 | { |
3232 | 0 | TRACE_SERIALIZE (this); |
3233 | 0 |
|
3234 | 0 | const hb_map_t *mapping = backtrack_map; |
3235 | 0 | serialize_array (c, backtrack.len, + backtrack.iter () |
3236 | 0 | | hb_map (mapping)); |
3237 | 0 |
|
3238 | 0 | const auto &input = StructAfter<decltype (inputX)> (backtrack); |
3239 | 0 | if (input_map) mapping = input_map; |
3240 | 0 | serialize_array (c, input.lenP1, + input.iter () |
3241 | 0 | | hb_map (mapping)); |
3242 | 0 |
|
3243 | 0 | const auto &lookahead = StructAfter<decltype (lookaheadX)> (input); |
3244 | 0 | if (lookahead_map) mapping = lookahead_map; |
3245 | 0 | serialize_array (c, lookahead.len, + lookahead.iter () |
3246 | 0 | | hb_map (mapping)); |
3247 | 0 |
|
3248 | 0 | const auto &lookup = StructAfter<decltype (lookupX)> (lookahead); |
3249 | 0 |
|
3250 | 0 | HBUINT16* lookupCount = c->embed (&(lookup.len)); |
3251 | 0 | if (!lookupCount) return_trace (false); |
3252 | 0 |
|
3253 | 0 | unsigned count = serialize_lookuprecord_array (c, lookup.as_array (), lookup_map); |
3254 | 0 | return_trace (c->check_assign (*lookupCount, count, HB_SERIALIZE_ERROR_INT_OVERFLOW)); |
3255 | 0 | } Unexecuted instantiation: OT::ChainRule<OT::Layout::SmallTypes>::serialize(hb_serialize_context_t*, hb_map_t const*, hb_map_t const*, hb_map_t const*, hb_map_t const*) const Unexecuted instantiation: OT::ChainRule<OT::Layout::MediumTypes>::serialize(hb_serialize_context_t*, hb_map_t const*, hb_map_t const*, hb_map_t const*, hb_map_t const*) const |
3256 | | |
3257 | | bool subset (hb_subset_context_t *c, |
3258 | | const hb_map_t *lookup_map, |
3259 | | const hb_map_t *backtrack_map = nullptr, |
3260 | | const hb_map_t *input_map = nullptr, |
3261 | | const hb_map_t *lookahead_map = nullptr) const |
3262 | 0 | { |
3263 | 0 | TRACE_SUBSET (this); |
3264 | 0 |
|
3265 | 0 | const auto &input = StructAfter<decltype (inputX)> (backtrack); |
3266 | 0 | const auto &lookahead = StructAfter<decltype (lookaheadX)> (input); |
3267 | 0 |
|
3268 | 0 | if (!backtrack_map) |
3269 | 0 | { |
3270 | 0 | const hb_set_t &glyphset = *c->plan->glyphset_gsub (); |
3271 | 0 | if (!hb_all (backtrack, glyphset) || |
3272 | 0 | !hb_all (input, glyphset) || |
3273 | 0 | !hb_all (lookahead, glyphset)) |
3274 | 0 | return_trace (false); |
3275 | 0 |
|
3276 | 0 | serialize (c->serializer, lookup_map, c->plan->glyph_map); |
3277 | 0 | } |
3278 | 0 | else |
3279 | 0 | { |
3280 | 0 | if (!hb_all (backtrack, backtrack_map) || |
3281 | 0 | !hb_all (input, input_map) || |
3282 | 0 | !hb_all (lookahead, lookahead_map)) |
3283 | 0 | return_trace (false); |
3284 | 0 |
|
3285 | 0 | serialize (c->serializer, lookup_map, backtrack_map, input_map, lookahead_map); |
3286 | 0 | } |
3287 | 0 |
|
3288 | 0 | return_trace (true); |
3289 | 0 | } Unexecuted instantiation: OT::ChainRule<OT::Layout::SmallTypes>::subset(hb_subset_context_t*, hb_map_t const*, hb_map_t const*, hb_map_t const*, hb_map_t const*) const Unexecuted instantiation: OT::ChainRule<OT::Layout::MediumTypes>::subset(hb_subset_context_t*, hb_map_t const*, hb_map_t const*, hb_map_t const*, hb_map_t const*) const |
3290 | | |
3291 | | bool sanitize (hb_sanitize_context_t *c) const |
3292 | 676k | { |
3293 | 676k | TRACE_SANITIZE (this); |
3294 | | /* Hyper-optimized sanitized because this is really hot. */ |
3295 | 676k | if (unlikely (!backtrack.len.sanitize (c))) return_trace (false); |
3296 | 676k | hb_barrier (); |
3297 | 676k | const auto &input = StructAfter<decltype (inputX)> (backtrack); |
3298 | 676k | if (unlikely (!input.lenP1.sanitize (c))) return_trace (false); |
3299 | 676k | hb_barrier (); |
3300 | 676k | const auto &lookahead = StructAfter<decltype (lookaheadX)> (input); |
3301 | 676k | if (unlikely (!lookahead.len.sanitize (c))) return_trace (false); |
3302 | 676k | hb_barrier (); |
3303 | 676k | const auto &lookup = StructAfter<decltype (lookupX)> (lookahead); |
3304 | 676k | return_trace (likely (lookup.sanitize (c))); |
3305 | 676k | } OT::ChainRule<OT::Layout::SmallTypes>::sanitize(hb_sanitize_context_t*) const Line | Count | Source | 3292 | 651k | { | 3293 | 651k | TRACE_SANITIZE (this); | 3294 | | /* Hyper-optimized sanitized because this is really hot. */ | 3295 | 651k | if (unlikely (!backtrack.len.sanitize (c))) return_trace (false); | 3296 | 651k | hb_barrier (); | 3297 | 651k | const auto &input = StructAfter<decltype (inputX)> (backtrack); | 3298 | 651k | if (unlikely (!input.lenP1.sanitize (c))) return_trace (false); | 3299 | 651k | hb_barrier (); | 3300 | 651k | const auto &lookahead = StructAfter<decltype (lookaheadX)> (input); | 3301 | 651k | if (unlikely (!lookahead.len.sanitize (c))) return_trace (false); | 3302 | 651k | hb_barrier (); | 3303 | 651k | const auto &lookup = StructAfter<decltype (lookupX)> (lookahead); | 3304 | 651k | return_trace (likely (lookup.sanitize (c))); | 3305 | 651k | } |
OT::ChainRule<OT::Layout::MediumTypes>::sanitize(hb_sanitize_context_t*) const Line | Count | Source | 3292 | 24.5k | { | 3293 | 24.5k | TRACE_SANITIZE (this); | 3294 | | /* Hyper-optimized sanitized because this is really hot. */ | 3295 | 24.5k | if (unlikely (!backtrack.len.sanitize (c))) return_trace (false); | 3296 | 24.5k | hb_barrier (); | 3297 | 24.5k | const auto &input = StructAfter<decltype (inputX)> (backtrack); | 3298 | 24.5k | if (unlikely (!input.lenP1.sanitize (c))) return_trace (false); | 3299 | 24.5k | hb_barrier (); | 3300 | 24.5k | const auto &lookahead = StructAfter<decltype (lookaheadX)> (input); | 3301 | 24.5k | if (unlikely (!lookahead.len.sanitize (c))) return_trace (false); | 3302 | 24.5k | hb_barrier (); | 3303 | 24.5k | const auto &lookup = StructAfter<decltype (lookupX)> (lookahead); | 3304 | 24.5k | return_trace (likely (lookup.sanitize (c))); | 3305 | 24.5k | } |
|
3306 | | |
3307 | | protected: |
3308 | | Array16Of<typename Types::HBUINT> |
3309 | | backtrack; /* Array of backtracking values |
3310 | | * (to be matched before the input |
3311 | | * sequence) */ |
3312 | | HeadlessArray16Of<typename Types::HBUINT> |
3313 | | inputX; /* Array of input values (start with |
3314 | | * second glyph) */ |
3315 | | Array16Of<typename Types::HBUINT> |
3316 | | lookaheadX; /* Array of lookahead values's (to be |
3317 | | * matched after the input sequence) */ |
3318 | | Array16Of<LookupRecord> |
3319 | | lookupX; /* Array of LookupRecords--in |
3320 | | * design order) */ |
3321 | | public: |
3322 | | DEFINE_SIZE_MIN (8); |
3323 | | }; |
3324 | | |
3325 | | template <typename Types> |
3326 | | struct ChainRuleSet |
3327 | | { |
3328 | | using ChainRule = OT::ChainRule<Types>; |
3329 | | |
3330 | | bool intersects (const hb_set_t *glyphs, ChainContextClosureLookupContext &lookup_context) const |
3331 | 0 | { |
3332 | 0 | return |
3333 | 0 | + hb_iter (rule) |
3334 | 0 | | hb_map (hb_add (this)) |
3335 | 0 | | hb_map ([&] (const ChainRule &_) { return _.intersects (glyphs, lookup_context); }) |
3336 | 0 | | hb_any |
3337 | 0 | ; |
3338 | 0 | } Unexecuted instantiation: OT::ChainRuleSet<OT::Layout::SmallTypes>::intersects(hb_set_t const*, OT::ChainContextClosureLookupContext&) const Unexecuted instantiation: OT::ChainRuleSet<OT::Layout::MediumTypes>::intersects(hb_set_t const*, OT::ChainContextClosureLookupContext&) const |
3339 | | void closure (hb_closure_context_t *c, unsigned value, ChainContextClosureLookupContext &lookup_context) const |
3340 | 0 | { |
3341 | 0 | if (unlikely (c->lookup_limit_exceeded ())) return; |
3342 | | |
3343 | 0 | return |
3344 | 0 | + hb_iter (rule) |
3345 | 0 | | hb_map (hb_add (this)) |
3346 | 0 | | hb_apply ([&] (const ChainRule &_) { _.closure (c, value, lookup_context); })Unexecuted instantiation: OT::ChainRuleSet<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*, unsigned int, OT::ChainContextClosureLookupContext&) const::{lambda(OT::ChainRule<OT::Layout::SmallTypes> const&)#1}::operator()(OT::ChainRule<OT::Layout::SmallTypes> const&) constUnexecuted instantiation: OT::ChainRuleSet<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*, unsigned int, OT::ChainContextClosureLookupContext&) const::{lambda(OT::ChainRule<OT::Layout::MediumTypes> const&)#1}::operator()(OT::ChainRule<OT::Layout::MediumTypes> const&) const |
3347 | 0 | ; |
3348 | 0 | } Unexecuted instantiation: OT::ChainRuleSet<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*, unsigned int, OT::ChainContextClosureLookupContext&) const Unexecuted instantiation: OT::ChainRuleSet<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*, unsigned int, OT::ChainContextClosureLookupContext&) const |
3349 | | |
3350 | | void closure_lookups (hb_closure_lookups_context_t *c, |
3351 | | ChainContextClosureLookupContext &lookup_context) const |
3352 | 0 | { |
3353 | 0 | if (unlikely (c->lookup_limit_exceeded ())) return; |
3354 | 0 |
|
3355 | 0 | + hb_iter (rule) |
3356 | 0 | | hb_map (hb_add (this)) |
3357 | 0 | | hb_apply ([&] (const ChainRule &_) { _.closure_lookups (c, lookup_context); }) |
3358 | 0 | ; |
3359 | 0 | } Unexecuted instantiation: OT::ChainRuleSet<OT::Layout::SmallTypes>::closure_lookups(OT::hb_closure_lookups_context_t*, OT::ChainContextClosureLookupContext&) const Unexecuted instantiation: OT::ChainRuleSet<OT::Layout::MediumTypes>::closure_lookups(OT::hb_closure_lookups_context_t*, OT::ChainContextClosureLookupContext&) const |
3360 | | |
3361 | | void collect_glyphs (hb_collect_glyphs_context_t *c, ChainContextCollectGlyphsLookupContext &lookup_context) const |
3362 | 0 | { |
3363 | 0 | return |
3364 | 0 | + hb_iter (rule) |
3365 | 0 | | hb_map (hb_add (this)) |
3366 | 0 | | hb_apply ([&] (const ChainRule &_) { _.collect_glyphs (c, lookup_context); })Unexecuted instantiation: OT::ChainRuleSet<OT::Layout::SmallTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*, OT::ChainContextCollectGlyphsLookupContext&) const::{lambda(OT::ChainRule<OT::Layout::SmallTypes> const&)#1}::operator()(OT::ChainRule<OT::Layout::SmallTypes> const&) constUnexecuted instantiation: OT::ChainRuleSet<OT::Layout::MediumTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*, OT::ChainContextCollectGlyphsLookupContext&) const::{lambda(OT::ChainRule<OT::Layout::MediumTypes> const&)#1}::operator()(OT::ChainRule<OT::Layout::MediumTypes> const&) const |
3367 | 0 | ; |
3368 | 0 | } Unexecuted instantiation: OT::ChainRuleSet<OT::Layout::SmallTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*, OT::ChainContextCollectGlyphsLookupContext&) const Unexecuted instantiation: OT::ChainRuleSet<OT::Layout::MediumTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*, OT::ChainContextCollectGlyphsLookupContext&) const |
3369 | | |
3370 | | bool would_apply (hb_would_apply_context_t *c, |
3371 | | const ChainContextApplyLookupContext &lookup_context) const |
3372 | 0 | { |
3373 | 0 | return |
3374 | 0 | + hb_iter (rule) |
3375 | 0 | | hb_map (hb_add (this)) |
3376 | 0 | | hb_map ([&] (const ChainRule &_) { return _.would_apply (c, lookup_context); })Unexecuted instantiation: OT::ChainRuleSet<OT::Layout::SmallTypes>::would_apply(OT::hb_would_apply_context_t*, OT::ChainContextApplyLookupContext const&) const::{lambda(OT::ChainRule<OT::Layout::SmallTypes> const&)#1}::operator()(OT::ChainRule<OT::Layout::SmallTypes> const&) constUnexecuted instantiation: OT::ChainRuleSet<OT::Layout::MediumTypes>::would_apply(OT::hb_would_apply_context_t*, OT::ChainContextApplyLookupContext const&) const::{lambda(OT::ChainRule<OT::Layout::MediumTypes> const&)#1}::operator()(OT::ChainRule<OT::Layout::MediumTypes> const&) const |
3377 | 0 | | hb_any |
3378 | 0 | ; |
3379 | 0 | } Unexecuted instantiation: OT::ChainRuleSet<OT::Layout::SmallTypes>::would_apply(OT::hb_would_apply_context_t*, OT::ChainContextApplyLookupContext const&) const Unexecuted instantiation: OT::ChainRuleSet<OT::Layout::MediumTypes>::would_apply(OT::hb_would_apply_context_t*, OT::ChainContextApplyLookupContext const&) const |
3380 | | |
3381 | | bool apply (hb_ot_apply_context_t *c, |
3382 | | const ChainContextApplyLookupContext &lookup_context) const |
3383 | 0 | { |
3384 | 0 | TRACE_APPLY (this); |
3385 | |
|
3386 | 0 | unsigned num_rules = rule.len; |
3387 | |
|
3388 | 0 | #ifndef HB_NO_OT_RULESETS_FAST_PATH |
3389 | 0 | if (HB_OPTIMIZE_SIZE_VAL || num_rules <= 4) |
3390 | 0 | #endif |
3391 | 0 | { |
3392 | 0 | slow: |
3393 | 0 | return_trace ( |
3394 | 0 | + hb_iter (rule) |
3395 | 0 | | hb_map (hb_add (this)) |
3396 | 0 | | hb_map ([&] (const ChainRule &_) { return _.apply (c, lookup_context); }) |
3397 | 0 | | hb_any |
3398 | 0 | ) |
3399 | 0 | ; |
3400 | 0 | } |
3401 | | |
3402 | | /* This version is optimized for speed by matching the first & second |
3403 | | * components of the rule here, instead of calling into the matching code. |
3404 | | * |
3405 | | * Replicated from LigatureSet::apply(). */ |
3406 | | |
3407 | | /* If the input skippy has non-auto joiners behavior (as in Indic shapers), |
3408 | | * skip this fast path, as we don't distinguish between input & lookahead |
3409 | | * matching in the fast path. |
3410 | | * |
3411 | | * https://github.com/harfbuzz/harfbuzz/issues/4813 |
3412 | | */ |
3413 | 0 | if (!c->auto_zwnj || !c->auto_zwj) |
3414 | 0 | goto slow; |
3415 | | |
3416 | 0 | auto &skippy_iter = c->iter_input; |
3417 | 0 | skippy_iter.reset (c->buffer->idx); |
3418 | 0 | skippy_iter.set_match_func (match_always, nullptr); |
3419 | 0 | skippy_iter.set_glyph_data ((HBUINT16 *) nullptr); |
3420 | 0 | unsigned unsafe_to = (unsigned) -1, unsafe_to1 = 0, unsafe_to2 = 0; |
3421 | 0 | hb_glyph_info_t *first = nullptr, *second = nullptr; |
3422 | 0 | bool matched = skippy_iter.next (); |
3423 | 0 | if (likely (matched)) |
3424 | 0 | { |
3425 | 0 | first = &c->buffer->info[skippy_iter.idx]; |
3426 | 0 | unsafe_to1 = skippy_iter.idx + 1; |
3427 | |
|
3428 | 0 | if (skippy_iter.may_skip (c->buffer->info[skippy_iter.idx])) |
3429 | 0 | { |
3430 | | /* Can't use the fast path if eg. the next char is a default-ignorable |
3431 | | * or other skippable. */ |
3432 | 0 | goto slow; |
3433 | 0 | } |
3434 | 0 | } |
3435 | 0 | else |
3436 | 0 | { |
3437 | | /* Failed to match a next glyph. Only try applying rules that have |
3438 | | * no further input and lookahead. */ |
3439 | 0 | return_trace ( |
3440 | 0 | + hb_iter (rule) |
3441 | 0 | | hb_map (hb_add (this)) |
3442 | 0 | | hb_filter ([&] (const ChainRule &_) |
3443 | 0 | { |
3444 | 0 | const auto &input = StructAfter<decltype (_.inputX)> (_.backtrack); |
3445 | 0 | const auto &lookahead = StructAfter<decltype (_.lookaheadX)> (input); |
3446 | 0 | return input.lenP1 <= 1 && lookahead.len == 0; |
3447 | 0 | }) |
3448 | 0 | | hb_map ([&] (const ChainRule &_) { return _.apply (c, lookup_context); }) |
3449 | 0 | | hb_any |
3450 | 0 | ) |
3451 | 0 | ; |
3452 | 0 | } |
3453 | 0 | matched = skippy_iter.next (); |
3454 | 0 | if (likely (matched && !skippy_iter.may_skip (c->buffer->info[skippy_iter.idx]))) |
3455 | 0 | { |
3456 | 0 | second = &c->buffer->info[skippy_iter.idx]; |
3457 | 0 | unsafe_to2 = skippy_iter.idx + 1; |
3458 | 0 | } |
3459 | |
|
3460 | 0 | auto match_input = lookup_context.funcs.match[1]; |
3461 | 0 | auto match_lookahead = lookup_context.funcs.match[2]; |
3462 | 0 | auto *input_data = lookup_context.match_data[1]; |
3463 | 0 | auto *lookahead_data = lookup_context.match_data[2]; |
3464 | 0 | for (unsigned int i = 0; i < num_rules; i++) |
3465 | 0 | { |
3466 | 0 | const auto &r = this+rule.arrayZ[i]; |
3467 | |
|
3468 | 0 | const auto &input = StructAfter<decltype (r.inputX)> (r.backtrack); |
3469 | 0 | const auto &lookahead = StructAfter<decltype (r.lookaheadX)> (input); |
3470 | |
|
3471 | 0 | unsigned lenP1 = input.lenP1; |
3472 | 0 | if (lenP1 > 1 ? |
3473 | 0 | (!match_input || |
3474 | 0 | match_input (*first, input.arrayZ[0], input_data)) |
3475 | 0 | : |
3476 | 0 | (!lookahead.len || !match_lookahead || |
3477 | 0 | match_lookahead (*first, lookahead.arrayZ[0], lookahead_data))) |
3478 | 0 | { |
3479 | 0 | lenP1 = hb_max (lenP1, 1u); |
3480 | 0 | if (!second || |
3481 | 0 | (lenP1 > 2 ? |
3482 | 0 | (!match_input || |
3483 | 0 | match_input (*second, input.arrayZ[1], input_data)) |
3484 | 0 | : |
3485 | 0 | (lookahead.len <= 2 - lenP1 || !match_lookahead || |
3486 | 0 | match_lookahead (*second, lookahead.arrayZ[2 - lenP1], lookahead_data)))) |
3487 | 0 | { |
3488 | 0 | if (r.apply (c, lookup_context)) |
3489 | 0 | { |
3490 | 0 | if (unsafe_to != (unsigned) -1) |
3491 | 0 | c->buffer->unsafe_to_concat (c->buffer->idx, unsafe_to); |
3492 | 0 | return_trace (true); |
3493 | 0 | } |
3494 | 0 | } |
3495 | 0 | else |
3496 | 0 | unsafe_to = unsafe_to2; |
3497 | 0 | } |
3498 | 0 | else |
3499 | 0 | { |
3500 | 0 | if (unsafe_to == (unsigned) -1) |
3501 | 0 | unsafe_to = unsafe_to1; |
3502 | 0 | } |
3503 | 0 | } |
3504 | 0 | if (likely (unsafe_to != (unsigned) -1)) |
3505 | 0 | c->buffer->unsafe_to_concat (c->buffer->idx, unsafe_to); |
3506 | |
|
3507 | 0 | return_trace (false); |
3508 | 0 | } Unexecuted instantiation: OT::ChainRuleSet<OT::Layout::SmallTypes>::apply(OT::hb_ot_apply_context_t*, OT::ChainContextApplyLookupContext const&) const Unexecuted instantiation: OT::ChainRuleSet<OT::Layout::MediumTypes>::apply(OT::hb_ot_apply_context_t*, OT::ChainContextApplyLookupContext const&) const |
3509 | | |
3510 | | bool subset (hb_subset_context_t *c, |
3511 | | const hb_map_t *lookup_map, |
3512 | | const hb_map_t *backtrack_klass_map = nullptr, |
3513 | | const hb_map_t *input_klass_map = nullptr, |
3514 | | const hb_map_t *lookahead_klass_map = nullptr) const |
3515 | 0 | { |
3516 | 0 | TRACE_SUBSET (this); |
3517 | 0 |
|
3518 | 0 | auto snap = c->serializer->snapshot (); |
3519 | 0 | auto *out = c->serializer->start_embed (*this); |
3520 | 0 | if (unlikely (!c->serializer->extend_min (out))) return_trace (false); |
3521 | 0 |
|
3522 | 0 | for (const Offset16To<ChainRule>& _ : rule) |
3523 | 0 | { |
3524 | 0 | if (!_) continue; |
3525 | 0 | auto o_snap = c->serializer->snapshot (); |
3526 | 0 | auto *o = out->rule.serialize_append (c->serializer); |
3527 | 0 | if (unlikely (!o)) continue; |
3528 | 0 |
|
3529 | 0 | if (!o->serialize_subset (c, _, this, |
3530 | 0 | lookup_map, |
3531 | 0 | backtrack_klass_map, |
3532 | 0 | input_klass_map, |
3533 | 0 | lookahead_klass_map)) |
3534 | 0 | { |
3535 | 0 | out->rule.pop (); |
3536 | 0 | c->serializer->revert (o_snap); |
3537 | 0 | } |
3538 | 0 | } |
3539 | 0 |
|
3540 | 0 | bool ret = bool (out->rule); |
3541 | 0 | if (!ret) c->serializer->revert (snap); |
3542 | 0 |
|
3543 | 0 | return_trace (ret); |
3544 | 0 | } Unexecuted instantiation: OT::ChainRuleSet<OT::Layout::SmallTypes>::subset(hb_subset_context_t*, hb_map_t const*, hb_map_t const*, hb_map_t const*, hb_map_t const*) const Unexecuted instantiation: OT::ChainRuleSet<OT::Layout::MediumTypes>::subset(hb_subset_context_t*, hb_map_t const*, hb_map_t const*, hb_map_t const*, hb_map_t const*) const |
3545 | | |
3546 | | bool sanitize (hb_sanitize_context_t *c) const |
3547 | 11.0k | { |
3548 | 11.0k | TRACE_SANITIZE (this); |
3549 | 11.0k | return_trace (rule.sanitize (c, this)); |
3550 | 11.0k | } OT::ChainRuleSet<OT::Layout::SmallTypes>::sanitize(hb_sanitize_context_t*) const Line | Count | Source | 3547 | 10.4k | { | 3548 | 10.4k | TRACE_SANITIZE (this); | 3549 | 10.4k | return_trace (rule.sanitize (c, this)); | 3550 | 10.4k | } |
OT::ChainRuleSet<OT::Layout::MediumTypes>::sanitize(hb_sanitize_context_t*) const Line | Count | Source | 3547 | 538 | { | 3548 | 538 | TRACE_SANITIZE (this); | 3549 | 538 | return_trace (rule.sanitize (c, this)); | 3550 | 538 | } |
|
3551 | | |
3552 | | protected: |
3553 | | Array16OfOffset16To<ChainRule> |
3554 | | rule; /* Array of ChainRule tables |
3555 | | * ordered by preference */ |
3556 | | public: |
3557 | | DEFINE_SIZE_ARRAY (2, rule); |
3558 | | }; |
3559 | | |
3560 | | template <typename Types> |
3561 | | struct ChainContextFormat1_4 |
3562 | | { |
3563 | | using ChainRuleSet = OT::ChainRuleSet<Types>; |
3564 | | |
3565 | | bool intersects (const hb_set_t *glyphs) const |
3566 | 0 | { |
3567 | 0 | struct ChainContextClosureLookupContext lookup_context = { |
3568 | 0 | {intersects_glyph, intersected_glyph}, |
3569 | 0 | ContextFormat::SimpleContext, |
3570 | 0 | {nullptr, nullptr, nullptr} |
3571 | 0 | }; |
3572 | 0 |
|
3573 | 0 | return |
3574 | 0 | + hb_zip (this+coverage, ruleSet) |
3575 | 0 | | hb_filter (*glyphs, hb_first) |
3576 | 0 | | hb_map (hb_second) |
3577 | 0 | | hb_map (hb_add (this)) |
3578 | 0 | | hb_map ([&] (const ChainRuleSet &_) { return _.intersects (glyphs, lookup_context); }) |
3579 | 0 | | hb_any |
3580 | 0 | ; |
3581 | 0 | } Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::intersects(hb_set_t const*) const Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::intersects(hb_set_t const*) const |
3582 | | |
3583 | | bool may_have_non_1to1 () const |
3584 | 0 | { return true; }Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::may_have_non_1to1() const Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::may_have_non_1to1() const |
3585 | | |
3586 | | void closure (hb_closure_context_t *c) const |
3587 | 0 | { |
3588 | 0 | hb_set_t* cur_active_glyphs = c->push_cur_active_glyphs (); |
3589 | 0 | if (unlikely (!cur_active_glyphs)) return; |
3590 | 0 | get_coverage ().intersect_set (c->previous_parent_active_glyphs (), |
3591 | 0 | *cur_active_glyphs); |
3592 | |
|
3593 | 0 | struct ChainContextClosureLookupContext lookup_context = { |
3594 | 0 | {intersects_glyph, intersected_glyph}, |
3595 | 0 | ContextFormat::SimpleContext, |
3596 | 0 | {nullptr, nullptr, nullptr} |
3597 | 0 | }; |
3598 | |
|
3599 | 0 | + hb_zip (this+coverage, hb_range ((unsigned) ruleSet.len)) |
3600 | 0 | | hb_filter ([&] (hb_codepoint_t _) { |
3601 | 0 | return c->previous_parent_active_glyphs ().has (_); |
3602 | 0 | }, hb_first) Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*) const::{lambda(unsigned int)#1}::operator()(unsigned int) constUnexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*) const::{lambda(unsigned int)#1}::operator()(unsigned int) const |
3603 | 0 | | hb_map ([&](const hb_pair_t<hb_codepoint_t, unsigned> _) { return hb_pair_t<unsigned, const ChainRuleSet&> (_.first, this+ruleSet[_.second]); })Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*) const::{lambda(hb_pair_t<unsigned int, unsigned int>)#1}::operator()(hb_pair_t<unsigned int, unsigned int>) constUnexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*) const::{lambda(hb_pair_t<unsigned int, unsigned int>)#1}::operator()(hb_pair_t<unsigned int, unsigned int>) const |
3604 | 0 | | hb_apply ([&] (const hb_pair_t<unsigned, const ChainRuleSet&>& _) { _.second.closure (c, _.first, lookup_context); })Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*) const::{lambda(hb_pair_t<unsigned int, OT::ChainRuleSet<OT::Layout::SmallTypes> const&> const&)#1}::operator()(hb_pair_t<unsigned int, OT::ChainRuleSet<OT::Layout::SmallTypes> const&> const&) constUnexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*) const::{lambda(hb_pair_t<unsigned int, OT::ChainRuleSet<OT::Layout::MediumTypes> const&> const&)#1}::operator()(hb_pair_t<unsigned int, OT::ChainRuleSet<OT::Layout::MediumTypes> const&> const&) const |
3605 | 0 | ; |
3606 | |
|
3607 | 0 | c->pop_cur_done_glyphs (); |
3608 | 0 | } Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*) const Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*) const |
3609 | | |
3610 | | void closure_lookups (hb_closure_lookups_context_t *c) const |
3611 | 0 | { |
3612 | 0 | struct ChainContextClosureLookupContext lookup_context = { |
3613 | 0 | {intersects_glyph, nullptr}, |
3614 | 0 | ContextFormat::SimpleContext, |
3615 | 0 | {nullptr, nullptr, nullptr} |
3616 | 0 | }; |
3617 | 0 |
|
3618 | 0 | + hb_zip (this+coverage, ruleSet) |
3619 | 0 | | hb_filter (*c->glyphs, hb_first) |
3620 | 0 | | hb_map (hb_second) |
3621 | 0 | | hb_map (hb_add (this)) |
3622 | 0 | | hb_apply ([&] (const ChainRuleSet &_) { _.closure_lookups (c, lookup_context); }) |
3623 | 0 | ; |
3624 | 0 | } Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const |
3625 | | |
3626 | 0 | void collect_variation_indices (hb_collect_variation_indices_context_t *c) const {}Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::collect_variation_indices(OT::hb_collect_variation_indices_context_t*) const Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::collect_variation_indices(OT::hb_collect_variation_indices_context_t*) const |
3627 | | |
3628 | | void collect_glyphs (hb_collect_glyphs_context_t *c) const |
3629 | 0 | { |
3630 | 0 | (this+coverage).collect_coverage (c->input); |
3631 | |
|
3632 | 0 | struct ChainContextCollectGlyphsLookupContext lookup_context = { |
3633 | 0 | {collect_glyph}, |
3634 | 0 | {nullptr, nullptr, nullptr} |
3635 | 0 | }; |
3636 | |
|
3637 | 0 | + hb_iter (ruleSet) |
3638 | 0 | | hb_map (hb_add (this)) |
3639 | 0 | | hb_apply ([&] (const ChainRuleSet &_) { _.collect_glyphs (c, lookup_context); })Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*) const::{lambda(OT::ChainRuleSet<OT::Layout::SmallTypes> const&)#1}::operator()(OT::ChainRuleSet<OT::Layout::SmallTypes> const&) constUnexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*) const::{lambda(OT::ChainRuleSet<OT::Layout::MediumTypes> const&)#1}::operator()(OT::ChainRuleSet<OT::Layout::MediumTypes> const&) const |
3640 | 0 | ; |
3641 | 0 | } Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*) const Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*) const |
3642 | | |
3643 | | bool would_apply (hb_would_apply_context_t *c) const |
3644 | 0 | { |
3645 | 0 | const ChainRuleSet &rule_set = this+ruleSet[(this+coverage).get_coverage (c->glyphs[0])]; |
3646 | 0 | struct ChainContextApplyLookupContext lookup_context = { |
3647 | 0 | {{match_glyph, match_glyph, match_glyph}}, |
3648 | 0 | {nullptr, nullptr, nullptr} |
3649 | 0 | }; |
3650 | 0 | return rule_set.would_apply (c, lookup_context); |
3651 | 0 | } Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::would_apply(OT::hb_would_apply_context_t*) const Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::would_apply(OT::hb_would_apply_context_t*) const |
3652 | | |
3653 | 0 | const Coverage &get_coverage () const { return this+coverage; }Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::get_coverage() const Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::get_coverage() const |
3654 | | |
3655 | | bool apply (hb_ot_apply_context_t *c) const |
3656 | 0 | { |
3657 | 0 | TRACE_APPLY (this); |
3658 | 0 | unsigned int index = (this+coverage).get_coverage (c->buffer->cur().codepoint); |
3659 | 0 | if (index == NOT_COVERED) return_trace (false); |
3660 | | |
3661 | 0 | const ChainRuleSet &rule_set = this+ruleSet[index]; |
3662 | 0 | struct ChainContextApplyLookupContext lookup_context = { |
3663 | 0 | {{match_glyph, match_glyph, match_glyph}}, |
3664 | 0 | {nullptr, nullptr, nullptr} |
3665 | 0 | }; |
3666 | 0 | return_trace (rule_set.apply (c, lookup_context)); |
3667 | 0 | } Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::apply(OT::hb_ot_apply_context_t*) const Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::apply(OT::hb_ot_apply_context_t*) const |
3668 | | |
3669 | | bool subset (hb_subset_context_t *c) const |
3670 | 0 | { |
3671 | 0 | TRACE_SUBSET (this); |
3672 | 0 | const hb_set_t &glyphset = *c->plan->glyphset_gsub (); |
3673 | 0 | const hb_map_t &glyph_map = *c->plan->glyph_map; |
3674 | 0 |
|
3675 | 0 | auto *out = c->serializer->start_embed (*this); |
3676 | 0 | if (unlikely (!c->serializer->extend_min (out))) return_trace (false); |
3677 | 0 | out->format = format; |
3678 | 0 |
|
3679 | 0 | const hb_map_t *lookup_map = c->table_tag == HB_OT_TAG_GSUB ? &c->plan->gsub_lookups : &c->plan->gpos_lookups; |
3680 | 0 | hb_sorted_vector_t<hb_codepoint_t> new_coverage; |
3681 | 0 | + hb_zip (this+coverage, ruleSet) |
3682 | 0 | | hb_filter (glyphset, hb_first) |
3683 | 0 | | hb_filter (subset_offset_array (c, out->ruleSet, this, lookup_map), hb_second) |
3684 | 0 | | hb_map (hb_first) |
3685 | 0 | | hb_map (glyph_map) |
3686 | 0 | | hb_sink (new_coverage) |
3687 | 0 | ; |
3688 | 0 |
|
3689 | 0 | out->coverage.serialize_serialize (c->serializer, new_coverage.iter ()); |
3690 | 0 | return_trace (bool (new_coverage)); |
3691 | 0 | } Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::subset(hb_subset_context_t*) const Unexecuted instantiation: OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::subset(hb_subset_context_t*) const |
3692 | | |
3693 | | bool sanitize (hb_sanitize_context_t *c) const |
3694 | 6.63k | { |
3695 | 6.63k | TRACE_SANITIZE (this); |
3696 | 6.63k | return_trace (coverage.sanitize (c, this) && ruleSet.sanitize (c, this)); |
3697 | 6.63k | } OT::ChainContextFormat1_4<OT::Layout::SmallTypes>::sanitize(hb_sanitize_context_t*) const Line | Count | Source | 3694 | 5.60k | { | 3695 | 5.60k | TRACE_SANITIZE (this); | 3696 | 5.60k | return_trace (coverage.sanitize (c, this) && ruleSet.sanitize (c, this)); | 3697 | 5.60k | } |
OT::ChainContextFormat1_4<OT::Layout::MediumTypes>::sanitize(hb_sanitize_context_t*) const Line | Count | Source | 3694 | 1.03k | { | 3695 | 1.03k | TRACE_SANITIZE (this); | 3696 | 1.03k | return_trace (coverage.sanitize (c, this) && ruleSet.sanitize (c, this)); | 3697 | 1.03k | } |
|
3698 | | |
3699 | | protected: |
3700 | | HBUINT16 format; /* Format identifier--format = 1 */ |
3701 | | typename Types::template OffsetTo<Coverage> |
3702 | | coverage; /* Offset to Coverage table--from |
3703 | | * beginning of table */ |
3704 | | Array16Of<typename Types::template OffsetTo<ChainRuleSet>> |
3705 | | ruleSet; /* Array of ChainRuleSet tables |
3706 | | * ordered by Coverage Index */ |
3707 | | public: |
3708 | | DEFINE_SIZE_ARRAY (2 + 2 * Types::size, ruleSet); |
3709 | | }; |
3710 | | |
3711 | | template <typename Types> |
3712 | | struct ChainContextFormat2_5 |
3713 | | { |
3714 | | using ChainRuleSet = OT::ChainRuleSet<SmallTypes>; |
3715 | | |
3716 | | bool intersects (const hb_set_t *glyphs) const |
3717 | 0 | { |
3718 | 0 | if (!(this+coverage).intersects (glyphs)) |
3719 | 0 | return false; |
3720 | 0 |
|
3721 | 0 | const ClassDef &backtrack_class_def = this+backtrackClassDef; |
3722 | 0 | const ClassDef &input_class_def = this+inputClassDef; |
3723 | 0 | const ClassDef &lookahead_class_def = this+lookaheadClassDef; |
3724 | 0 |
|
3725 | 0 | hb_map_t caches[3] = {}; |
3726 | 0 | struct ChainContextClosureLookupContext lookup_context = { |
3727 | 0 | {intersects_class, nullptr}, |
3728 | 0 | ContextFormat::ClassBasedContext, |
3729 | 0 | {&backtrack_class_def, |
3730 | 0 | &input_class_def, |
3731 | 0 | &lookahead_class_def}, |
3732 | 0 | {&caches[0], &caches[1], &caches[2]} |
3733 | 0 | }; |
3734 | 0 |
|
3735 | 0 | hb_set_t retained_coverage_glyphs; |
3736 | 0 | (this+coverage).intersect_set (*glyphs, retained_coverage_glyphs); |
3737 | 0 |
|
3738 | 0 | hb_set_t coverage_glyph_classes; |
3739 | 0 | input_class_def.intersected_classes (&retained_coverage_glyphs, &coverage_glyph_classes); |
3740 | 0 |
|
3741 | 0 | return |
3742 | 0 | + hb_iter (ruleSet) |
3743 | 0 | | hb_map (hb_add (this)) |
3744 | 0 | | hb_enumerate |
3745 | 0 | | hb_map ([&] (const hb_pair_t<unsigned, const ChainRuleSet &> p) |
3746 | 0 | { return input_class_def.intersects_class (glyphs, p.first) && |
3747 | 0 | coverage_glyph_classes.has (p.first) && |
3748 | 0 | p.second.intersects (glyphs, lookup_context); }) |
3749 | 0 | | hb_any |
3750 | 0 | ; |
3751 | 0 | } Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::intersects(hb_set_t const*) const Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::intersects(hb_set_t const*) const |
3752 | | |
3753 | | bool may_have_non_1to1 () const |
3754 | 0 | { return true; }Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::may_have_non_1to1() const Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::may_have_non_1to1() const |
3755 | | |
3756 | | void closure (hb_closure_context_t *c) const |
3757 | 0 | { |
3758 | 0 | if (!(this+coverage).intersects (c->glyphs)) |
3759 | 0 | return; |
3760 | | |
3761 | 0 | hb_set_t* cur_active_glyphs = c->push_cur_active_glyphs (); |
3762 | 0 | if (unlikely (!cur_active_glyphs)) return; |
3763 | 0 | get_coverage ().intersect_set (c->previous_parent_active_glyphs (), |
3764 | 0 | *cur_active_glyphs); |
3765 | |
|
3766 | 0 | const ClassDef &backtrack_class_def = this+backtrackClassDef; |
3767 | 0 | const ClassDef &input_class_def = this+inputClassDef; |
3768 | 0 | const ClassDef &lookahead_class_def = this+lookaheadClassDef; |
3769 | |
|
3770 | 0 | hb_map_t caches[3] = {}; |
3771 | 0 | intersected_class_cache_t intersected_cache; |
3772 | 0 | struct ChainContextClosureLookupContext lookup_context = { |
3773 | 0 | {intersects_class, intersected_class_glyphs}, |
3774 | 0 | ContextFormat::ClassBasedContext, |
3775 | 0 | {&backtrack_class_def, |
3776 | 0 | &input_class_def, |
3777 | 0 | &lookahead_class_def}, |
3778 | 0 | {&caches[0], &caches[1], &caches[2]}, |
3779 | 0 | &intersected_cache |
3780 | 0 | }; |
3781 | |
|
3782 | 0 | + hb_enumerate (ruleSet) |
3783 | 0 | | hb_filter ([&] (unsigned _) |
3784 | 0 | { return input_class_def.intersects_class (&c->parent_active_glyphs (), _); },Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*) const::{lambda(unsigned int)#1}::operator()(unsigned int) constUnexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*) const::{lambda(unsigned int)#1}::operator()(unsigned int) const |
3785 | 0 | hb_first) |
3786 | 0 | | hb_apply ([&] (const hb_pair_t<unsigned, const typename Types::template OffsetTo<ChainRuleSet>&> _) |
3787 | 0 | { |
3788 | 0 | const ChainRuleSet& chainrule_set = this+_.second; |
3789 | 0 | chainrule_set.closure (c, _.first, lookup_context); |
3790 | 0 | }) Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*) const::{lambda(hb_pair_t<unsigned int, OT::OffsetTo<OT::ChainRuleSet<OT::Layout::SmallTypes>, OT::NumType<true, unsigned short, 2u>, void, true> const&>)#1}::operator()(hb_pair_t<unsigned int, OT::OffsetTo<OT::ChainRuleSet<OT::Layout::SmallTypes>, OT::NumType<true, unsigned short, 2u>, void, true> const&>) constUnexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*) const::{lambda(hb_pair_t<unsigned int, OT::OffsetTo<OT::ChainRuleSet<OT::Layout::SmallTypes>, OT::NumType<true, unsigned int, 3u>, void, true> const&>)#1}::operator()(hb_pair_t<unsigned int, OT::OffsetTo<OT::ChainRuleSet<OT::Layout::SmallTypes>, OT::NumType<true, unsigned int, 3u>, void, true> const&>) const |
3791 | 0 | ; |
3792 | |
|
3793 | 0 | c->pop_cur_done_glyphs (); |
3794 | 0 | } Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::closure(OT::hb_closure_context_t*) const Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::closure(OT::hb_closure_context_t*) const |
3795 | | |
3796 | | void closure_lookups (hb_closure_lookups_context_t *c) const |
3797 | 0 | { |
3798 | 0 | if (!(this+coverage).intersects (c->glyphs)) |
3799 | 0 | return; |
3800 | 0 |
|
3801 | 0 | const ClassDef &backtrack_class_def = this+backtrackClassDef; |
3802 | 0 | const ClassDef &input_class_def = this+inputClassDef; |
3803 | 0 | const ClassDef &lookahead_class_def = this+lookaheadClassDef; |
3804 | 0 |
|
3805 | 0 | hb_map_t caches[3] = {}; |
3806 | 0 | struct ChainContextClosureLookupContext lookup_context = { |
3807 | 0 | {intersects_class, nullptr}, |
3808 | 0 | ContextFormat::ClassBasedContext, |
3809 | 0 | {&backtrack_class_def, |
3810 | 0 | &input_class_def, |
3811 | 0 | &lookahead_class_def}, |
3812 | 0 | {&caches[0], &caches[1], &caches[2]} |
3813 | 0 | }; |
3814 | 0 |
|
3815 | 0 | + hb_iter (ruleSet) |
3816 | 0 | | hb_map (hb_add (this)) |
3817 | 0 | | hb_enumerate |
3818 | 0 | | hb_filter([&] (unsigned klass) |
3819 | 0 | { return input_class_def.intersects_class (c->glyphs, klass); }, hb_first) |
3820 | 0 | | hb_map (hb_second) |
3821 | 0 | | hb_apply ([&] (const ChainRuleSet &_) |
3822 | 0 | { _.closure_lookups (c, lookup_context); }) |
3823 | 0 | ; |
3824 | 0 | } Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::closure_lookups(OT::hb_closure_lookups_context_t*) const |
3825 | | |
3826 | 0 | void collect_variation_indices (hb_collect_variation_indices_context_t *c) const {}Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::collect_variation_indices(OT::hb_collect_variation_indices_context_t*) const Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::collect_variation_indices(OT::hb_collect_variation_indices_context_t*) const |
3827 | | |
3828 | | void collect_glyphs (hb_collect_glyphs_context_t *c) const |
3829 | 0 | { |
3830 | 0 | (this+coverage).collect_coverage (c->input); |
3831 | |
|
3832 | 0 | const ClassDef &backtrack_class_def = this+backtrackClassDef; |
3833 | 0 | const ClassDef &input_class_def = this+inputClassDef; |
3834 | 0 | const ClassDef &lookahead_class_def = this+lookaheadClassDef; |
3835 | |
|
3836 | 0 | struct ChainContextCollectGlyphsLookupContext lookup_context = { |
3837 | 0 | {collect_class}, |
3838 | 0 | {&backtrack_class_def, |
3839 | 0 | &input_class_def, |
3840 | 0 | &lookahead_class_def} |
3841 | 0 | }; |
3842 | |
|
3843 | 0 | + hb_iter (ruleSet) |
3844 | 0 | | hb_map (hb_add (this)) |
3845 | 0 | | hb_apply ([&] (const ChainRuleSet &_) { _.collect_glyphs (c, lookup_context); })Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*) const::{lambda(OT::ChainRuleSet<OT::Layout::SmallTypes> const&)#1}::operator()(OT::ChainRuleSet<OT::Layout::SmallTypes> const&) constUnexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*) const::{lambda(OT::ChainRuleSet<OT::Layout::SmallTypes> const&)#1}::operator()(OT::ChainRuleSet<OT::Layout::SmallTypes> const&) const |
3846 | 0 | ; |
3847 | 0 | } Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*) const Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::collect_glyphs(OT::hb_collect_glyphs_context_t*) const |
3848 | | |
3849 | | bool would_apply (hb_would_apply_context_t *c) const |
3850 | 0 | { |
3851 | 0 | const ClassDef &backtrack_class_def = this+backtrackClassDef; |
3852 | 0 | const ClassDef &input_class_def = this+inputClassDef; |
3853 | 0 | const ClassDef &lookahead_class_def = this+lookaheadClassDef; |
3854 | |
|
3855 | 0 | unsigned int index = input_class_def.get_class (c->glyphs[0]); |
3856 | 0 | const ChainRuleSet &rule_set = this+ruleSet[index]; |
3857 | 0 | struct ChainContextApplyLookupContext lookup_context = { |
3858 | 0 | {{match_class, match_class, match_class}}, |
3859 | 0 | {&backtrack_class_def, |
3860 | 0 | &input_class_def, |
3861 | 0 | &lookahead_class_def} |
3862 | 0 | }; |
3863 | 0 | return rule_set.would_apply (c, lookup_context); |
3864 | 0 | } Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::would_apply(OT::hb_would_apply_context_t*) const Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::would_apply(OT::hb_would_apply_context_t*) const |
3865 | | |
3866 | 0 | const Coverage &get_coverage () const { return this+coverage; }Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::get_coverage() const Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::get_coverage() const |
3867 | | |
3868 | | unsigned cache_cost () const |
3869 | 0 | { |
3870 | 0 | return (this+inputClassDef).cost () + (this+lookaheadClassDef).cost (); |
3871 | 0 | } Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::cache_cost() const Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::cache_cost() const |
3872 | | static bool cache_func (hb_ot_apply_context_t *c, hb_ot_subtable_cache_op_t op) |
3873 | 0 | { |
3874 | 0 | return context_cache_func (c, op); |
3875 | 0 | } Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::cache_func(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t) Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::cache_func(OT::hb_ot_apply_context_t*, OT::hb_ot_subtable_cache_op_t) |
3876 | | |
3877 | 0 | bool apply_cached (hb_ot_apply_context_t *c, void *external_cache HB_UNUSED) const { return _apply (c, true); }Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::apply_cached(OT::hb_ot_apply_context_t*, void*) const Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::apply_cached(OT::hb_ot_apply_context_t*, void*) const |
3878 | 0 | bool apply (hb_ot_apply_context_t *c) const { return _apply (c, false); }Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::apply(OT::hb_ot_apply_context_t*) const Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::apply(OT::hb_ot_apply_context_t*) const |
3879 | | bool _apply (hb_ot_apply_context_t *c, bool cached) const |
3880 | 0 | { |
3881 | 0 | TRACE_APPLY (this); |
3882 | 0 | unsigned int index = (this+coverage).get_coverage (c->buffer->cur().codepoint); |
3883 | 0 | if (index == NOT_COVERED) return_trace (false); |
3884 | | |
3885 | 0 | const ClassDef &backtrack_class_def = this+backtrackClassDef; |
3886 | 0 | const ClassDef &input_class_def = this+inputClassDef; |
3887 | 0 | const ClassDef &lookahead_class_def = this+lookaheadClassDef; |
3888 | | |
3889 | | /* match_class_caches1 is slightly faster. Use it for lookahead, |
3890 | | * which is typically longer. */ |
3891 | 0 | struct ChainContextApplyLookupContext lookup_context = { |
3892 | 0 | {{cached && &backtrack_class_def == &lookahead_class_def ? match_class_cached1 : match_class, |
3893 | 0 | cached ? match_class_cached2 : match_class, |
3894 | 0 | cached ? match_class_cached1 : match_class}}, |
3895 | 0 | {&backtrack_class_def, |
3896 | 0 | &input_class_def, |
3897 | 0 | &lookahead_class_def} |
3898 | 0 | }; |
3899 | |
|
3900 | 0 | index = cached |
3901 | 0 | ? get_class_cached2 (input_class_def, c->buffer->cur()) |
3902 | 0 | : input_class_def.get_class (c->buffer->cur().codepoint); |
3903 | 0 | const ChainRuleSet &rule_set = this+ruleSet[index]; |
3904 | 0 | return_trace (rule_set.apply (c, lookup_context)); |
3905 | 0 | } Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::_apply(OT::hb_ot_apply_context_t*, bool) const Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::_apply(OT::hb_ot_apply_context_t*, bool) const |
3906 | | |
3907 | | bool subset (hb_subset_context_t *c) const |
3908 | 0 | { |
3909 | 0 | TRACE_SUBSET (this); |
3910 | 0 | auto *out = c->serializer->start_embed (*this); |
3911 | 0 | if (unlikely (!c->serializer->extend_min (out))) return_trace (false); |
3912 | 0 | out->format = format; |
3913 | 0 | out->coverage.serialize_subset (c, coverage, this); |
3914 | 0 |
|
3915 | 0 | hb_map_t backtrack_klass_map; |
3916 | 0 | hb_map_t input_klass_map; |
3917 | 0 | hb_map_t lookahead_klass_map; |
3918 | 0 |
|
3919 | 0 | out->backtrackClassDef.serialize_subset (c, backtrackClassDef, this, &backtrack_klass_map); |
3920 | 0 | // TODO: subset inputClassDef based on glyphs survived in Coverage subsetting |
3921 | 0 | out->inputClassDef.serialize_subset (c, inputClassDef, this, &input_klass_map); |
3922 | 0 | out->lookaheadClassDef.serialize_subset (c, lookaheadClassDef, this, &lookahead_klass_map); |
3923 | 0 |
|
3924 | 0 | if (unlikely (!c->serializer->propagate_error (backtrack_klass_map, |
3925 | 0 | input_klass_map, |
3926 | 0 | lookahead_klass_map))) |
3927 | 0 | return_trace (false); |
3928 | 0 |
|
3929 | 0 | const hb_set_t* glyphset = c->plan->glyphset_gsub (); |
3930 | 0 | hb_set_t retained_coverage_glyphs; |
3931 | 0 | (this+coverage).intersect_set (*glyphset, retained_coverage_glyphs); |
3932 | 0 |
|
3933 | 0 | hb_set_t coverage_glyph_classes; |
3934 | 0 | (this+inputClassDef).intersected_classes (&retained_coverage_glyphs, &coverage_glyph_classes); |
3935 | 0 |
|
3936 | 0 | int non_zero_index = -1, index = 0; |
3937 | 0 | bool ret = true; |
3938 | 0 | const hb_map_t *lookup_map = c->table_tag == HB_OT_TAG_GSUB ? &c->plan->gsub_lookups : &c->plan->gpos_lookups; |
3939 | 0 | auto last_non_zero = c->serializer->snapshot (); |
3940 | 0 | for (const auto& _ : + hb_enumerate (ruleSet) |
3941 | 0 | | hb_filter (input_klass_map, hb_first)) |
3942 | 0 | { |
3943 | 0 | auto *o = out->ruleSet.serialize_append (c->serializer); |
3944 | 0 | if (unlikely (!o)) |
3945 | 0 | { |
3946 | 0 | ret = false; |
3947 | 0 | break; |
3948 | 0 | } |
3949 | 0 | if (coverage_glyph_classes.has (_.first) && |
3950 | 0 | o->serialize_subset (c, _.second, this, |
3951 | 0 | lookup_map, |
3952 | 0 | &backtrack_klass_map, |
3953 | 0 | &input_klass_map, |
3954 | 0 | &lookahead_klass_map)) |
3955 | 0 | { |
3956 | 0 | last_non_zero = c->serializer->snapshot (); |
3957 | 0 | non_zero_index = index; |
3958 | 0 | } |
3959 | 0 |
|
3960 | 0 | index++; |
3961 | 0 | } |
3962 | 0 |
|
3963 | 0 | if (!ret || non_zero_index == -1) return_trace (false); |
3964 | 0 |
|
3965 | 0 | // prune empty trailing ruleSets |
3966 | 0 | if (index > non_zero_index) { |
3967 | 0 | c->serializer->revert (last_non_zero); |
3968 | 0 | out->ruleSet.len = non_zero_index + 1; |
3969 | 0 | } |
3970 | 0 |
|
3971 | 0 | return_trace (bool (out->ruleSet)); |
3972 | 0 | } Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::subset(hb_subset_context_t*) const Unexecuted instantiation: OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::subset(hb_subset_context_t*) const |
3973 | | |
3974 | | bool sanitize (hb_sanitize_context_t *c) const |
3975 | 4.80k | { |
3976 | 4.80k | TRACE_SANITIZE (this); |
3977 | 4.80k | return_trace (coverage.sanitize (c, this) && |
3978 | 4.80k | backtrackClassDef.sanitize (c, this) && |
3979 | 4.80k | inputClassDef.sanitize (c, this) && |
3980 | 4.80k | lookaheadClassDef.sanitize (c, this) && |
3981 | 4.80k | ruleSet.sanitize (c, this)); |
3982 | 4.80k | } OT::ChainContextFormat2_5<OT::Layout::SmallTypes>::sanitize(hb_sanitize_context_t*) const Line | Count | Source | 3975 | 3.21k | { | 3976 | 3.21k | TRACE_SANITIZE (this); | 3977 | 3.21k | return_trace (coverage.sanitize (c, this) && | 3978 | 3.21k | backtrackClassDef.sanitize (c, this) && | 3979 | 3.21k | inputClassDef.sanitize (c, this) && | 3980 | 3.21k | lookaheadClassDef.sanitize (c, this) && | 3981 | 3.21k | ruleSet.sanitize (c, this)); | 3982 | 3.21k | } |
OT::ChainContextFormat2_5<OT::Layout::MediumTypes>::sanitize(hb_sanitize_context_t*) const Line | Count | Source | 3975 | 1.59k | { | 3976 | 1.59k | TRACE_SANITIZE (this); | 3977 | 1.59k | return_trace (coverage.sanitize (c, this) && | 3978 | 1.59k | backtrackClassDef.sanitize (c, this) && | 3979 | 1.59k | inputClassDef.sanitize (c, this) && | 3980 | 1.59k | lookaheadClassDef.sanitize (c, this) && | 3981 | 1.59k | ruleSet.sanitize (c, this)); | 3982 | 1.59k | } |
|
3983 | | |
3984 | | protected: |
3985 | | HBUINT16 format; /* Format identifier--format = 2 */ |
3986 | | typename Types::template OffsetTo<Coverage> |
3987 | | coverage; /* Offset to Coverage table--from |
3988 | | * beginning of table */ |
3989 | | typename Types::template OffsetTo<ClassDef> |
3990 | | backtrackClassDef; /* Offset to glyph ClassDef table |
3991 | | * containing backtrack sequence |
3992 | | * data--from beginning of table */ |
3993 | | typename Types::template OffsetTo<ClassDef> |
3994 | | inputClassDef; /* Offset to glyph ClassDef |
3995 | | * table containing input sequence |
3996 | | * data--from beginning of table */ |
3997 | | typename Types::template OffsetTo<ClassDef> |
3998 | | lookaheadClassDef; /* Offset to glyph ClassDef table |
3999 | | * containing lookahead sequence |
4000 | | * data--from beginning of table */ |
4001 | | Array16Of<typename Types::template OffsetTo<ChainRuleSet>> |
4002 | | ruleSet; /* Array of ChainRuleSet tables |
4003 | | * ordered by class */ |
4004 | | public: |
4005 | | DEFINE_SIZE_ARRAY (4 + 4 * Types::size, ruleSet); |
4006 | | }; |
4007 | | |
4008 | | struct ChainContextFormat3 |
4009 | | { |
4010 | | using RuleSet = OT::RuleSet<SmallTypes>; |
4011 | | |
4012 | | bool intersects (const hb_set_t *glyphs) const |
4013 | 0 | { |
4014 | 0 | const auto &input = StructAfter<decltype (inputX)> (backtrack); |
4015 | 0 |
|
4016 | 0 | if (!(this+input[0]).intersects (glyphs)) |
4017 | 0 | return false; |
4018 | 0 |
|
4019 | 0 | const auto &lookahead = StructAfter<decltype (lookaheadX)> (input); |
4020 | 0 | struct ChainContextClosureLookupContext lookup_context = { |
4021 | 0 | {intersects_coverage, nullptr}, |
4022 | 0 | ContextFormat::CoverageBasedContext, |
4023 | 0 | {this, this, this} |
4024 | 0 | }; |
4025 | 0 | return chain_context_intersects (glyphs, |
4026 | 0 | backtrack.len, (const HBUINT16 *) backtrack.arrayZ, |
4027 | 0 | input.len, (const HBUINT16 *) input.arrayZ + 1, |
4028 | 0 | lookahead.len, (const HBUINT16 *) lookahead.arrayZ, |
4029 | 0 | lookup_context); |
4030 | 0 | } |
4031 | | |
4032 | | bool may_have_non_1to1 () const |
4033 | 0 | { return true; } |
4034 | | |
4035 | | void closure (hb_closure_context_t *c) const |
4036 | 0 | { |
4037 | 0 | const auto &input = StructAfter<decltype (inputX)> (backtrack); |
4038 | |
|
4039 | 0 | if (!(this+input[0]).intersects (c->glyphs)) |
4040 | 0 | return; |
4041 | | |
4042 | 0 | hb_set_t* cur_active_glyphs = c->push_cur_active_glyphs (); |
4043 | 0 | if (unlikely (!cur_active_glyphs)) |
4044 | 0 | return; |
4045 | 0 | get_coverage ().intersect_set (c->previous_parent_active_glyphs (), |
4046 | 0 | *cur_active_glyphs); |
4047 | |
|
4048 | 0 | const auto &lookahead = StructAfter<decltype (lookaheadX)> (input); |
4049 | 0 | const auto &lookup = StructAfter<decltype (lookupX)> (lookahead); |
4050 | 0 | struct ChainContextClosureLookupContext lookup_context = { |
4051 | 0 | {intersects_coverage, intersected_coverage_glyphs}, |
4052 | 0 | ContextFormat::CoverageBasedContext, |
4053 | 0 | {this, this, this} |
4054 | 0 | }; |
4055 | 0 | chain_context_closure_lookup (c, |
4056 | 0 | backtrack.len, (const HBUINT16 *) backtrack.arrayZ, |
4057 | 0 | input.len, (const HBUINT16 *) input.arrayZ + 1, |
4058 | 0 | lookahead.len, (const HBUINT16 *) lookahead.arrayZ, |
4059 | 0 | lookup.len, lookup.arrayZ, |
4060 | 0 | 0, lookup_context); |
4061 | |
|
4062 | 0 | c->pop_cur_done_glyphs (); |
4063 | 0 | } |
4064 | | |
4065 | | void closure_lookups (hb_closure_lookups_context_t *c) const |
4066 | 0 | { |
4067 | 0 | if (!intersects (c->glyphs)) |
4068 | 0 | return; |
4069 | 0 |
|
4070 | 0 | const auto &input = StructAfter<decltype (inputX)> (backtrack); |
4071 | 0 | const auto &lookahead = StructAfter<decltype (lookaheadX)> (input); |
4072 | 0 | const auto &lookup = StructAfter<decltype (lookupX)> (lookahead); |
4073 | 0 | recurse_lookups (c, lookup.len, lookup.arrayZ); |
4074 | 0 | } |
4075 | | |
4076 | 0 | void collect_variation_indices (hb_collect_variation_indices_context_t *c) const {} |
4077 | | |
4078 | | void collect_glyphs (hb_collect_glyphs_context_t *c) const |
4079 | 0 | { |
4080 | 0 | const auto &input = StructAfter<decltype (inputX)> (backtrack); |
4081 | |
|
4082 | 0 | (this+input[0]).collect_coverage (c->input); |
4083 | |
|
4084 | 0 | const auto &lookahead = StructAfter<decltype (lookaheadX)> (input); |
4085 | 0 | const auto &lookup = StructAfter<decltype (lookupX)> (lookahead); |
4086 | |
|
4087 | 0 | struct ChainContextCollectGlyphsLookupContext lookup_context = { |
4088 | 0 | {collect_coverage}, |
4089 | 0 | {this, this, this} |
4090 | 0 | }; |
4091 | 0 | chain_context_collect_glyphs_lookup (c, |
4092 | 0 | backtrack.len, (const HBUINT16 *) backtrack.arrayZ, |
4093 | 0 | input.len, (const HBUINT16 *) input.arrayZ + 1, |
4094 | 0 | lookahead.len, (const HBUINT16 *) lookahead.arrayZ, |
4095 | 0 | lookup.len, lookup.arrayZ, |
4096 | 0 | lookup_context); |
4097 | 0 | } |
4098 | | |
4099 | | bool would_apply (hb_would_apply_context_t *c) const |
4100 | 0 | { |
4101 | 0 | const auto &input = StructAfter<decltype (inputX)> (backtrack); |
4102 | 0 | const auto &lookahead = StructAfter<decltype (lookaheadX)> (input); |
4103 | 0 | const auto &lookup = StructAfter<decltype (lookupX)> (lookahead); |
4104 | 0 | struct ChainContextApplyLookupContext lookup_context = { |
4105 | 0 | {{match_coverage, match_coverage, match_coverage}}, |
4106 | 0 | {this, this, this} |
4107 | 0 | }; |
4108 | 0 | return chain_context_would_apply_lookup (c, |
4109 | 0 | backtrack.len, (const HBUINT16 *) backtrack.arrayZ, |
4110 | 0 | input.len, (const HBUINT16 *) input.arrayZ + 1, |
4111 | 0 | lookahead.len, (const HBUINT16 *) lookahead.arrayZ, |
4112 | 0 | lookup.len, lookup.arrayZ, lookup_context); |
4113 | 0 | } |
4114 | | |
4115 | | const Coverage &get_coverage () const |
4116 | 0 | { |
4117 | 0 | const auto &input = StructAfter<decltype (inputX)> (backtrack); |
4118 | 0 | return this+input[0]; |
4119 | 0 | } |
4120 | | |
4121 | | bool apply (hb_ot_apply_context_t *c) const |
4122 | 0 | { |
4123 | 0 | TRACE_APPLY (this); |
4124 | 0 | const auto &input = StructAfter<decltype (inputX)> (backtrack); |
4125 | |
|
4126 | 0 | unsigned int index = (this+input[0]).get_coverage (c->buffer->cur().codepoint); |
4127 | 0 | if (index == NOT_COVERED) return_trace (false); |
4128 | | |
4129 | 0 | const auto &lookahead = StructAfter<decltype (lookaheadX)> (input); |
4130 | 0 | const auto &lookup = StructAfter<decltype (lookupX)> (lookahead); |
4131 | 0 | struct ChainContextApplyLookupContext lookup_context = { |
4132 | 0 | {{match_coverage, match_coverage, match_coverage}}, |
4133 | 0 | {this, this, this} |
4134 | 0 | }; |
4135 | 0 | return_trace (chain_context_apply_lookup (c, |
4136 | 0 | backtrack.len, (const HBUINT16 *) backtrack.arrayZ, |
4137 | 0 | input.len, (const HBUINT16 *) input.arrayZ + 1, |
4138 | 0 | lookahead.len, (const HBUINT16 *) lookahead.arrayZ, |
4139 | 0 | lookup.len, lookup.arrayZ, lookup_context)); |
4140 | 0 | } |
4141 | | |
4142 | | template<typename Iterator, |
4143 | | hb_requires (hb_is_iterator (Iterator))> |
4144 | | bool serialize_coverage_offsets (hb_subset_context_t *c, Iterator it, const void* base) const |
4145 | 0 | { |
4146 | 0 | TRACE_SERIALIZE (this); |
4147 | 0 | auto *out = c->serializer->start_embed<Array16OfOffset16To<Coverage>> (); |
4148 | 0 |
|
4149 | 0 | if (unlikely (!c->serializer->allocate_size<HBUINT16> (HBUINT16::static_size))) |
4150 | 0 | return_trace (false); |
4151 | 0 |
|
4152 | 0 | for (auto& offset : it) { |
4153 | 0 | auto *o = out->serialize_append (c->serializer); |
4154 | 0 | if (unlikely (!o) || !o->serialize_subset (c, offset, base)) |
4155 | 0 | return_trace (false); |
4156 | 0 | } |
4157 | 0 |
|
4158 | 0 | return_trace (true); |
4159 | 0 | } |
4160 | | |
4161 | | bool subset (hb_subset_context_t *c) const |
4162 | 0 | { |
4163 | 0 | TRACE_SUBSET (this); |
4164 | 0 |
|
4165 | 0 | if (unlikely (!c->serializer->embed (this->format))) return_trace (false); |
4166 | 0 |
|
4167 | 0 | if (!serialize_coverage_offsets (c, backtrack.iter (), this)) |
4168 | 0 | return_trace (false); |
4169 | 0 |
|
4170 | 0 | const auto &input = StructAfter<decltype (inputX)> (backtrack); |
4171 | 0 | if (!serialize_coverage_offsets (c, input.iter (), this)) |
4172 | 0 | return_trace (false); |
4173 | 0 |
|
4174 | 0 | const auto &lookahead = StructAfter<decltype (lookaheadX)> (input); |
4175 | 0 | if (!serialize_coverage_offsets (c, lookahead.iter (), this)) |
4176 | 0 | return_trace (false); |
4177 | 0 |
|
4178 | 0 | const auto &lookup = StructAfter<decltype (lookupX)> (lookahead); |
4179 | 0 | const hb_map_t *lookup_map = c->table_tag == HB_OT_TAG_GSUB ? &c->plan->gsub_lookups : &c->plan->gpos_lookups; |
4180 | 0 |
|
4181 | 0 | HBUINT16 *lookupCount = c->serializer->copy<HBUINT16> (lookup.len); |
4182 | 0 | if (!lookupCount) return_trace (false); |
4183 | 0 |
|
4184 | 0 | unsigned count = serialize_lookuprecord_array (c->serializer, lookup.as_array (), lookup_map); |
4185 | 0 | return_trace (c->serializer->check_assign (*lookupCount, count, HB_SERIALIZE_ERROR_INT_OVERFLOW)); |
4186 | 0 | } |
4187 | | |
4188 | | bool sanitize (hb_sanitize_context_t *c) const |
4189 | 2.21k | { |
4190 | 2.21k | TRACE_SANITIZE (this); |
4191 | 2.21k | if (unlikely (!backtrack.sanitize (c, this))) return_trace (false); |
4192 | 2.18k | hb_barrier (); |
4193 | 2.18k | const auto &input = StructAfter<decltype (inputX)> (backtrack); |
4194 | 2.18k | if (unlikely (!input.sanitize (c, this))) return_trace (false); |
4195 | 2.16k | hb_barrier (); |
4196 | 2.16k | if (unlikely (!input.len)) return_trace (false); /* To be consistent with Context. */ |
4197 | 2.16k | const auto &lookahead = StructAfter<decltype (lookaheadX)> (input); |
4198 | 2.16k | if (unlikely (!lookahead.sanitize (c, this))) return_trace (false); |
4199 | 2.14k | hb_barrier (); |
4200 | 2.14k | const auto &lookup = StructAfter<decltype (lookupX)> (lookahead); |
4201 | 2.14k | return_trace (likely (lookup.sanitize (c))); |
4202 | 2.16k | } |
4203 | | |
4204 | | protected: |
4205 | | HBUINT16 format; /* Format identifier--format = 3 */ |
4206 | | Array16OfOffset16To<Coverage> |
4207 | | backtrack; /* Array of coverage tables |
4208 | | * in backtracking sequence, in glyph |
4209 | | * sequence order */ |
4210 | | Array16OfOffset16To<Coverage> |
4211 | | inputX ; /* Array of coverage |
4212 | | * tables in input sequence, in glyph |
4213 | | * sequence order */ |
4214 | | Array16OfOffset16To<Coverage> |
4215 | | lookaheadX; /* Array of coverage tables |
4216 | | * in lookahead sequence, in glyph |
4217 | | * sequence order */ |
4218 | | Array16Of<LookupRecord> |
4219 | | lookupX; /* Array of LookupRecords--in |
4220 | | * design order) */ |
4221 | | public: |
4222 | | DEFINE_SIZE_MIN (10); |
4223 | | }; |
4224 | | |
4225 | | struct ChainContext |
4226 | | { |
4227 | | template <typename context_t, typename ...Ts> |
4228 | | typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const |
4229 | 36.6k | { |
4230 | 36.6k | if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value (); |
4231 | 36.4k | TRACE_DISPATCH (this, u.format.v); |
4232 | 36.4k | switch (u.format.v) { |
4233 | 5.60k | case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...)); |
4234 | 3.21k | case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...)); |
4235 | 2.21k | case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...)); |
4236 | 0 | #ifndef HB_NO_BEYOND_64K |
4237 | 1.03k | case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...)); |
4238 | 1.59k | case 5: hb_barrier (); return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...)); |
4239 | 0 | #endif |
4240 | 22.7k | default:return_trace (c->default_return_value ()); |
4241 | 36.4k | } |
4242 | 36.4k | } Unexecuted instantiation: OT::hb_intersects_context_t::return_t OT::ChainContext::dispatch<OT::hb_intersects_context_t>(OT::hb_intersects_context_t*) const Unexecuted instantiation: OT::hb_ot_apply_context_t::return_t OT::ChainContext::dispatch<OT::hb_ot_apply_context_t>(OT::hb_ot_apply_context_t*) const Unexecuted instantiation: OT::hb_collect_glyphs_context_t::return_t OT::ChainContext::dispatch<OT::hb_collect_glyphs_context_t>(OT::hb_collect_glyphs_context_t*) const Unexecuted instantiation: OT::hb_closure_lookups_context_t::return_t OT::ChainContext::dispatch<OT::hb_closure_lookups_context_t>(OT::hb_closure_lookups_context_t*) const Unexecuted instantiation: hb_subset_context_t::return_t OT::ChainContext::dispatch<hb_subset_context_t>(hb_subset_context_t*) const hb_sanitize_context_t::return_t OT::ChainContext::dispatch<hb_sanitize_context_t>(hb_sanitize_context_t*) const Line | Count | Source | 4229 | 36.6k | { | 4230 | 36.6k | if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value (); | 4231 | 36.4k | TRACE_DISPATCH (this, u.format.v); | 4232 | 36.4k | switch (u.format.v) { | 4233 | 5.60k | case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...)); | 4234 | 3.21k | case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...)); | 4235 | 2.21k | case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...)); | 4236 | 0 | #ifndef HB_NO_BEYOND_64K | 4237 | 1.03k | case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...)); | 4238 | 1.59k | case 5: hb_barrier (); return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...)); | 4239 | 0 | #endif | 4240 | 22.7k | default:return_trace (c->default_return_value ()); | 4241 | 36.4k | } | 4242 | 36.4k | } |
Unexecuted instantiation: OT::hb_collect_variation_indices_context_t::return_t OT::ChainContext::dispatch<OT::hb_collect_variation_indices_context_t>(OT::hb_collect_variation_indices_context_t*) const Unexecuted instantiation: OT::hb_accelerate_subtables_context_t::return_t OT::ChainContext::dispatch<OT::hb_accelerate_subtables_context_t>(OT::hb_accelerate_subtables_context_t*) const Unexecuted instantiation: OT::hb_have_non_1to1_context_t::return_t OT::ChainContext::dispatch<OT::hb_have_non_1to1_context_t>(OT::hb_have_non_1to1_context_t*) const Unexecuted instantiation: OT::hb_closure_context_t::return_t OT::ChainContext::dispatch<OT::hb_closure_context_t>(OT::hb_closure_context_t*) const Unexecuted instantiation: OT::hb_would_apply_context_t::return_t OT::ChainContext::dispatch<OT::hb_would_apply_context_t>(OT::hb_would_apply_context_t*) const Unexecuted instantiation: hb_get_glyph_alternates_dispatch_t::return_t OT::ChainContext::dispatch<hb_get_glyph_alternates_dispatch_t, unsigned int&, unsigned int&, unsigned int*&, unsigned int*&>(hb_get_glyph_alternates_dispatch_t*, unsigned int&, unsigned int&, unsigned int*&, unsigned int*&) const Unexecuted instantiation: hb_collect_glyph_alternates_dispatch_t::return_t OT::ChainContext::dispatch<hb_collect_glyph_alternates_dispatch_t, hb_map_t*&, hb_map_t*&>(hb_collect_glyph_alternates_dispatch_t*, hb_map_t*&, hb_map_t*&) const Unexecuted instantiation: hb_position_single_dispatch_t::return_t OT::ChainContext::dispatch<hb_position_single_dispatch_t, hb_font_t*&, hb_blob_t*&, hb_direction_t&, unsigned int&, hb_glyph_position_t&>(hb_position_single_dispatch_t*, hb_font_t*&, hb_blob_t*&, hb_direction_t&, unsigned int&, hb_glyph_position_t&) const |
4243 | | |
4244 | | protected: |
4245 | | union { |
4246 | | struct { HBUINT16 v; } format; /* Format identifier */ |
4247 | | ChainContextFormat1_4<SmallTypes> format1; |
4248 | | ChainContextFormat2_5<SmallTypes> format2; |
4249 | | ChainContextFormat3 format3; |
4250 | | #ifndef HB_NO_BEYOND_64K |
4251 | | ChainContextFormat1_4<MediumTypes> format4; |
4252 | | ChainContextFormat2_5<MediumTypes> format5; |
4253 | | #endif |
4254 | | } u; |
4255 | | }; |
4256 | | |
4257 | | |
4258 | | template <typename T> |
4259 | | struct ExtensionFormat1 |
4260 | | { |
4261 | 7.09k | unsigned int get_type () const { return extensionLookupType; }OT::ExtensionFormat1<OT::Layout::GPOS_impl::ExtensionPos>::get_type() const Line | Count | Source | 4261 | 2.73k | unsigned int get_type () const { return extensionLookupType; } |
OT::ExtensionFormat1<OT::Layout::GSUB_impl::ExtensionSubst>::get_type() const Line | Count | Source | 4261 | 4.36k | unsigned int get_type () const { return extensionLookupType; } |
|
4262 | | |
4263 | | template <typename X> |
4264 | | const X& get_subtable () const |
4265 | 5.12k | { return this + reinterpret_cast<const Offset32To<typename T::SubTable> &> (extensionOffset); }OT::Layout::GPOS_impl::PosLookupSubTable const& OT::ExtensionFormat1<OT::Layout::GPOS_impl::ExtensionPos>::get_subtable<OT::Layout::GPOS_impl::PosLookupSubTable>() const Line | Count | Source | 4265 | 1.69k | { return this + reinterpret_cast<const Offset32To<typename T::SubTable> &> (extensionOffset); } |
OT::Layout::GSUB_impl::SubstLookupSubTable const& OT::ExtensionFormat1<OT::Layout::GSUB_impl::ExtensionSubst>::get_subtable<OT::Layout::GSUB_impl::SubstLookupSubTable>() const Line | Count | Source | 4265 | 3.42k | { return this + reinterpret_cast<const Offset32To<typename T::SubTable> &> (extensionOffset); } |
|
4266 | | |
4267 | | template <typename context_t, typename ...Ts> |
4268 | | typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const |
4269 | 5.12k | { |
4270 | 5.12k | if (unlikely (!c->may_dispatch (this, this))) return c->no_dispatch_return_value (); |
4271 | 5.12k | TRACE_DISPATCH (this, format); |
4272 | 5.12k | return_trace (get_subtable<typename T::SubTable> ().dispatch (c, get_type (), std::forward<Ts> (ds)...)); |
4273 | 5.12k | } Unexecuted instantiation: OT::hb_intersects_context_t::return_t OT::ExtensionFormat1<OT::Layout::GPOS_impl::ExtensionPos>::dispatch<OT::hb_intersects_context_t>(OT::hb_intersects_context_t*) const Unexecuted instantiation: OT::hb_ot_apply_context_t::return_t OT::ExtensionFormat1<OT::Layout::GPOS_impl::ExtensionPos>::dispatch<OT::hb_ot_apply_context_t>(OT::hb_ot_apply_context_t*) const Unexecuted instantiation: OT::hb_collect_glyphs_context_t::return_t OT::ExtensionFormat1<OT::Layout::GPOS_impl::ExtensionPos>::dispatch<OT::hb_collect_glyphs_context_t>(OT::hb_collect_glyphs_context_t*) const Unexecuted instantiation: OT::hb_closure_lookups_context_t::return_t OT::ExtensionFormat1<OT::Layout::GPOS_impl::ExtensionPos>::dispatch<OT::hb_closure_lookups_context_t>(OT::hb_closure_lookups_context_t*) const hb_sanitize_context_t::return_t OT::ExtensionFormat1<OT::Layout::GPOS_impl::ExtensionPos>::dispatch<hb_sanitize_context_t>(hb_sanitize_context_t*) const Line | Count | Source | 4269 | 1.70k | { | 4270 | 1.70k | if (unlikely (!c->may_dispatch (this, this))) return c->no_dispatch_return_value (); | 4271 | 1.69k | TRACE_DISPATCH (this, format); | 4272 | 1.69k | return_trace (get_subtable<typename T::SubTable> ().dispatch (c, get_type (), std::forward<Ts> (ds)...)); | 4273 | 1.70k | } |
Unexecuted instantiation: OT::hb_collect_variation_indices_context_t::return_t OT::ExtensionFormat1<OT::Layout::GPOS_impl::ExtensionPos>::dispatch<OT::hb_collect_variation_indices_context_t>(OT::hb_collect_variation_indices_context_t*) const Unexecuted instantiation: OT::hb_accelerate_subtables_context_t::return_t OT::ExtensionFormat1<OT::Layout::GPOS_impl::ExtensionPos>::dispatch<OT::hb_accelerate_subtables_context_t>(OT::hb_accelerate_subtables_context_t*) const Unexecuted instantiation: OT::hb_intersects_context_t::return_t OT::ExtensionFormat1<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<OT::hb_intersects_context_t>(OT::hb_intersects_context_t*) const hb_sanitize_context_t::return_t OT::ExtensionFormat1<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<hb_sanitize_context_t>(hb_sanitize_context_t*) const Line | Count | Source | 4269 | 3.42k | { | 4270 | 3.42k | if (unlikely (!c->may_dispatch (this, this))) return c->no_dispatch_return_value (); | 4271 | 3.42k | TRACE_DISPATCH (this, format); | 4272 | 3.42k | return_trace (get_subtable<typename T::SubTable> ().dispatch (c, get_type (), std::forward<Ts> (ds)...)); | 4273 | 3.42k | } |
Unexecuted instantiation: OT::hb_have_non_1to1_context_t::return_t OT::ExtensionFormat1<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<OT::hb_have_non_1to1_context_t>(OT::hb_have_non_1to1_context_t*) const Unexecuted instantiation: OT::hb_ot_apply_context_t::return_t OT::ExtensionFormat1<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<OT::hb_ot_apply_context_t>(OT::hb_ot_apply_context_t*) const Unexecuted instantiation: OT::hb_closure_context_t::return_t OT::ExtensionFormat1<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<OT::hb_closure_context_t>(OT::hb_closure_context_t*) const Unexecuted instantiation: OT::hb_closure_lookups_context_t::return_t OT::ExtensionFormat1<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<OT::hb_closure_lookups_context_t>(OT::hb_closure_lookups_context_t*) const Unexecuted instantiation: OT::hb_collect_glyphs_context_t::return_t OT::ExtensionFormat1<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<OT::hb_collect_glyphs_context_t>(OT::hb_collect_glyphs_context_t*) const Unexecuted instantiation: OT::hb_would_apply_context_t::return_t OT::ExtensionFormat1<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<OT::hb_would_apply_context_t>(OT::hb_would_apply_context_t*) const Unexecuted instantiation: OT::hb_accelerate_subtables_context_t::return_t OT::ExtensionFormat1<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<OT::hb_accelerate_subtables_context_t>(OT::hb_accelerate_subtables_context_t*) const Unexecuted instantiation: hb_get_glyph_alternates_dispatch_t::return_t OT::ExtensionFormat1<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<hb_get_glyph_alternates_dispatch_t, unsigned int&, unsigned int&, unsigned int*&, unsigned int*&>(hb_get_glyph_alternates_dispatch_t*, unsigned int&, unsigned int&, unsigned int*&, unsigned int*&) const Unexecuted instantiation: hb_collect_glyph_alternates_dispatch_t::return_t OT::ExtensionFormat1<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<hb_collect_glyph_alternates_dispatch_t, hb_map_t*&, hb_map_t*&>(hb_collect_glyph_alternates_dispatch_t*, hb_map_t*&, hb_map_t*&) const Unexecuted instantiation: hb_position_single_dispatch_t::return_t OT::ExtensionFormat1<OT::Layout::GPOS_impl::ExtensionPos>::dispatch<hb_position_single_dispatch_t, hb_font_t*&, hb_blob_t*&, hb_direction_t&, unsigned int&, hb_glyph_position_t&>(hb_position_single_dispatch_t*, hb_font_t*&, hb_blob_t*&, hb_direction_t&, unsigned int&, hb_glyph_position_t&) const |
4274 | | |
4275 | | void collect_variation_indices (hb_collect_variation_indices_context_t *c) const |
4276 | | { dispatch (c); } |
4277 | | |
4278 | | /* This is called from may_dispatch() above with hb_sanitize_context_t. */ |
4279 | | bool sanitize (hb_sanitize_context_t *c) const |
4280 | 5.12k | { |
4281 | 5.12k | TRACE_SANITIZE (this); |
4282 | 5.12k | return_trace (c->check_struct (this) && |
4283 | 5.12k | hb_barrier () && |
4284 | 5.12k | extensionLookupType != T::SubTable::Extension); |
4285 | 5.12k | } OT::ExtensionFormat1<OT::Layout::GPOS_impl::ExtensionPos>::sanitize(hb_sanitize_context_t*) const Line | Count | Source | 4280 | 1.70k | { | 4281 | 1.70k | TRACE_SANITIZE (this); | 4282 | 1.70k | return_trace (c->check_struct (this) && | 4283 | 1.70k | hb_barrier () && | 4284 | 1.70k | extensionLookupType != T::SubTable::Extension); | 4285 | 1.70k | } |
OT::ExtensionFormat1<OT::Layout::GSUB_impl::ExtensionSubst>::sanitize(hb_sanitize_context_t*) const Line | Count | Source | 4280 | 3.42k | { | 4281 | 3.42k | TRACE_SANITIZE (this); | 4282 | 3.42k | return_trace (c->check_struct (this) && | 4283 | 3.42k | hb_barrier () && | 4284 | 3.42k | extensionLookupType != T::SubTable::Extension); | 4285 | 3.42k | } |
|
4286 | | |
4287 | | bool subset (hb_subset_context_t *c) const |
4288 | 0 | { |
4289 | 0 | TRACE_SUBSET (this); |
4290 | 0 |
|
4291 | 0 | auto *out = c->serializer->start_embed (this); |
4292 | 0 | if (unlikely (!c->serializer->extend_min (out))) return_trace (false); |
4293 | 0 |
|
4294 | 0 | out->format = format; |
4295 | 0 | out->extensionLookupType = extensionLookupType; |
4296 | 0 |
|
4297 | 0 | const auto& src_offset = |
4298 | 0 | reinterpret_cast<const Offset32To<typename T::SubTable> &> (extensionOffset); |
4299 | 0 | auto& dest_offset = |
4300 | 0 | reinterpret_cast<Offset32To<typename T::SubTable> &> (out->extensionOffset); |
4301 | 0 |
|
4302 | 0 | return_trace (dest_offset.serialize_subset (c, src_offset, this, get_type ())); |
4303 | 0 | } Unexecuted instantiation: OT::ExtensionFormat1<OT::Layout::GPOS_impl::ExtensionPos>::subset(hb_subset_context_t*) const Unexecuted instantiation: OT::ExtensionFormat1<OT::Layout::GSUB_impl::ExtensionSubst>::subset(hb_subset_context_t*) const |
4304 | | |
4305 | | protected: |
4306 | | HBUINT16 format; /* Format identifier. Set to 1. */ |
4307 | | HBUINT16 extensionLookupType; /* Lookup type of subtable referenced |
4308 | | * by ExtensionOffset (i.e. the |
4309 | | * extension subtable). */ |
4310 | | Offset32 extensionOffset; /* Offset to the extension subtable, |
4311 | | * of lookup type subtable. */ |
4312 | | public: |
4313 | | DEFINE_SIZE_STATIC (8); |
4314 | | }; |
4315 | | |
4316 | | template <typename T> |
4317 | | struct Extension |
4318 | | { |
4319 | | unsigned int get_type () const |
4320 | 11.0k | { |
4321 | 11.0k | switch (u.format.v) { |
4322 | 1.97k | case 1: hb_barrier (); return u.format1.get_type (); |
4323 | 9.04k | default:return 0; |
4324 | 11.0k | } |
4325 | 11.0k | } OT::Extension<OT::Layout::GPOS_impl::ExtensionPos>::get_type() const Line | Count | Source | 4320 | 4.38k | { | 4321 | 4.38k | switch (u.format.v) { | 4322 | 1.03k | case 1: hb_barrier (); return u.format1.get_type (); | 4323 | 3.35k | default:return 0; | 4324 | 4.38k | } | 4325 | 4.38k | } |
OT::Extension<OT::Layout::GSUB_impl::ExtensionSubst>::get_type() const Line | Count | Source | 4320 | 6.63k | { | 4321 | 6.63k | switch (u.format.v) { | 4322 | 940 | case 1: hb_barrier (); return u.format1.get_type (); | 4323 | 5.69k | default:return 0; | 4324 | 6.63k | } | 4325 | 6.63k | } |
|
4326 | | template <typename X> |
4327 | | const X& get_subtable () const |
4328 | | { |
4329 | | switch (u.format.v) { |
4330 | | case 1: hb_barrier (); return u.format1.template get_subtable<typename T::SubTable> (); |
4331 | | default:return Null (typename T::SubTable); |
4332 | | } |
4333 | | } |
4334 | | |
4335 | | // Specialization of dispatch for subset. dispatch() normally just |
4336 | | // dispatches to the sub table this points too, but for subset |
4337 | | // we need to run subset on this subtable too. |
4338 | | template <typename ...Ts> |
4339 | | typename hb_subset_context_t::return_t dispatch (hb_subset_context_t *c, Ts&&... ds) const |
4340 | 0 | { |
4341 | 0 | switch (u.format.v) { |
4342 | 0 | case 1: hb_barrier (); return u.format1.subset (c); |
4343 | 0 | default: return c->default_return_value (); |
4344 | 0 | } |
4345 | 0 | } Unexecuted instantiation: bool OT::Extension<OT::Layout::GPOS_impl::ExtensionPos>::dispatch<>(hb_subset_context_t*) const Unexecuted instantiation: bool OT::Extension<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<>(hb_subset_context_t*) const |
4346 | | |
4347 | | template <typename context_t, typename ...Ts> |
4348 | | typename context_t::return_t dispatch (context_t *c, Ts&&... ds) const |
4349 | 55.8k | { |
4350 | 55.8k | if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value (); |
4351 | 55.7k | TRACE_DISPATCH (this, u.format.v); |
4352 | 55.7k | switch (u.format.v) { |
4353 | 5.12k | case 1: hb_barrier (); return_trace (u.format1.dispatch (c, std::forward<Ts> (ds)...)); |
4354 | 50.6k | default:return_trace (c->default_return_value ()); |
4355 | 55.7k | } |
4356 | 55.7k | } Unexecuted instantiation: OT::hb_intersects_context_t::return_t OT::Extension<OT::Layout::GPOS_impl::ExtensionPos>::dispatch<OT::hb_intersects_context_t>(OT::hb_intersects_context_t*) const Unexecuted instantiation: OT::hb_ot_apply_context_t::return_t OT::Extension<OT::Layout::GPOS_impl::ExtensionPos>::dispatch<OT::hb_ot_apply_context_t>(OT::hb_ot_apply_context_t*) const Unexecuted instantiation: OT::hb_collect_glyphs_context_t::return_t OT::Extension<OT::Layout::GPOS_impl::ExtensionPos>::dispatch<OT::hb_collect_glyphs_context_t>(OT::hb_collect_glyphs_context_t*) const Unexecuted instantiation: OT::hb_closure_lookups_context_t::return_t OT::Extension<OT::Layout::GPOS_impl::ExtensionPos>::dispatch<OT::hb_closure_lookups_context_t>(OT::hb_closure_lookups_context_t*) const hb_sanitize_context_t::return_t OT::Extension<OT::Layout::GPOS_impl::ExtensionPos>::dispatch<hb_sanitize_context_t>(hb_sanitize_context_t*) const Line | Count | Source | 4349 | 24.0k | { | 4350 | 24.0k | if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value (); | 4351 | 24.0k | TRACE_DISPATCH (this, u.format.v); | 4352 | 24.0k | switch (u.format.v) { | 4353 | 1.70k | case 1: hb_barrier (); return_trace (u.format1.dispatch (c, std::forward<Ts> (ds)...)); | 4354 | 22.3k | default:return_trace (c->default_return_value ()); | 4355 | 24.0k | } | 4356 | 24.0k | } |
Unexecuted instantiation: OT::hb_collect_variation_indices_context_t::return_t OT::Extension<OT::Layout::GPOS_impl::ExtensionPos>::dispatch<OT::hb_collect_variation_indices_context_t>(OT::hb_collect_variation_indices_context_t*) const Unexecuted instantiation: OT::hb_accelerate_subtables_context_t::return_t OT::Extension<OT::Layout::GPOS_impl::ExtensionPos>::dispatch<OT::hb_accelerate_subtables_context_t>(OT::hb_accelerate_subtables_context_t*) const Unexecuted instantiation: OT::hb_intersects_context_t::return_t OT::Extension<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<OT::hb_intersects_context_t>(OT::hb_intersects_context_t*) const hb_sanitize_context_t::return_t OT::Extension<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<hb_sanitize_context_t>(hb_sanitize_context_t*) const Line | Count | Source | 4349 | 31.7k | { | 4350 | 31.7k | if (unlikely (!c->may_dispatch (this, &u.format.v))) return c->no_dispatch_return_value (); | 4351 | 31.7k | TRACE_DISPATCH (this, u.format.v); | 4352 | 31.7k | switch (u.format.v) { | 4353 | 3.42k | case 1: hb_barrier (); return_trace (u.format1.dispatch (c, std::forward<Ts> (ds)...)); | 4354 | 28.2k | default:return_trace (c->default_return_value ()); | 4355 | 31.7k | } | 4356 | 31.7k | } |
Unexecuted instantiation: OT::hb_have_non_1to1_context_t::return_t OT::Extension<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<OT::hb_have_non_1to1_context_t>(OT::hb_have_non_1to1_context_t*) const Unexecuted instantiation: OT::hb_ot_apply_context_t::return_t OT::Extension<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<OT::hb_ot_apply_context_t>(OT::hb_ot_apply_context_t*) const Unexecuted instantiation: OT::hb_closure_context_t::return_t OT::Extension<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<OT::hb_closure_context_t>(OT::hb_closure_context_t*) const Unexecuted instantiation: OT::hb_closure_lookups_context_t::return_t OT::Extension<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<OT::hb_closure_lookups_context_t>(OT::hb_closure_lookups_context_t*) const Unexecuted instantiation: OT::hb_collect_glyphs_context_t::return_t OT::Extension<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<OT::hb_collect_glyphs_context_t>(OT::hb_collect_glyphs_context_t*) const Unexecuted instantiation: OT::hb_would_apply_context_t::return_t OT::Extension<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<OT::hb_would_apply_context_t>(OT::hb_would_apply_context_t*) const Unexecuted instantiation: OT::hb_accelerate_subtables_context_t::return_t OT::Extension<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<OT::hb_accelerate_subtables_context_t>(OT::hb_accelerate_subtables_context_t*) const Unexecuted instantiation: hb_get_glyph_alternates_dispatch_t::return_t OT::Extension<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<hb_get_glyph_alternates_dispatch_t, unsigned int&, unsigned int&, unsigned int*&, unsigned int*&>(hb_get_glyph_alternates_dispatch_t*, unsigned int&, unsigned int&, unsigned int*&, unsigned int*&) const Unexecuted instantiation: hb_collect_glyph_alternates_dispatch_t::return_t OT::Extension<OT::Layout::GSUB_impl::ExtensionSubst>::dispatch<hb_collect_glyph_alternates_dispatch_t, hb_map_t*&, hb_map_t*&>(hb_collect_glyph_alternates_dispatch_t*, hb_map_t*&, hb_map_t*&) const Unexecuted instantiation: hb_position_single_dispatch_t::return_t OT::Extension<OT::Layout::GPOS_impl::ExtensionPos>::dispatch<hb_position_single_dispatch_t, hb_font_t*&, hb_blob_t*&, hb_direction_t&, unsigned int&, hb_glyph_position_t&>(hb_position_single_dispatch_t*, hb_font_t*&, hb_blob_t*&, hb_direction_t&, unsigned int&, hb_glyph_position_t&) const |
4357 | | |
4358 | | protected: |
4359 | | union { |
4360 | | struct { HBUINT16 v; } format; /* Format identifier */ |
4361 | | ExtensionFormat1<T> format1; |
4362 | | } u; |
4363 | | }; |
4364 | | |
4365 | | |
4366 | | /* |
4367 | | * GSUB/GPOS Common |
4368 | | */ |
4369 | | |
4370 | | struct hb_ot_layout_lookup_accelerator_t |
4371 | | { |
4372 | | template <typename TLookup> |
4373 | | static hb_ot_layout_lookup_accelerator_t *create (const TLookup &lookup) |
4374 | 0 | { |
4375 | 0 | unsigned count = lookup.get_subtable_count (); |
4376 | |
|
4377 | 0 | unsigned size = sizeof (hb_ot_layout_lookup_accelerator_t) - |
4378 | 0 | HB_VAR_ARRAY * sizeof (hb_accelerate_subtables_context_t::hb_applicable_t) + |
4379 | 0 | count * sizeof (hb_accelerate_subtables_context_t::hb_applicable_t); |
4380 | | |
4381 | | /* The following is a calloc because when we are collecting subtables, |
4382 | | * some of them might be invalid and hence not collect; as a result, |
4383 | | * we might not fill in all the count entries of the subtables array. |
4384 | | * Zeroing it allows the set digest to gatekeep it without having to |
4385 | | * initialize it further. */ |
4386 | 0 | auto *thiz = (hb_ot_layout_lookup_accelerator_t *) hb_calloc (1, size); |
4387 | 0 | if (unlikely (!thiz)) |
4388 | 0 | return nullptr; |
4389 | | |
4390 | 0 | hb_accelerate_subtables_context_t c_accelerate_subtables (thiz->subtables); |
4391 | 0 | lookup.dispatch (&c_accelerate_subtables); |
4392 | |
|
4393 | 0 | thiz->digest.init (); |
4394 | 0 | for (auto& subtable : hb_iter (thiz->subtables, count)) |
4395 | 0 | thiz->digest.union_ (subtable.digest); |
4396 | |
|
4397 | 0 | thiz->count = count; |
4398 | |
|
4399 | 0 | #ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE |
4400 | 0 | thiz->subtable_cache_user_idx = c_accelerate_subtables.subtable_cache_user_idx; |
4401 | |
|
4402 | 0 | for (unsigned i = 0; i < count; i++) |
4403 | 0 | if (i != thiz->subtable_cache_user_idx) |
4404 | 0 | thiz->subtables[i].apply_cached_func = thiz->subtables[i].apply_func; |
4405 | 0 | #endif |
4406 | |
|
4407 | 0 | return thiz; |
4408 | 0 | } Unexecuted instantiation: OT::hb_ot_layout_lookup_accelerator_t* OT::hb_ot_layout_lookup_accelerator_t::create<OT::Layout::GPOS_impl::PosLookup>(OT::Layout::GPOS_impl::PosLookup const&) Unexecuted instantiation: OT::hb_ot_layout_lookup_accelerator_t* OT::hb_ot_layout_lookup_accelerator_t::create<OT::Layout::GSUB_impl::SubstLookup>(OT::Layout::GSUB_impl::SubstLookup const&) |
4409 | | |
4410 | | void fini () |
4411 | 0 | { |
4412 | 0 | #ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE |
4413 | 0 | for (unsigned i = 0; i < count; i++) |
4414 | 0 | hb_free (subtables[i].external_cache); |
4415 | 0 | #endif |
4416 | 0 | } |
4417 | | |
4418 | | bool may_have (hb_codepoint_t g) const |
4419 | 0 | { return digest.may_have (g); } |
4420 | | |
4421 | | #ifndef HB_OPTIMIZE_SIZE |
4422 | | HB_ALWAYS_INLINE |
4423 | | #endif |
4424 | | bool apply (hb_ot_apply_context_t *c, bool use_cache) const |
4425 | 0 | { |
4426 | 0 | c->lookup_accel = this; |
4427 | 0 | #ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE |
4428 | 0 | if (use_cache) |
4429 | 0 | { |
4430 | 0 | return |
4431 | 0 | + hb_iter (hb_iter (subtables, count)) |
4432 | 0 | | hb_map ([&c] (const hb_accelerate_subtables_context_t::hb_applicable_t &_) { return _.apply_cached (c); }) |
4433 | 0 | | hb_any |
4434 | 0 | ; |
4435 | 0 | } |
4436 | 0 | else |
4437 | 0 | #endif |
4438 | 0 | { |
4439 | 0 | return |
4440 | 0 | + hb_iter (hb_iter (subtables, count)) |
4441 | 0 | | hb_map ([&c] (const hb_accelerate_subtables_context_t::hb_applicable_t &_) { return _.apply (c); }) |
4442 | 0 | | hb_any |
4443 | 0 | ; |
4444 | 0 | } |
4445 | 0 | return false; |
4446 | 0 | } |
4447 | | |
4448 | | bool cache_enter (hb_ot_apply_context_t *c) const |
4449 | 0 | { |
4450 | 0 | #ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE |
4451 | 0 | return subtable_cache_user_idx != (unsigned) -1 && |
4452 | 0 | subtables[subtable_cache_user_idx].cache_enter (c); |
4453 | | #else |
4454 | | return false; |
4455 | | #endif |
4456 | 0 | } |
4457 | | void cache_leave (hb_ot_apply_context_t *c) const |
4458 | 0 | { |
4459 | 0 | #ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE |
4460 | 0 | subtables[subtable_cache_user_idx].cache_leave (c); |
4461 | 0 | #endif |
4462 | 0 | } |
4463 | | |
4464 | | |
4465 | | hb_set_digest_t digest; |
4466 | | private: |
4467 | | unsigned count = 0; /* Number of subtables in the array. */ |
4468 | | #ifndef HB_NO_OT_LAYOUT_LOOKUP_CACHE |
4469 | | unsigned subtable_cache_user_idx = (unsigned) -1; |
4470 | | #endif |
4471 | | hb_accelerate_subtables_context_t::hb_applicable_t subtables[HB_VAR_ARRAY]; |
4472 | | }; |
4473 | | |
4474 | | template <typename Types> |
4475 | | struct GSUBGPOSVersion1_2 |
4476 | | { |
4477 | | friend struct GSUBGPOS; |
4478 | | |
4479 | | protected: |
4480 | | FixedVersion<>version; /* Version of the GSUB/GPOS table--initially set |
4481 | | * to 0x00010000u */ |
4482 | | typename Types:: template OffsetTo<ScriptList> |
4483 | | scriptList; /* ScriptList table */ |
4484 | | typename Types::template OffsetTo<FeatureList> |
4485 | | featureList; /* FeatureList table */ |
4486 | | typename Types::template OffsetTo<LookupList<Types>> |
4487 | | lookupList; /* LookupList table */ |
4488 | | Offset32To<FeatureVariations> |
4489 | | featureVars; /* Offset to Feature Variations |
4490 | | table--from beginning of table |
4491 | | * (may be NULL). Introduced |
4492 | | * in version 0x00010001. */ |
4493 | | public: |
4494 | | DEFINE_SIZE_MIN (4 + 3 * Types::size); |
4495 | | |
4496 | | unsigned int get_size () const |
4497 | 0 | { |
4498 | 0 | return min_size + |
4499 | 0 | (version.to_int () >= 0x00010001u ? featureVars.static_size : 0); |
4500 | 0 | } Unexecuted instantiation: OT::GSUBGPOSVersion1_2<OT::Layout::SmallTypes>::get_size() const Unexecuted instantiation: OT::GSUBGPOSVersion1_2<OT::Layout::MediumTypes>::get_size() const |
4501 | | |
4502 | | const typename Types::template OffsetTo<LookupList<Types>>* get_lookup_list_offset () const |
4503 | | { |
4504 | | return &lookupList; |
4505 | | } |
4506 | | |
4507 | | template <typename TLookup> |
4508 | | bool sanitize (hb_sanitize_context_t *c) const |
4509 | 5.83k | { |
4510 | 5.83k | TRACE_SANITIZE (this); |
4511 | 5.83k | typedef List16OfOffsetTo<TLookup, typename Types::HBUINT> TLookupList; |
4512 | 5.83k | if (unlikely (!(scriptList.sanitize (c, this) && |
4513 | 5.83k | featureList.sanitize (c, this) && |
4514 | 5.83k | reinterpret_cast<const typename Types::template OffsetTo<TLookupList> &> (lookupList).sanitize (c, this)))) |
4515 | 4.91k | return_trace (false); |
4516 | | |
4517 | 923 | #ifndef HB_NO_VAR |
4518 | 923 | if (unlikely (!(version.to_int () < 0x00010001u || featureVars.sanitize (c, this)))) |
4519 | 500 | return_trace (false); |
4520 | 423 | #endif |
4521 | | |
4522 | 923 | return_trace (true); |
4523 | 923 | } bool OT::GSUBGPOSVersion1_2<OT::Layout::SmallTypes>::sanitize<OT::Layout::GPOS_impl::PosLookup>(hb_sanitize_context_t*) const Line | Count | Source | 4509 | 2.65k | { | 4510 | 2.65k | TRACE_SANITIZE (this); | 4511 | 2.65k | typedef List16OfOffsetTo<TLookup, typename Types::HBUINT> TLookupList; | 4512 | 2.65k | if (unlikely (!(scriptList.sanitize (c, this) && | 4513 | 2.65k | featureList.sanitize (c, this) && | 4514 | 2.65k | reinterpret_cast<const typename Types::template OffsetTo<TLookupList> &> (lookupList).sanitize (c, this)))) | 4515 | 2.23k | return_trace (false); | 4516 | | | 4517 | 422 | #ifndef HB_NO_VAR | 4518 | 422 | if (unlikely (!(version.to_int () < 0x00010001u || featureVars.sanitize (c, this)))) | 4519 | 238 | return_trace (false); | 4520 | 184 | #endif | 4521 | | | 4522 | 184 | return_trace (true); | 4523 | 422 | } |
bool OT::GSUBGPOSVersion1_2<OT::Layout::MediumTypes>::sanitize<OT::Layout::GPOS_impl::PosLookup>(hb_sanitize_context_t*) const Line | Count | Source | 4509 | 179 | { | 4510 | 179 | TRACE_SANITIZE (this); | 4511 | 179 | typedef List16OfOffsetTo<TLookup, typename Types::HBUINT> TLookupList; | 4512 | 179 | if (unlikely (!(scriptList.sanitize (c, this) && | 4513 | 179 | featureList.sanitize (c, this) && | 4514 | 179 | reinterpret_cast<const typename Types::template OffsetTo<TLookupList> &> (lookupList).sanitize (c, this)))) | 4515 | 150 | return_trace (false); | 4516 | | | 4517 | 29 | #ifndef HB_NO_VAR | 4518 | 29 | if (unlikely (!(version.to_int () < 0x00010001u || featureVars.sanitize (c, this)))) | 4519 | 25 | return_trace (false); | 4520 | 4 | #endif | 4521 | | | 4522 | 4 | return_trace (true); | 4523 | 29 | } |
bool OT::GSUBGPOSVersion1_2<OT::Layout::SmallTypes>::sanitize<OT::Layout::GSUB_impl::SubstLookup>(hb_sanitize_context_t*) const Line | Count | Source | 4509 | 2.78k | { | 4510 | 2.78k | TRACE_SANITIZE (this); | 4511 | 2.78k | typedef List16OfOffsetTo<TLookup, typename Types::HBUINT> TLookupList; | 4512 | 2.78k | if (unlikely (!(scriptList.sanitize (c, this) && | 4513 | 2.78k | featureList.sanitize (c, this) && | 4514 | 2.78k | reinterpret_cast<const typename Types::template OffsetTo<TLookupList> &> (lookupList).sanitize (c, this)))) | 4515 | 2.35k | return_trace (false); | 4516 | | | 4517 | 435 | #ifndef HB_NO_VAR | 4518 | 435 | if (unlikely (!(version.to_int () < 0x00010001u || featureVars.sanitize (c, this)))) | 4519 | 206 | return_trace (false); | 4520 | 229 | #endif | 4521 | | | 4522 | 229 | return_trace (true); | 4523 | 435 | } |
bool OT::GSUBGPOSVersion1_2<OT::Layout::MediumTypes>::sanitize<OT::Layout::GSUB_impl::SubstLookup>(hb_sanitize_context_t*) const Line | Count | Source | 4509 | 212 | { | 4510 | 212 | TRACE_SANITIZE (this); | 4511 | 212 | typedef List16OfOffsetTo<TLookup, typename Types::HBUINT> TLookupList; | 4512 | 212 | if (unlikely (!(scriptList.sanitize (c, this) && | 4513 | 212 | featureList.sanitize (c, this) && | 4514 | 212 | reinterpret_cast<const typename Types::template OffsetTo<TLookupList> &> (lookupList).sanitize (c, this)))) | 4515 | 175 | return_trace (false); | 4516 | | | 4517 | 37 | #ifndef HB_NO_VAR | 4518 | 37 | if (unlikely (!(version.to_int () < 0x00010001u || featureVars.sanitize (c, this)))) | 4519 | 31 | return_trace (false); | 4520 | 6 | #endif | 4521 | | | 4522 | 6 | return_trace (true); | 4523 | 37 | } |
|
4524 | | |
4525 | | template <typename TLookup> |
4526 | | bool subset (hb_subset_layout_context_t *c) const |
4527 | 0 | { |
4528 | 0 | TRACE_SUBSET (this); |
4529 | 0 |
|
4530 | 0 | auto *out = c->subset_context->serializer->start_embed (this); |
4531 | 0 | if (unlikely (!c->subset_context->serializer->extend_min (out))) return_trace (false); |
4532 | 0 |
|
4533 | 0 | out->version = version; |
4534 | 0 |
|
4535 | 0 | typedef LookupOffsetList<TLookup, typename Types::HBUINT> TLookupList; |
4536 | 0 | reinterpret_cast<typename Types::template OffsetTo<TLookupList> &> (out->lookupList) |
4537 | 0 | .serialize_subset (c->subset_context, |
4538 | 0 | reinterpret_cast<const typename Types::template OffsetTo<TLookupList> &> (lookupList), |
4539 | 0 | this, |
4540 | 0 | c); |
4541 | 0 |
|
4542 | 0 | reinterpret_cast<typename Types::template OffsetTo<RecordListOfFeature> &> (out->featureList) |
4543 | 0 | .serialize_subset (c->subset_context, |
4544 | 0 | reinterpret_cast<const typename Types::template OffsetTo<RecordListOfFeature> &> (featureList), |
4545 | 0 | this, |
4546 | 0 | c); |
4547 | 0 |
|
4548 | 0 | out->scriptList.serialize_subset (c->subset_context, |
4549 | 0 | scriptList, |
4550 | 0 | this, |
4551 | 0 | c); |
4552 | 0 |
|
4553 | 0 | #ifndef HB_NO_VAR |
4554 | 0 | if (version.to_int () >= 0x00010001u) |
4555 | 0 | { |
4556 | 0 | auto snapshot = c->subset_context->serializer->snapshot (); |
4557 | 0 | if (!c->subset_context->serializer->extend_min (&out->featureVars)) |
4558 | 0 | return_trace (false); |
4559 | 0 |
|
4560 | 0 | // if all axes are pinned all feature vars are dropped. |
4561 | 0 | bool ret = !c->subset_context->plan->all_axes_pinned |
4562 | 0 | && out->featureVars.serialize_subset (c->subset_context, featureVars, this, c); |
4563 | 0 | if (!ret && version.major == 1) |
4564 | 0 | { |
4565 | 0 | c->subset_context->serializer->revert (snapshot); |
4566 | 0 | out->version.major = 1; |
4567 | 0 | out->version.minor = 0; |
4568 | 0 | } |
4569 | 0 | } |
4570 | 0 | #endif |
4571 | 0 |
|
4572 | 0 | return_trace (true); |
4573 | 0 | } Unexecuted instantiation: bool OT::GSUBGPOSVersion1_2<OT::Layout::SmallTypes>::subset<OT::Layout::GPOS_impl::PosLookup>(OT::hb_subset_layout_context_t*) const Unexecuted instantiation: bool OT::GSUBGPOSVersion1_2<OT::Layout::MediumTypes>::subset<OT::Layout::GPOS_impl::PosLookup>(OT::hb_subset_layout_context_t*) const Unexecuted instantiation: bool OT::GSUBGPOSVersion1_2<OT::Layout::SmallTypes>::subset<OT::Layout::GSUB_impl::SubstLookup>(OT::hb_subset_layout_context_t*) const Unexecuted instantiation: bool OT::GSUBGPOSVersion1_2<OT::Layout::MediumTypes>::subset<OT::Layout::GSUB_impl::SubstLookup>(OT::hb_subset_layout_context_t*) const |
4574 | | }; |
4575 | | |
4576 | | struct GSUBGPOS |
4577 | | { |
4578 | | unsigned int get_size () const |
4579 | 0 | { |
4580 | 0 | switch (u.version.major) { |
4581 | 0 | case 1: hb_barrier (); return u.version1.get_size (); |
4582 | 0 | #ifndef HB_NO_BEYOND_64K |
4583 | 0 | case 2: hb_barrier (); return u.version2.get_size (); |
4584 | 0 | #endif |
4585 | 0 | default: return u.version.static_size; |
4586 | 0 | } |
4587 | 0 | } |
4588 | | |
4589 | | template <typename TLookup> |
4590 | | bool sanitize (hb_sanitize_context_t *c) const |
4591 | 7.13k | { |
4592 | 7.13k | TRACE_SANITIZE (this); |
4593 | 7.13k | if (unlikely (!u.version.sanitize (c))) return_trace (false); |
4594 | 7.11k | hb_barrier (); |
4595 | 7.11k | switch (u.version.major) { |
4596 | 5.44k | case 1: hb_barrier (); return_trace (u.version1.sanitize<TLookup> (c)); |
4597 | 0 | #ifndef HB_NO_BEYOND_64K |
4598 | 391 | case 2: hb_barrier (); return_trace (u.version2.sanitize<TLookup> (c)); |
4599 | 0 | #endif |
4600 | 1.28k | default: return_trace (true); |
4601 | 7.11k | } |
4602 | 7.11k | } bool OT::GSUBGPOS::sanitize<OT::Layout::GPOS_impl::PosLookup>(hb_sanitize_context_t*) const Line | Count | Source | 4591 | 3.28k | { | 4592 | 3.28k | TRACE_SANITIZE (this); | 4593 | 3.28k | if (unlikely (!u.version.sanitize (c))) return_trace (false); | 4594 | 3.28k | hb_barrier (); | 4595 | 3.28k | switch (u.version.major) { | 4596 | 2.65k | case 1: hb_barrier (); return_trace (u.version1.sanitize<TLookup> (c)); | 4597 | 0 | #ifndef HB_NO_BEYOND_64K | 4598 | 179 | case 2: hb_barrier (); return_trace (u.version2.sanitize<TLookup> (c)); | 4599 | 0 | #endif | 4600 | 447 | default: return_trace (true); | 4601 | 3.28k | } | 4602 | 3.28k | } |
bool OT::GSUBGPOS::sanitize<OT::Layout::GSUB_impl::SubstLookup>(hb_sanitize_context_t*) const Line | Count | Source | 4591 | 3.84k | { | 4592 | 3.84k | TRACE_SANITIZE (this); | 4593 | 3.84k | if (unlikely (!u.version.sanitize (c))) return_trace (false); | 4594 | 3.83k | hb_barrier (); | 4595 | 3.83k | switch (u.version.major) { | 4596 | 2.78k | case 1: hb_barrier (); return_trace (u.version1.sanitize<TLookup> (c)); | 4597 | 0 | #ifndef HB_NO_BEYOND_64K | 4598 | 212 | case 2: hb_barrier (); return_trace (u.version2.sanitize<TLookup> (c)); | 4599 | 0 | #endif | 4600 | 834 | default: return_trace (true); | 4601 | 3.83k | } | 4602 | 3.83k | } |
|
4603 | | |
4604 | | template <typename TLookup> |
4605 | | bool subset (hb_subset_layout_context_t *c) const |
4606 | 0 | { |
4607 | 0 | switch (u.version.major) { |
4608 | 0 | case 1: hb_barrier (); return u.version1.subset<TLookup> (c); |
4609 | 0 | #ifndef HB_NO_BEYOND_64K |
4610 | 0 | case 2: hb_barrier (); return u.version2.subset<TLookup> (c); |
4611 | 0 | #endif |
4612 | 0 | default: return false; |
4613 | 0 | } |
4614 | 0 | } Unexecuted instantiation: bool OT::GSUBGPOS::subset<OT::Layout::GPOS_impl::PosLookup>(OT::hb_subset_layout_context_t*) const Unexecuted instantiation: bool OT::GSUBGPOS::subset<OT::Layout::GSUB_impl::SubstLookup>(OT::hb_subset_layout_context_t*) const |
4615 | | |
4616 | | const ScriptList &get_script_list () const |
4617 | 0 | { |
4618 | 0 | switch (u.version.major) { |
4619 | 0 | case 1: hb_barrier (); return this+u.version1.scriptList; |
4620 | 0 | #ifndef HB_NO_BEYOND_64K |
4621 | 0 | case 2: hb_barrier (); return this+u.version2.scriptList; |
4622 | 0 | #endif |
4623 | 0 | default: return Null (ScriptList); |
4624 | 0 | } |
4625 | 0 | } |
4626 | | const FeatureList &get_feature_list () const |
4627 | 0 | { |
4628 | 0 | switch (u.version.major) { |
4629 | 0 | case 1: hb_barrier (); return this+u.version1.featureList; |
4630 | 0 | #ifndef HB_NO_BEYOND_64K |
4631 | 0 | case 2: hb_barrier (); return this+u.version2.featureList; |
4632 | 0 | #endif |
4633 | 0 | default: return Null (FeatureList); |
4634 | 0 | } |
4635 | 0 | } |
4636 | | unsigned int get_lookup_count () const |
4637 | 34.4k | { |
4638 | 34.4k | switch (u.version.major) { |
4639 | 413 | case 1: hb_barrier (); return (this+u.version1.lookupList).len; |
4640 | 0 | #ifndef HB_NO_BEYOND_64K |
4641 | 10 | case 2: hb_barrier (); return (this+u.version2.lookupList).len; |
4642 | 0 | #endif |
4643 | 34.0k | default: return 0; |
4644 | 34.4k | } |
4645 | 34.4k | } |
4646 | | const Lookup& get_lookup (unsigned int i) const |
4647 | 0 | { |
4648 | 0 | switch (u.version.major) { |
4649 | 0 | case 1: hb_barrier (); return (this+u.version1.lookupList)[i]; |
4650 | 0 | #ifndef HB_NO_BEYOND_64K |
4651 | 0 | case 2: hb_barrier (); return (this+u.version2.lookupList)[i]; |
4652 | 0 | #endif |
4653 | 0 | default: return Null (Lookup); |
4654 | 0 | } |
4655 | 0 | } |
4656 | | const FeatureVariations &get_feature_variations () const |
4657 | 0 | { |
4658 | 0 | switch (u.version.major) { |
4659 | 0 | case 1: hb_barrier (); return (u.version.to_int () >= 0x00010001u && hb_barrier () ? this+u.version1.featureVars : Null (FeatureVariations)); |
4660 | 0 | #ifndef HB_NO_BEYOND_64K |
4661 | 0 | case 2: hb_barrier (); return this+u.version2.featureVars; |
4662 | 0 | #endif |
4663 | 0 | default: return Null (FeatureVariations); |
4664 | 0 | } |
4665 | 0 | } |
4666 | | |
4667 | 0 | bool has_data () const { return u.version.to_int (); } |
4668 | | unsigned int get_script_count () const |
4669 | 0 | { return get_script_list ().len; } |
4670 | | const Tag& get_script_tag (unsigned int i) const |
4671 | 0 | { return get_script_list ().get_tag (i); } |
4672 | | unsigned int get_script_tags (unsigned int start_offset, |
4673 | | unsigned int *script_count /* IN/OUT */, |
4674 | | hb_tag_t *script_tags /* OUT */) const |
4675 | 0 | { return get_script_list ().get_tags (start_offset, script_count, script_tags); } |
4676 | | const Script& get_script (unsigned int i) const |
4677 | 0 | { return get_script_list ()[i]; } |
4678 | | bool find_script_index (hb_tag_t tag, unsigned int *index) const |
4679 | 0 | { return get_script_list ().find_index (tag, index); } |
4680 | | |
4681 | | unsigned int get_feature_count () const |
4682 | 0 | { return get_feature_list ().len; } |
4683 | | hb_tag_t get_feature_tag (unsigned int i) const |
4684 | 0 | { return i == Index::NOT_FOUND_INDEX ? HB_TAG_NONE : get_feature_list ().get_tag (i); } |
4685 | | unsigned int get_feature_tags (unsigned int start_offset, |
4686 | | unsigned int *feature_count /* IN/OUT */, |
4687 | | hb_tag_t *feature_tags /* OUT */) const |
4688 | 0 | { return get_feature_list ().get_tags (start_offset, feature_count, feature_tags); } |
4689 | | const Feature& get_feature (unsigned int i) const |
4690 | 0 | { return get_feature_list ()[i]; } |
4691 | | bool find_feature_index (hb_tag_t tag, unsigned int *index) const |
4692 | 0 | { return get_feature_list ().find_index (tag, index); } |
4693 | | |
4694 | | bool find_variations_index (const int *coords, unsigned int num_coords, |
4695 | | unsigned int *index, |
4696 | | ItemVarStoreInstancer *instancer) const |
4697 | 0 | { |
4698 | | #ifdef HB_NO_VAR |
4699 | | *index = FeatureVariations::NOT_FOUND_INDEX; |
4700 | | return false; |
4701 | | #endif |
4702 | 0 | return get_feature_variations ().find_index (coords, num_coords, index, instancer); |
4703 | 0 | } |
4704 | | const Feature& get_feature_variation (unsigned int feature_index, |
4705 | | unsigned int variations_index) const |
4706 | 0 | { |
4707 | 0 | #ifndef HB_NO_VAR |
4708 | 0 | if (FeatureVariations::NOT_FOUND_INDEX != variations_index && |
4709 | 0 | u.version.to_int () >= 0x00010001u) |
4710 | 0 | { |
4711 | 0 | const Feature *feature = get_feature_variations ().find_substitute (variations_index, |
4712 | 0 | feature_index); |
4713 | 0 | if (feature) |
4714 | 0 | return *feature; |
4715 | 0 | } |
4716 | 0 | #endif |
4717 | 0 | return get_feature (feature_index); |
4718 | 0 | } |
4719 | | |
4720 | | void feature_variation_collect_lookups (const hb_set_t *feature_indexes, |
4721 | | const hb_hashmap_t<unsigned, hb::shared_ptr<hb_set_t>> *feature_record_cond_idx_map, |
4722 | | hb_set_t *lookup_indexes /* OUT */) const |
4723 | 0 | { |
4724 | 0 | #ifndef HB_NO_VAR |
4725 | 0 | get_feature_variations ().collect_lookups (feature_indexes, feature_record_cond_idx_map, lookup_indexes); |
4726 | 0 | #endif |
4727 | 0 | } |
4728 | | |
4729 | | #ifndef HB_NO_VAR |
4730 | | void collect_feature_substitutes_with_variations (hb_collect_feature_substitutes_with_var_context_t *c) const |
4731 | 0 | { get_feature_variations ().collect_feature_substitutes_with_variations (c); } |
4732 | | #endif |
4733 | | |
4734 | | template <typename TLookup> |
4735 | | void closure_lookups (hb_face_t *face, |
4736 | | const hb_set_t *glyphs, |
4737 | | hb_set_t *lookup_indexes /* IN/OUT */) const |
4738 | 0 | { |
4739 | 0 | hb_set_t visited_lookups, inactive_lookups; |
4740 | 0 | hb_closure_lookups_context_t c (face, glyphs, &visited_lookups, &inactive_lookups); |
4741 | 0 |
|
4742 | 0 | c.set_recurse_func (TLookup::template dispatch_recurse_func<hb_closure_lookups_context_t>); |
4743 | 0 |
|
4744 | 0 | for (unsigned lookup_index : *lookup_indexes) |
4745 | 0 | reinterpret_cast<const TLookup &> (get_lookup (lookup_index)).closure_lookups (&c, lookup_index); |
4746 | 0 |
|
4747 | 0 | hb_set_union (lookup_indexes, &visited_lookups); |
4748 | 0 | hb_set_subtract (lookup_indexes, &inactive_lookups); |
4749 | 0 | } Unexecuted instantiation: void OT::GSUBGPOS::closure_lookups<OT::Layout::GPOS_impl::PosLookup>(hb_face_t*, hb_set_t const*, hb_set_t*) const Unexecuted instantiation: void OT::GSUBGPOS::closure_lookups<OT::Layout::GSUB_impl::SubstLookup>(hb_face_t*, hb_set_t const*, hb_set_t*) const |
4750 | | |
4751 | | void prune_langsys (const hb_map_t *duplicate_feature_map, |
4752 | | const hb_set_t *layout_scripts, |
4753 | | hb_hashmap_t<unsigned, hb::unique_ptr<hb_set_t>> *script_langsys_map, |
4754 | | hb_set_t *new_feature_indexes /* OUT */) const |
4755 | 0 | { |
4756 | 0 | hb_prune_langsys_context_t c (this, script_langsys_map, duplicate_feature_map, new_feature_indexes); |
4757 | 0 |
|
4758 | 0 | unsigned count = get_script_count (); |
4759 | 0 | for (unsigned script_index = 0; script_index < count; script_index++) |
4760 | 0 | { |
4761 | 0 | const Tag& tag = get_script_tag (script_index); |
4762 | 0 | if (!layout_scripts->has (tag)) continue; |
4763 | 0 | const Script& s = get_script (script_index); |
4764 | 0 | s.prune_langsys (&c, script_index); |
4765 | 0 | } |
4766 | 0 | } |
4767 | | |
4768 | | void prune_features (const hb_map_t *lookup_indices, /* IN */ |
4769 | | const hb_hashmap_t<unsigned, hb::shared_ptr<hb_set_t>> *feature_record_cond_idx_map, /* IN */ |
4770 | | const hb_hashmap_t<unsigned, const Feature*> *feature_substitutes_map, /* IN */ |
4771 | | hb_set_t *feature_indices /* IN/OUT */) const |
4772 | 0 | { |
4773 | 0 | #ifndef HB_NO_VAR |
4774 | 0 | // This is the set of feature indices which have alternate versions defined |
4775 | 0 | // if the FeatureVariation's table and the alternate version(s) intersect the |
4776 | 0 | // set of lookup indices. |
4777 | 0 | hb_set_t alternate_feature_indices; |
4778 | 0 | get_feature_variations ().closure_features (lookup_indices, feature_record_cond_idx_map, &alternate_feature_indices); |
4779 | 0 | if (unlikely (alternate_feature_indices.in_error())) |
4780 | 0 | { |
4781 | 0 | feature_indices->err (); |
4782 | 0 | return; |
4783 | 0 | } |
4784 | 0 | #endif |
4785 | 0 |
|
4786 | 0 | for (unsigned i : hb_iter (feature_indices)) |
4787 | 0 | { |
4788 | 0 | hb_tag_t tag = get_feature_tag (i); |
4789 | 0 | if (tag == HB_TAG ('p', 'r', 'e', 'f')) |
4790 | 0 | // Note: Never ever drop feature 'pref', even if it's empty. |
4791 | 0 | // HarfBuzz chooses shaper for Khmer based on presence of this |
4792 | 0 | // feature. See thread at: |
4793 | 0 | // http://lists.freedesktop.org/archives/harfbuzz/2012-November/002660.html |
4794 | 0 | continue; |
4795 | 0 |
|
4796 | 0 |
|
4797 | 0 | const Feature *f = &(get_feature (i)); |
4798 | 0 | const Feature** p = nullptr; |
4799 | 0 | if (feature_substitutes_map->has (i, &p)) |
4800 | 0 | f = *p; |
4801 | 0 |
|
4802 | 0 | if (!f->featureParams.is_null () && |
4803 | 0 | tag == HB_TAG ('s', 'i', 'z', 'e')) |
4804 | 0 | continue; |
4805 | 0 |
|
4806 | 0 | if (!f->intersects_lookup_indexes (lookup_indices) |
4807 | 0 | #ifndef HB_NO_VAR |
4808 | 0 | && !alternate_feature_indices.has (i) |
4809 | 0 | #endif |
4810 | 0 | ) |
4811 | 0 | feature_indices->del (i); |
4812 | 0 | } |
4813 | 0 | } |
4814 | | |
4815 | | void collect_name_ids (const hb_map_t *feature_index_map, |
4816 | | hb_set_t *nameids_to_retain /* OUT */) const |
4817 | 0 | { |
4818 | 0 | unsigned count = get_feature_count (); |
4819 | 0 | for (unsigned i = 0 ; i < count; i++) |
4820 | 0 | { |
4821 | 0 | if (!feature_index_map->has (i)) continue; |
4822 | 0 | hb_tag_t tag = get_feature_tag (i); |
4823 | 0 | get_feature (i).collect_name_ids (tag, nameids_to_retain); |
4824 | 0 | } |
4825 | 0 | } |
4826 | | |
4827 | | template <typename T> |
4828 | | struct accelerator_t |
4829 | | { |
4830 | | accelerator_t (hb_face_t *face) |
4831 | 34.4k | { |
4832 | 34.4k | hb_sanitize_context_t sc; |
4833 | 34.4k | sc.lazy_some_gpos = true; |
4834 | 34.4k | this->table = sc.reference_table<T> (face); |
4835 | | |
4836 | 34.4k | if (unlikely (this->table->is_blocklisted (this->table.get_blob (), face))) |
4837 | 0 | { |
4838 | 0 | hb_blob_destroy (this->table.get_blob ()); |
4839 | 0 | this->table = hb_blob_get_empty (); |
4840 | 0 | } |
4841 | | |
4842 | 34.4k | this->lookup_count = table->get_lookup_count (); |
4843 | | |
4844 | 34.4k | this->accels = (hb_atomic_t<hb_ot_layout_lookup_accelerator_t *> *) hb_calloc (this->lookup_count, sizeof (*accels)); |
4845 | 34.4k | if (unlikely (!this->accels)) |
4846 | 524 | { |
4847 | 524 | this->lookup_count = 0; |
4848 | 524 | this->table.destroy (); |
4849 | 524 | this->table = hb_blob_get_empty (); |
4850 | 524 | } |
4851 | 34.4k | } OT::GSUBGPOS::accelerator_t<OT::Layout::GSUB>::accelerator_t(hb_face_t*) Line | Count | Source | 4831 | 17.2k | { | 4832 | 17.2k | hb_sanitize_context_t sc; | 4833 | 17.2k | sc.lazy_some_gpos = true; | 4834 | 17.2k | this->table = sc.reference_table<T> (face); | 4835 | | | 4836 | 17.2k | if (unlikely (this->table->is_blocklisted (this->table.get_blob (), face))) | 4837 | 0 | { | 4838 | 0 | hb_blob_destroy (this->table.get_blob ()); | 4839 | 0 | this->table = hb_blob_get_empty (); | 4840 | 0 | } | 4841 | | | 4842 | 17.2k | this->lookup_count = table->get_lookup_count (); | 4843 | | | 4844 | 17.2k | this->accels = (hb_atomic_t<hb_ot_layout_lookup_accelerator_t *> *) hb_calloc (this->lookup_count, sizeof (*accels)); | 4845 | 17.2k | if (unlikely (!this->accels)) | 4846 | 245 | { | 4847 | 245 | this->lookup_count = 0; | 4848 | 245 | this->table.destroy (); | 4849 | 245 | this->table = hb_blob_get_empty (); | 4850 | 245 | } | 4851 | 17.2k | } |
OT::GSUBGPOS::accelerator_t<OT::Layout::GPOS>::accelerator_t(hb_face_t*) Line | Count | Source | 4831 | 17.2k | { | 4832 | 17.2k | hb_sanitize_context_t sc; | 4833 | 17.2k | sc.lazy_some_gpos = true; | 4834 | 17.2k | this->table = sc.reference_table<T> (face); | 4835 | | | 4836 | 17.2k | if (unlikely (this->table->is_blocklisted (this->table.get_blob (), face))) | 4837 | 0 | { | 4838 | 0 | hb_blob_destroy (this->table.get_blob ()); | 4839 | 0 | this->table = hb_blob_get_empty (); | 4840 | 0 | } | 4841 | | | 4842 | 17.2k | this->lookup_count = table->get_lookup_count (); | 4843 | | | 4844 | 17.2k | this->accels = (hb_atomic_t<hb_ot_layout_lookup_accelerator_t *> *) hb_calloc (this->lookup_count, sizeof (*accels)); | 4845 | 17.2k | if (unlikely (!this->accels)) | 4846 | 279 | { | 4847 | 279 | this->lookup_count = 0; | 4848 | 279 | this->table.destroy (); | 4849 | 279 | this->table = hb_blob_get_empty (); | 4850 | 279 | } | 4851 | 17.2k | } |
|
4852 | | ~accelerator_t () |
4853 | 34.4k | { |
4854 | 38.4k | for (unsigned int i = 0; i < this->lookup_count; i++) |
4855 | 4.00k | { |
4856 | 4.00k | auto *accel = this->accels[i].get_relaxed (); |
4857 | 4.00k | if (accel) |
4858 | 0 | accel->fini (); |
4859 | 4.00k | hb_free (accel); |
4860 | 4.00k | } |
4861 | 34.4k | hb_free (this->accels); |
4862 | 34.4k | this->table.destroy (); |
4863 | 34.4k | } OT::GSUBGPOS::accelerator_t<OT::Layout::GSUB>::~accelerator_t() Line | Count | Source | 4853 | 17.2k | { | 4854 | 19.2k | for (unsigned int i = 0; i < this->lookup_count; i++) | 4855 | 2.03k | { | 4856 | 2.03k | auto *accel = this->accels[i].get_relaxed (); | 4857 | 2.03k | if (accel) | 4858 | 0 | accel->fini (); | 4859 | 2.03k | hb_free (accel); | 4860 | 2.03k | } | 4861 | 17.2k | hb_free (this->accels); | 4862 | 17.2k | this->table.destroy (); | 4863 | 17.2k | } |
OT::GSUBGPOS::accelerator_t<OT::Layout::GPOS>::~accelerator_t() Line | Count | Source | 4853 | 17.2k | { | 4854 | 19.2k | for (unsigned int i = 0; i < this->lookup_count; i++) | 4855 | 1.96k | { | 4856 | 1.96k | auto *accel = this->accels[i].get_relaxed (); | 4857 | 1.96k | if (accel) | 4858 | 0 | accel->fini (); | 4859 | 1.96k | hb_free (accel); | 4860 | 1.96k | } | 4861 | 17.2k | hb_free (this->accels); | 4862 | 17.2k | this->table.destroy (); | 4863 | 17.2k | } |
|
4864 | | |
4865 | 0 | hb_blob_t *get_blob () const { return table.get_blob (); }Unexecuted instantiation: OT::GSUBGPOS::accelerator_t<OT::Layout::GSUB>::get_blob() const Unexecuted instantiation: OT::GSUBGPOS::accelerator_t<OT::Layout::GPOS>::get_blob() const |
4866 | | |
4867 | | hb_ot_layout_lookup_accelerator_t *get_accel (unsigned lookup_index) const |
4868 | 0 | { |
4869 | 0 | if (unlikely (lookup_index >= lookup_count)) return nullptr; |
4870 | | |
4871 | 0 | retry: |
4872 | 0 | auto *accel = accels[lookup_index].get_acquire (); |
4873 | 0 | if (unlikely (!accel)) |
4874 | 0 | { |
4875 | 0 | accel = hb_ot_layout_lookup_accelerator_t::create (table->get_lookup (lookup_index)); |
4876 | 0 | if (unlikely (!accel)) |
4877 | 0 | return nullptr; |
4878 | | |
4879 | 0 | if (unlikely (!accels[lookup_index].cmpexch (nullptr, accel))) |
4880 | 0 | { |
4881 | 0 | accel->fini (); |
4882 | 0 | hb_free (accel); |
4883 | 0 | goto retry; |
4884 | 0 | } |
4885 | 0 | } |
4886 | | |
4887 | 0 | return accel; |
4888 | 0 | } Unexecuted instantiation: OT::GSUBGPOS::accelerator_t<OT::Layout::GPOS>::get_accel(unsigned int) const Unexecuted instantiation: OT::GSUBGPOS::accelerator_t<OT::Layout::GSUB>::get_accel(unsigned int) const |
4889 | | |
4890 | | hb_blob_ptr_t<T> table; |
4891 | | unsigned int lookup_count; |
4892 | | hb_atomic_t<hb_ot_layout_lookup_accelerator_t *> *accels; |
4893 | | }; |
4894 | | |
4895 | | protected: |
4896 | | union { |
4897 | | FixedVersion<> version; /* Version identifier */ |
4898 | | GSUBGPOSVersion1_2<SmallTypes> version1; |
4899 | | #ifndef HB_NO_BEYOND_64K |
4900 | | GSUBGPOSVersion1_2<MediumTypes> version2; |
4901 | | #endif |
4902 | | } u; |
4903 | | public: |
4904 | | DEFINE_SIZE_MIN (4); |
4905 | | }; |
4906 | | |
4907 | | |
4908 | | } /* namespace OT */ |
4909 | | |
4910 | | |
4911 | | #endif /* HB_OT_LAYOUT_GSUBGPOS_HH */ |