This commit is contained in:
parent
29f149c16c
commit
5192294f83
|
@ -33,10 +33,10 @@ struct ReverseChainSingleSubstFormat1
|
||||||
TRACE_SANITIZE (this);
|
TRACE_SANITIZE (this);
|
||||||
if (!(coverage.sanitize (c, this) && backtrack.sanitize (c, this)))
|
if (!(coverage.sanitize (c, this) && backtrack.sanitize (c, this)))
|
||||||
return_trace (false);
|
return_trace (false);
|
||||||
const Array16OfOffset16To<Coverage> &lookahead = StructAfter<Array16OfOffset16To<Coverage>> (backtrack);
|
const auto &lookahead = StructAfter<decltype (lookaheadX)> (backtrack);
|
||||||
if (!lookahead.sanitize (c, this))
|
if (!lookahead.sanitize (c, this))
|
||||||
return_trace (false);
|
return_trace (false);
|
||||||
const Array16Of<HBGlyphID16> &substitute = StructAfter<Array16Of<HBGlyphID16>> (lookahead);
|
const auto &substitute = StructAfter<decltype (substituteX)> (lookahead);
|
||||||
return_trace (substitute.sanitize (c));
|
return_trace (substitute.sanitize (c));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ struct ReverseChainSingleSubstFormat1
|
||||||
if (!(this+coverage).intersects (glyphs))
|
if (!(this+coverage).intersects (glyphs))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
const Array16OfOffset16To<Coverage> &lookahead = StructAfter<Array16OfOffset16To<Coverage>> (backtrack);
|
const auto &lookahead = StructAfter<decltype (lookaheadX)> (backtrack);
|
||||||
|
|
||||||
unsigned int count;
|
unsigned int count;
|
||||||
|
|
||||||
|
@ -69,8 +69,8 @@ struct ReverseChainSingleSubstFormat1
|
||||||
{
|
{
|
||||||
if (!intersects (c->glyphs)) return;
|
if (!intersects (c->glyphs)) return;
|
||||||
|
|
||||||
const Array16OfOffset16To<Coverage> &lookahead = StructAfter<Array16OfOffset16To<Coverage>> (backtrack);
|
const auto &lookahead = StructAfter<decltype (lookaheadX)> (backtrack);
|
||||||
const Array16Of<HBGlyphID16> &substitute = StructAfter<Array16Of<HBGlyphID16>> (lookahead);
|
const auto &substitute = StructAfter<decltype (substituteX)> (lookahead);
|
||||||
|
|
||||||
+ hb_zip (this+coverage, substitute)
|
+ hb_zip (this+coverage, substitute)
|
||||||
| hb_filter (c->parent_active_glyphs (), hb_first)
|
| hb_filter (c->parent_active_glyphs (), hb_first)
|
||||||
|
@ -91,12 +91,12 @@ struct ReverseChainSingleSubstFormat1
|
||||||
for (unsigned int i = 0; i < count; i++)
|
for (unsigned int i = 0; i < count; i++)
|
||||||
if (unlikely (!(this+backtrack[i]).collect_coverage (c->before))) return;
|
if (unlikely (!(this+backtrack[i]).collect_coverage (c->before))) return;
|
||||||
|
|
||||||
const Array16OfOffset16To<Coverage> &lookahead = StructAfter<Array16OfOffset16To<Coverage>> (backtrack);
|
const auto &lookahead = StructAfter<decltype (lookaheadX)> (backtrack);
|
||||||
count = lookahead.len;
|
count = lookahead.len;
|
||||||
for (unsigned int i = 0; i < count; i++)
|
for (unsigned int i = 0; i < count; i++)
|
||||||
if (unlikely (!(this+lookahead[i]).collect_coverage (c->after))) return;
|
if (unlikely (!(this+lookahead[i]).collect_coverage (c->after))) return;
|
||||||
|
|
||||||
const Array16Of<HBGlyphID16> &substitute = StructAfter<Array16Of<HBGlyphID16>> (lookahead);
|
const auto &substitute = StructAfter<decltype (substituteX)> (lookahead);
|
||||||
count = substitute.len;
|
count = substitute.len;
|
||||||
c->output->add_array (substitute.arrayZ, substitute.len);
|
c->output->add_array (substitute.arrayZ, substitute.len);
|
||||||
}
|
}
|
||||||
|
@ -115,8 +115,8 @@ struct ReverseChainSingleSubstFormat1
|
||||||
unsigned int index = (this+coverage).get_coverage (c->buffer->cur ().codepoint);
|
unsigned int index = (this+coverage).get_coverage (c->buffer->cur ().codepoint);
|
||||||
if (likely (index == NOT_COVERED)) return_trace (false);
|
if (likely (index == NOT_COVERED)) return_trace (false);
|
||||||
|
|
||||||
const Array16OfOffset16To<Coverage> &lookahead = StructAfter<Array16OfOffset16To<Coverage>> (backtrack);
|
const auto &lookahead = StructAfter<decltype (lookaheadX)> (backtrack);
|
||||||
const Array16Of<HBGlyphID16> &substitute = StructAfter<Array16Of<HBGlyphID16>> (lookahead);
|
const auto &substitute = StructAfter<decltype (substituteX)> (lookahead);
|
||||||
|
|
||||||
if (unlikely (index >= substitute.len)) return_trace (false);
|
if (unlikely (index >= substitute.len)) return_trace (false);
|
||||||
|
|
||||||
|
@ -206,8 +206,8 @@ struct ReverseChainSingleSubstFormat1
|
||||||
const hb_set_t &glyphset = *c->plan->glyphset_gsub ();
|
const hb_set_t &glyphset = *c->plan->glyphset_gsub ();
|
||||||
const hb_map_t &glyph_map = *c->plan->glyph_map;
|
const hb_map_t &glyph_map = *c->plan->glyph_map;
|
||||||
|
|
||||||
const Array16OfOffset16To<Coverage> &lookahead = StructAfter<Array16OfOffset16To<Coverage>> (backtrack);
|
const auto &lookahead = StructAfter<decltype (lookaheadX)> (backtrack);
|
||||||
const Array16Of<HBGlyphID16> &substitute = StructAfter<Array16Of<HBGlyphID16>> (lookahead);
|
const auto &substitute = StructAfter<decltype (substituteX)> (lookahead);
|
||||||
|
|
||||||
auto it =
|
auto it =
|
||||||
+ hb_zip (this+coverage, substitute)
|
+ hb_zip (this+coverage, substitute)
|
||||||
|
|
|
@ -1749,8 +1749,8 @@ struct Rule
|
||||||
{
|
{
|
||||||
if (unlikely (c->lookup_limit_exceeded ())) return;
|
if (unlikely (c->lookup_limit_exceeded ())) return;
|
||||||
|
|
||||||
const UnsizedArrayOf<LookupRecord> &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>>
|
const auto &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>>
|
||||||
(inputZ.as_array ((inputCount ? inputCount - 1 : 0)));
|
(inputZ.as_array ((inputCount ? inputCount - 1 : 0)));
|
||||||
context_closure_lookup (c,
|
context_closure_lookup (c,
|
||||||
inputCount, inputZ.arrayZ,
|
inputCount, inputZ.arrayZ,
|
||||||
lookupCount, lookupRecord.arrayZ,
|
lookupCount, lookupRecord.arrayZ,
|
||||||
|
@ -1763,16 +1763,16 @@ struct Rule
|
||||||
if (unlikely (c->lookup_limit_exceeded ())) return;
|
if (unlikely (c->lookup_limit_exceeded ())) return;
|
||||||
if (!intersects (c->glyphs, lookup_context)) return;
|
if (!intersects (c->glyphs, lookup_context)) return;
|
||||||
|
|
||||||
const UnsizedArrayOf<LookupRecord> &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>>
|
const auto &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>>
|
||||||
(inputZ.as_array (inputCount ? inputCount - 1 : 0));
|
(inputZ.as_array (inputCount ? inputCount - 1 : 0));
|
||||||
recurse_lookups (c, lookupCount, lookupRecord.arrayZ);
|
recurse_lookups (c, lookupCount, lookupRecord.arrayZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
void collect_glyphs (hb_collect_glyphs_context_t *c,
|
void collect_glyphs (hb_collect_glyphs_context_t *c,
|
||||||
ContextCollectGlyphsLookupContext &lookup_context) const
|
ContextCollectGlyphsLookupContext &lookup_context) const
|
||||||
{
|
{
|
||||||
const UnsizedArrayOf<LookupRecord> &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>>
|
const auto &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>>
|
||||||
(inputZ.as_array (inputCount ? inputCount - 1 : 0));
|
(inputZ.as_array (inputCount ? inputCount - 1 : 0));
|
||||||
context_collect_glyphs_lookup (c,
|
context_collect_glyphs_lookup (c,
|
||||||
inputCount, inputZ.arrayZ,
|
inputCount, inputZ.arrayZ,
|
||||||
lookupCount, lookupRecord.arrayZ,
|
lookupCount, lookupRecord.arrayZ,
|
||||||
|
@ -1782,8 +1782,8 @@ struct Rule
|
||||||
bool would_apply (hb_would_apply_context_t *c,
|
bool would_apply (hb_would_apply_context_t *c,
|
||||||
ContextApplyLookupContext &lookup_context) const
|
ContextApplyLookupContext &lookup_context) const
|
||||||
{
|
{
|
||||||
const UnsizedArrayOf<LookupRecord> &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>>
|
const auto &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>>
|
||||||
(inputZ.as_array (inputCount ? inputCount - 1 : 0));
|
(inputZ.as_array (inputCount ? inputCount - 1 : 0));
|
||||||
return context_would_apply_lookup (c,
|
return context_would_apply_lookup (c,
|
||||||
inputCount, inputZ.arrayZ,
|
inputCount, inputZ.arrayZ,
|
||||||
lookupCount, lookupRecord.arrayZ,
|
lookupCount, lookupRecord.arrayZ,
|
||||||
|
@ -1794,8 +1794,8 @@ struct Rule
|
||||||
ContextApplyLookupContext &lookup_context) const
|
ContextApplyLookupContext &lookup_context) const
|
||||||
{
|
{
|
||||||
TRACE_APPLY (this);
|
TRACE_APPLY (this);
|
||||||
const UnsizedArrayOf<LookupRecord> &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>>
|
const auto &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>>
|
||||||
(inputZ.as_array (inputCount ? inputCount - 1 : 0));
|
(inputZ.as_array (inputCount ? inputCount - 1 : 0));
|
||||||
return_trace (context_apply_lookup (c, inputCount, inputZ.arrayZ, lookupCount, lookupRecord.arrayZ, lookup_context));
|
return_trace (context_apply_lookup (c, inputCount, inputZ.arrayZ, lookupCount, lookupRecord.arrayZ, lookup_context));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1816,8 +1816,8 @@ struct Rule
|
||||||
c->copy (d);
|
c->copy (d);
|
||||||
}
|
}
|
||||||
|
|
||||||
const UnsizedArrayOf<LookupRecord> &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>>
|
const auto &lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>>
|
||||||
(inputZ.as_array ((inputCount ? inputCount - 1 : 0)));
|
(inputZ.as_array ((inputCount ? inputCount - 1 : 0)));
|
||||||
|
|
||||||
unsigned count = serialize_lookuprecord_array (c, lookupRecord.as_array (lookupCount), lookup_map);
|
unsigned count = serialize_lookuprecord_array (c, lookupRecord.as_array (lookupCount), lookup_map);
|
||||||
return_trace (c->check_assign (out->lookupCount, count, HB_SERIALIZE_ERROR_INT_OVERFLOW));
|
return_trace (c->check_assign (out->lookupCount, count, HB_SERIALIZE_ERROR_INT_OVERFLOW));
|
||||||
|
@ -2491,7 +2491,7 @@ struct ContextFormat3
|
||||||
if (!o->serialize_subset (c, offset, this)) return_trace (false);
|
if (!o->serialize_subset (c, offset, this)) return_trace (false);
|
||||||
}
|
}
|
||||||
|
|
||||||
const UnsizedArrayOf<LookupRecord>& lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>> (coverageZ.as_array (glyphCount));
|
const auto& lookupRecord = StructAfter<UnsizedArrayOf<LookupRecord>> (coverageZ.as_array (glyphCount));
|
||||||
const hb_map_t *lookup_map = c->table_tag == HB_OT_TAG_GSUB ? c->plan->gsub_lookups : c->plan->gpos_lookups;
|
const hb_map_t *lookup_map = c->table_tag == HB_OT_TAG_GSUB ? c->plan->gsub_lookups : c->plan->gpos_lookups;
|
||||||
|
|
||||||
|
|
||||||
|
@ -2709,8 +2709,8 @@ struct ChainRule
|
||||||
{
|
{
|
||||||
bool intersects (const hb_set_t *glyphs, ChainContextClosureLookupContext &lookup_context) const
|
bool intersects (const hb_set_t *glyphs, ChainContextClosureLookupContext &lookup_context) const
|
||||||
{
|
{
|
||||||
const HeadlessArrayOf<HBUINT16> &input = StructAfter<HeadlessArrayOf<HBUINT16>> (backtrack);
|
const auto &input = StructAfter<HeadlessArrayOf<HBUINT16>> (backtrack);
|
||||||
const Array16Of<HBUINT16> &lookahead = StructAfter<Array16Of<HBUINT16>> (input);
|
const auto &lookahead = StructAfter<Array16Of<HBUINT16>> (input);
|
||||||
return chain_context_intersects (glyphs,
|
return chain_context_intersects (glyphs,
|
||||||
backtrack.len, backtrack.arrayZ,
|
backtrack.len, backtrack.arrayZ,
|
||||||
input.lenP1, input.arrayZ,
|
input.lenP1, input.arrayZ,
|
||||||
|
@ -2723,9 +2723,9 @@ struct ChainRule
|
||||||
{
|
{
|
||||||
if (unlikely (c->lookup_limit_exceeded ())) return;
|
if (unlikely (c->lookup_limit_exceeded ())) return;
|
||||||
|
|
||||||
const HeadlessArrayOf<HBUINT16> &input = StructAfter<HeadlessArrayOf<HBUINT16>> (backtrack);
|
const auto &input = StructAfter<HeadlessArrayOf<HBUINT16>> (backtrack);
|
||||||
const Array16Of<HBUINT16> &lookahead = StructAfter<Array16Of<HBUINT16>> (input);
|
const auto &lookahead = StructAfter<Array16Of<HBUINT16>> (input);
|
||||||
const Array16Of<LookupRecord> &lookup = StructAfter<Array16Of<LookupRecord>> (lookahead);
|
const auto &lookup = StructAfter<Array16Of<LookupRecord>> (lookahead);
|
||||||
chain_context_closure_lookup (c,
|
chain_context_closure_lookup (c,
|
||||||
backtrack.len, backtrack.arrayZ,
|
backtrack.len, backtrack.arrayZ,
|
||||||
input.lenP1, input.arrayZ,
|
input.lenP1, input.arrayZ,
|
||||||
|
@ -2741,18 +2741,18 @@ struct ChainRule
|
||||||
if (unlikely (c->lookup_limit_exceeded ())) return;
|
if (unlikely (c->lookup_limit_exceeded ())) return;
|
||||||
if (!intersects (c->glyphs, lookup_context)) return;
|
if (!intersects (c->glyphs, lookup_context)) return;
|
||||||
|
|
||||||
const HeadlessArrayOf<HBUINT16> &input = StructAfter<HeadlessArrayOf<HBUINT16>> (backtrack);
|
const auto &input = StructAfter<HeadlessArrayOf<HBUINT16>> (backtrack);
|
||||||
const Array16Of<HBUINT16> &lookahead = StructAfter<Array16Of<HBUINT16>> (input);
|
const auto &lookahead = StructAfter<Array16Of<HBUINT16>> (input);
|
||||||
const Array16Of<LookupRecord> &lookup = StructAfter<Array16Of<LookupRecord>> (lookahead);
|
const auto &lookup = StructAfter<Array16Of<LookupRecord>> (lookahead);
|
||||||
recurse_lookups (c, lookup.len, lookup.arrayZ);
|
recurse_lookups (c, lookup.len, lookup.arrayZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
void collect_glyphs (hb_collect_glyphs_context_t *c,
|
void collect_glyphs (hb_collect_glyphs_context_t *c,
|
||||||
ChainContextCollectGlyphsLookupContext &lookup_context) const
|
ChainContextCollectGlyphsLookupContext &lookup_context) const
|
||||||
{
|
{
|
||||||
const HeadlessArrayOf<HBUINT16> &input = StructAfter<HeadlessArrayOf<HBUINT16>> (backtrack);
|
const auto &input = StructAfter<HeadlessArrayOf<HBUINT16>> (backtrack);
|
||||||
const Array16Of<HBUINT16> &lookahead = StructAfter<Array16Of<HBUINT16>> (input);
|
const auto &lookahead = StructAfter<Array16Of<HBUINT16>> (input);
|
||||||
const Array16Of<LookupRecord> &lookup = StructAfter<Array16Of<LookupRecord>> (lookahead);
|
const auto &lookup = StructAfter<Array16Of<LookupRecord>> (lookahead);
|
||||||
chain_context_collect_glyphs_lookup (c,
|
chain_context_collect_glyphs_lookup (c,
|
||||||
backtrack.len, backtrack.arrayZ,
|
backtrack.len, backtrack.arrayZ,
|
||||||
input.lenP1, input.arrayZ,
|
input.lenP1, input.arrayZ,
|
||||||
|
@ -2764,9 +2764,9 @@ struct ChainRule
|
||||||
bool would_apply (hb_would_apply_context_t *c,
|
bool would_apply (hb_would_apply_context_t *c,
|
||||||
ChainContextApplyLookupContext &lookup_context) const
|
ChainContextApplyLookupContext &lookup_context) const
|
||||||
{
|
{
|
||||||
const HeadlessArrayOf<HBUINT16> &input = StructAfter<HeadlessArrayOf<HBUINT16>> (backtrack);
|
const auto &input = StructAfter<HeadlessArrayOf<HBUINT16>> (backtrack);
|
||||||
const Array16Of<HBUINT16> &lookahead = StructAfter<Array16Of<HBUINT16>> (input);
|
const auto &lookahead = StructAfter<Array16Of<HBUINT16>> (input);
|
||||||
const Array16Of<LookupRecord> &lookup = StructAfter<Array16Of<LookupRecord>> (lookahead);
|
const auto &lookup = StructAfter<Array16Of<LookupRecord>> (lookahead);
|
||||||
return chain_context_would_apply_lookup (c,
|
return chain_context_would_apply_lookup (c,
|
||||||
backtrack.len, backtrack.arrayZ,
|
backtrack.len, backtrack.arrayZ,
|
||||||
input.lenP1, input.arrayZ,
|
input.lenP1, input.arrayZ,
|
||||||
|
@ -2777,9 +2777,9 @@ struct ChainRule
|
||||||
bool apply (hb_ot_apply_context_t *c, ChainContextApplyLookupContext &lookup_context) const
|
bool apply (hb_ot_apply_context_t *c, ChainContextApplyLookupContext &lookup_context) const
|
||||||
{
|
{
|
||||||
TRACE_APPLY (this);
|
TRACE_APPLY (this);
|
||||||
const HeadlessArrayOf<HBUINT16> &input = StructAfter<HeadlessArrayOf<HBUINT16>> (backtrack);
|
const auto &input = StructAfter<HeadlessArrayOf<HBUINT16>> (backtrack);
|
||||||
const Array16Of<HBUINT16> &lookahead = StructAfter<Array16Of<HBUINT16>> (input);
|
const auto &lookahead = StructAfter<Array16Of<HBUINT16>> (input);
|
||||||
const Array16Of<LookupRecord> &lookup = StructAfter<Array16Of<LookupRecord>> (lookahead);
|
const auto &lookup = StructAfter<Array16Of<LookupRecord>> (lookahead);
|
||||||
return_trace (chain_context_apply_lookup (c,
|
return_trace (chain_context_apply_lookup (c,
|
||||||
backtrack.len, backtrack.arrayZ,
|
backtrack.len, backtrack.arrayZ,
|
||||||
input.lenP1, input.arrayZ,
|
input.lenP1, input.arrayZ,
|
||||||
|
@ -2812,17 +2812,17 @@ struct ChainRule
|
||||||
serialize_array (c, backtrack.len, + backtrack.iter ()
|
serialize_array (c, backtrack.len, + backtrack.iter ()
|
||||||
| hb_map (mapping));
|
| hb_map (mapping));
|
||||||
|
|
||||||
const HeadlessArrayOf<HBUINT16> &input = StructAfter<HeadlessArrayOf<HBUINT16>> (backtrack);
|
const auto &input = StructAfter<HeadlessArrayOf<HBUINT16>> (backtrack);
|
||||||
if (input_map) mapping = input_map;
|
if (input_map) mapping = input_map;
|
||||||
serialize_array (c, input.lenP1, + input.iter ()
|
serialize_array (c, input.lenP1, + input.iter ()
|
||||||
| hb_map (mapping));
|
| hb_map (mapping));
|
||||||
|
|
||||||
const Array16Of<HBUINT16> &lookahead = StructAfter<Array16Of<HBUINT16>> (input);
|
const auto &lookahead = StructAfter<Array16Of<HBUINT16>> (input);
|
||||||
if (lookahead_map) mapping = lookahead_map;
|
if (lookahead_map) mapping = lookahead_map;
|
||||||
serialize_array (c, lookahead.len, + lookahead.iter ()
|
serialize_array (c, lookahead.len, + lookahead.iter ()
|
||||||
| hb_map (mapping));
|
| hb_map (mapping));
|
||||||
|
|
||||||
const Array16Of<LookupRecord> &lookupRecord = StructAfter<Array16Of<LookupRecord>> (lookahead);
|
const auto &lookupRecord = StructAfter<Array16Of<LookupRecord>> (lookahead);
|
||||||
|
|
||||||
HBUINT16* lookupCount = c->embed (&(lookupRecord.len));
|
HBUINT16* lookupCount = c->embed (&(lookupRecord.len));
|
||||||
if (!lookupCount) return_trace (false);
|
if (!lookupCount) return_trace (false);
|
||||||
|
@ -2839,8 +2839,8 @@ struct ChainRule
|
||||||
{
|
{
|
||||||
TRACE_SUBSET (this);
|
TRACE_SUBSET (this);
|
||||||
|
|
||||||
const HeadlessArrayOf<HBUINT16> &input = StructAfter<HeadlessArrayOf<HBUINT16>> (backtrack);
|
const auto &input = StructAfter<HeadlessArrayOf<HBUINT16>> (backtrack);
|
||||||
const Array16Of<HBUINT16> &lookahead = StructAfter<Array16Of<HBUINT16>> (input);
|
const auto &lookahead = StructAfter<Array16Of<HBUINT16>> (input);
|
||||||
|
|
||||||
if (!backtrack_map)
|
if (!backtrack_map)
|
||||||
{
|
{
|
||||||
|
@ -2869,11 +2869,11 @@ struct ChainRule
|
||||||
{
|
{
|
||||||
TRACE_SANITIZE (this);
|
TRACE_SANITIZE (this);
|
||||||
if (!backtrack.sanitize (c)) return_trace (false);
|
if (!backtrack.sanitize (c)) return_trace (false);
|
||||||
const HeadlessArrayOf<HBUINT16> &input = StructAfter<HeadlessArrayOf<HBUINT16>> (backtrack);
|
const auto &input = StructAfter<HeadlessArrayOf<HBUINT16>> (backtrack);
|
||||||
if (!input.sanitize (c)) return_trace (false);
|
if (!input.sanitize (c)) return_trace (false);
|
||||||
const Array16Of<HBUINT16> &lookahead = StructAfter<Array16Of<HBUINT16>> (input);
|
const auto &lookahead = StructAfter<Array16Of<HBUINT16>> (input);
|
||||||
if (!lookahead.sanitize (c)) return_trace (false);
|
if (!lookahead.sanitize (c)) return_trace (false);
|
||||||
const Array16Of<LookupRecord> &lookup = StructAfter<Array16Of<LookupRecord>> (lookahead);
|
const auto &lookup = StructAfter<Array16Of<LookupRecord>> (lookahead);
|
||||||
return_trace (lookup.sanitize (c));
|
return_trace (lookup.sanitize (c));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3467,12 +3467,12 @@ struct ChainContextFormat3
|
||||||
{
|
{
|
||||||
bool intersects (const hb_set_t *glyphs) const
|
bool intersects (const hb_set_t *glyphs) const
|
||||||
{
|
{
|
||||||
const Array16OfOffset16To<Coverage> &input = StructAfter<Array16OfOffset16To<Coverage>> (backtrack);
|
const auto &input = StructAfter<Array16OfOffset16To<Coverage>> (backtrack);
|
||||||
|
|
||||||
if (!(this+input[0]).intersects (glyphs))
|
if (!(this+input[0]).intersects (glyphs))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
const Array16OfOffset16To<Coverage> &lookahead = StructAfter<Array16OfOffset16To<Coverage>> (input);
|
const auto &lookahead = StructAfter<Array16OfOffset16To<Coverage>> (input);
|
||||||
struct ChainContextClosureLookupContext lookup_context = {
|
struct ChainContextClosureLookupContext lookup_context = {
|
||||||
{intersects_coverage, intersected_coverage_glyphs},
|
{intersects_coverage, intersected_coverage_glyphs},
|
||||||
ContextFormat::CoverageBasedContext,
|
ContextFormat::CoverageBasedContext,
|
||||||
|
@ -3490,7 +3490,7 @@ struct ChainContextFormat3
|
||||||
|
|
||||||
void closure (hb_closure_context_t *c) const
|
void closure (hb_closure_context_t *c) const
|
||||||
{
|
{
|
||||||
const Array16OfOffset16To<Coverage> &input = StructAfter<Array16OfOffset16To<Coverage>> (backtrack);
|
const auto &input = StructAfter<Array16OfOffset16To<Coverage>> (backtrack);
|
||||||
|
|
||||||
if (!(this+input[0]).intersects (c->glyphs))
|
if (!(this+input[0]).intersects (c->glyphs))
|
||||||
return;
|
return;
|
||||||
|
@ -3500,8 +3500,8 @@ struct ChainContextFormat3
|
||||||
cur_active_glyphs);
|
cur_active_glyphs);
|
||||||
|
|
||||||
|
|
||||||
const Array16OfOffset16To<Coverage> &lookahead = StructAfter<Array16OfOffset16To<Coverage>> (input);
|
const auto &lookahead = StructAfter<Array16OfOffset16To<Coverage>> (input);
|
||||||
const Array16Of<LookupRecord> &lookup = StructAfter<Array16Of<LookupRecord>> (lookahead);
|
const auto &lookup = StructAfter<Array16Of<LookupRecord>> (lookahead);
|
||||||
struct ChainContextClosureLookupContext lookup_context = {
|
struct ChainContextClosureLookupContext lookup_context = {
|
||||||
{intersects_coverage, intersected_coverage_glyphs},
|
{intersects_coverage, intersected_coverage_glyphs},
|
||||||
ContextFormat::CoverageBasedContext,
|
ContextFormat::CoverageBasedContext,
|
||||||
|
@ -3522,9 +3522,9 @@ struct ChainContextFormat3
|
||||||
if (!intersects (c->glyphs))
|
if (!intersects (c->glyphs))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
const Array16OfOffset16To<Coverage> &input = StructAfter<Array16OfOffset16To<Coverage>> (backtrack);
|
const auto &input = StructAfter<Array16OfOffset16To<Coverage>> (backtrack);
|
||||||
const Array16OfOffset16To<Coverage> &lookahead = StructAfter<Array16OfOffset16To<Coverage>> (input);
|
const auto &lookahead = StructAfter<Array16OfOffset16To<Coverage>> (input);
|
||||||
const Array16Of<LookupRecord> &lookup = StructAfter<Array16Of<LookupRecord>> (lookahead);
|
const auto &lookup = StructAfter<Array16Of<LookupRecord>> (lookahead);
|
||||||
recurse_lookups (c, lookup.len, lookup.arrayZ);
|
recurse_lookups (c, lookup.len, lookup.arrayZ);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -3532,12 +3532,12 @@ struct ChainContextFormat3
|
||||||
|
|
||||||
void collect_glyphs (hb_collect_glyphs_context_t *c) const
|
void collect_glyphs (hb_collect_glyphs_context_t *c) const
|
||||||
{
|
{
|
||||||
const Array16OfOffset16To<Coverage> &input = StructAfter<Array16OfOffset16To<Coverage>> (backtrack);
|
const auto &input = StructAfter<Array16OfOffset16To<Coverage>> (backtrack);
|
||||||
|
|
||||||
(this+input[0]).collect_coverage (c->input);
|
(this+input[0]).collect_coverage (c->input);
|
||||||
|
|
||||||
const Array16OfOffset16To<Coverage> &lookahead = StructAfter<Array16OfOffset16To<Coverage>> (input);
|
const auto &lookahead = StructAfter<Array16OfOffset16To<Coverage>> (input);
|
||||||
const Array16Of<LookupRecord> &lookup = StructAfter<Array16Of<LookupRecord>> (lookahead);
|
const auto &lookup = StructAfter<Array16Of<LookupRecord>> (lookahead);
|
||||||
struct ChainContextCollectGlyphsLookupContext lookup_context = {
|
struct ChainContextCollectGlyphsLookupContext lookup_context = {
|
||||||
{collect_coverage},
|
{collect_coverage},
|
||||||
{this, this, this}
|
{this, this, this}
|
||||||
|
@ -3552,9 +3552,9 @@ struct ChainContextFormat3
|
||||||
|
|
||||||
bool would_apply (hb_would_apply_context_t *c) const
|
bool would_apply (hb_would_apply_context_t *c) const
|
||||||
{
|
{
|
||||||
const Array16OfOffset16To<Coverage> &input = StructAfter<Array16OfOffset16To<Coverage>> (backtrack);
|
const auto &input = StructAfter<Array16OfOffset16To<Coverage>> (backtrack);
|
||||||
const Array16OfOffset16To<Coverage> &lookahead = StructAfter<Array16OfOffset16To<Coverage>> (input);
|
const auto &lookahead = StructAfter<Array16OfOffset16To<Coverage>> (input);
|
||||||
const Array16Of<LookupRecord> &lookup = StructAfter<Array16Of<LookupRecord>> (lookahead);
|
const auto &lookup = StructAfter<Array16Of<LookupRecord>> (lookahead);
|
||||||
struct ChainContextApplyLookupContext lookup_context = {
|
struct ChainContextApplyLookupContext lookup_context = {
|
||||||
{{match_coverage, match_coverage, match_coverage}},
|
{{match_coverage, match_coverage, match_coverage}},
|
||||||
{this, this, this}
|
{this, this, this}
|
||||||
|
@ -3568,20 +3568,20 @@ struct ChainContextFormat3
|
||||||
|
|
||||||
const Coverage &get_coverage () const
|
const Coverage &get_coverage () const
|
||||||
{
|
{
|
||||||
const Array16OfOffset16To<Coverage> &input = StructAfter<Array16OfOffset16To<Coverage>> (backtrack);
|
const auto &input = StructAfter<Array16OfOffset16To<Coverage>> (backtrack);
|
||||||
return this+input[0];
|
return this+input[0];
|
||||||
}
|
}
|
||||||
|
|
||||||
bool apply (hb_ot_apply_context_t *c) const
|
bool apply (hb_ot_apply_context_t *c) const
|
||||||
{
|
{
|
||||||
TRACE_APPLY (this);
|
TRACE_APPLY (this);
|
||||||
const Array16OfOffset16To<Coverage> &input = StructAfter<Array16OfOffset16To<Coverage>> (backtrack);
|
const auto &input = StructAfter<Array16OfOffset16To<Coverage>> (backtrack);
|
||||||
|
|
||||||
unsigned int index = (this+input[0]).get_coverage (c->buffer->cur().codepoint);
|
unsigned int index = (this+input[0]).get_coverage (c->buffer->cur().codepoint);
|
||||||
if (likely (index == NOT_COVERED)) return_trace (false);
|
if (likely (index == NOT_COVERED)) return_trace (false);
|
||||||
|
|
||||||
const Array16OfOffset16To<Coverage> &lookahead = StructAfter<Array16OfOffset16To<Coverage>> (input);
|
const auto &lookahead = StructAfter<Array16OfOffset16To<Coverage>> (input);
|
||||||
const Array16Of<LookupRecord> &lookup = StructAfter<Array16Of<LookupRecord>> (lookahead);
|
const auto &lookup = StructAfter<Array16Of<LookupRecord>> (lookahead);
|
||||||
struct ChainContextApplyLookupContext lookup_context = {
|
struct ChainContextApplyLookupContext lookup_context = {
|
||||||
{{match_coverage, match_coverage, match_coverage}},
|
{{match_coverage, match_coverage, match_coverage}},
|
||||||
{this, this, this}
|
{this, this, this}
|
||||||
|
@ -3623,15 +3623,15 @@ struct ChainContextFormat3
|
||||||
if (!serialize_coverage_offsets (c, backtrack.iter (), this))
|
if (!serialize_coverage_offsets (c, backtrack.iter (), this))
|
||||||
return_trace (false);
|
return_trace (false);
|
||||||
|
|
||||||
const Array16OfOffset16To<Coverage> &input = StructAfter<Array16OfOffset16To<Coverage>> (backtrack);
|
const auto &input = StructAfter<Array16OfOffset16To<Coverage>> (backtrack);
|
||||||
if (!serialize_coverage_offsets (c, input.iter (), this))
|
if (!serialize_coverage_offsets (c, input.iter (), this))
|
||||||
return_trace (false);
|
return_trace (false);
|
||||||
|
|
||||||
const Array16OfOffset16To<Coverage> &lookahead = StructAfter<Array16OfOffset16To<Coverage>> (input);
|
const auto &lookahead = StructAfter<Array16OfOffset16To<Coverage>> (input);
|
||||||
if (!serialize_coverage_offsets (c, lookahead.iter (), this))
|
if (!serialize_coverage_offsets (c, lookahead.iter (), this))
|
||||||
return_trace (false);
|
return_trace (false);
|
||||||
|
|
||||||
const Array16Of<LookupRecord> &lookupRecord = StructAfter<Array16Of<LookupRecord>> (lookahead);
|
const auto &lookupRecord = StructAfter<Array16Of<LookupRecord>> (lookahead);
|
||||||
const hb_map_t *lookup_map = c->table_tag == HB_OT_TAG_GSUB ? c->plan->gsub_lookups : c->plan->gpos_lookups;
|
const hb_map_t *lookup_map = c->table_tag == HB_OT_TAG_GSUB ? c->plan->gsub_lookups : c->plan->gpos_lookups;
|
||||||
|
|
||||||
HBUINT16 *lookupCount = c->serializer->copy<HBUINT16> (lookupRecord.len);
|
HBUINT16 *lookupCount = c->serializer->copy<HBUINT16> (lookupRecord.len);
|
||||||
|
@ -3645,12 +3645,12 @@ struct ChainContextFormat3
|
||||||
{
|
{
|
||||||
TRACE_SANITIZE (this);
|
TRACE_SANITIZE (this);
|
||||||
if (!backtrack.sanitize (c, this)) return_trace (false);
|
if (!backtrack.sanitize (c, this)) return_trace (false);
|
||||||
const Array16OfOffset16To<Coverage> &input = StructAfter<Array16OfOffset16To<Coverage>> (backtrack);
|
const auto &input = StructAfter<Array16OfOffset16To<Coverage>> (backtrack);
|
||||||
if (!input.sanitize (c, this)) return_trace (false);
|
if (!input.sanitize (c, this)) return_trace (false);
|
||||||
if (!input.len) return_trace (false); /* To be consistent with Context. */
|
if (!input.len) return_trace (false); /* To be consistent with Context. */
|
||||||
const Array16OfOffset16To<Coverage> &lookahead = StructAfter<Array16OfOffset16To<Coverage>> (input);
|
const auto &lookahead = StructAfter<Array16OfOffset16To<Coverage>> (input);
|
||||||
if (!lookahead.sanitize (c, this)) return_trace (false);
|
if (!lookahead.sanitize (c, this)) return_trace (false);
|
||||||
const Array16Of<LookupRecord> &lookup = StructAfter<Array16Of<LookupRecord>> (lookahead);
|
const auto &lookup = StructAfter<Array16Of<LookupRecord>> (lookahead);
|
||||||
return_trace (lookup.sanitize (c));
|
return_trace (lookup.sanitize (c));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue