[aat] Refactor a method

pull/5042/head
Behdad Esfahbod 1 week ago
parent cd5dfc6dbe
commit cec5c57130
  1. 9
      src/hb-aat-layout-common.hh
  2. 15
      src/hb-aat-layout-morx-table.hh

@ -86,6 +86,15 @@ struct hb_aat_apply_context_t :
HB_INTERNAL void set_ankr_table (const AAT::ankr *ankr_table_); HB_INTERNAL void set_ankr_table (const AAT::ankr *ankr_table_);
void set_lookup_index (unsigned int i) { lookup_index = i; } void set_lookup_index (unsigned int i) { lookup_index = i; }
void setup_buffer_glyph_set ()
{
buffer_glyph_set = buffer->bit_set ();
}
bool buffer_intersects_machine () const
{
return buffer_glyph_set.intersects (*machine_glyph_set);
}
}; };

@ -177,7 +177,7 @@ struct RearrangementSubtable
StateTableDriver<Types, EntryData, Flags> driver (machine, c->face); StateTableDriver<Types, EntryData, Flags> driver (machine, c->face);
if (!c->buffer_glyph_set.intersects (*c->machine_glyph_set)) if (!c->buffer_intersects_machine ())
{ {
(void) c->buffer->message (c->font, "skipped chainsubtable because no glyph matches"); (void) c->buffer->message (c->font, "skipped chainsubtable because no glyph matches");
return_trace (false); return_trace (false);
@ -347,7 +347,7 @@ struct ContextualSubtable
StateTableDriver<Types, EntryData, Flags> driver (machine, c->face); StateTableDriver<Types, EntryData, Flags> driver (machine, c->face);
if (!c->buffer_glyph_set.intersects (*c->machine_glyph_set)) if (!c->buffer_intersects_machine ())
{ {
(void) c->buffer->message (c->font, "skipped chainsubtable because no glyph matches"); (void) c->buffer->message (c->font, "skipped chainsubtable because no glyph matches");
return_trace (false); return_trace (false);
@ -623,7 +623,7 @@ struct LigatureSubtable
StateTableDriver<Types, EntryData, Flags> driver (machine, c->face); StateTableDriver<Types, EntryData, Flags> driver (machine, c->face);
if (!c->buffer_glyph_set.intersects (*c->machine_glyph_set)) if (!c->buffer_intersects_machine ())
{ {
(void) c->buffer->message (c->font, "skipped chainsubtable because no glyph matches"); (void) c->buffer->message (c->font, "skipped chainsubtable because no glyph matches");
return_trace (false); return_trace (false);
@ -664,8 +664,11 @@ struct NoncontextualSubtable
{ {
TRACE_APPLY (this); TRACE_APPLY (this);
if (!c->buffer_glyph_set.intersects (*c->machine_glyph_set)) if (!c->buffer_intersects_machine ())
{
(void) c->buffer->message (c->font, "skipped chainsubtable because no glyph matches");
return_trace (false); return_trace (false);
}
const OT::GDEF &gdef (*c->gdef_table); const OT::GDEF &gdef (*c->gdef_table);
bool has_glyph_classes = gdef.has_glyph_classes (); bool has_glyph_classes = gdef.has_glyph_classes ();
@ -917,7 +920,7 @@ struct InsertionSubtable
StateTableDriver<Types, EntryData, Flags> driver (machine, c->face); StateTableDriver<Types, EntryData, Flags> driver (machine, c->face);
if (!c->buffer_glyph_set.intersects (*c->machine_glyph_set)) if (!c->buffer_intersects_machine ())
{ {
(void) c->buffer->message (c->font, "skipped chainsubtable because no glyph matches"); (void) c->buffer->message (c->font, "skipped chainsubtable because no glyph matches");
return_trace (false); return_trace (false);
@ -1452,7 +1455,7 @@ struct mortmorx
c->buffer->unsafe_to_concat (); c->buffer->unsafe_to_concat ();
c->buffer_glyph_set = c->buffer->bit_set (); c->setup_buffer_glyph_set ();
c->set_lookup_index (0); c->set_lookup_index (0);
const Chain<Types> *chain = &firstChain; const Chain<Types> *chain = &firstChain;

Loading…
Cancel
Save