machine.get_class (buffer->info[buffer->idx].codepoint, num_glyphs) :
(unsigned) StateTable<Types, EntryData>::CLASS_END_OF_TEXT;
DEBUG_MSG (APPLY, nullptr, "c%u at %u", klass, buffer->idx);
- const Entry<EntryData> *entry = &machine.get_entry (state, klass);
+ const Entry<EntryData> &entry = machine.get_entry (state, klass);
/* Unsafe-to-break before this if not in state 0, as things might
* go differently if we start from state 0 here.
/* If there's no action and we're just epsilon-transitioning to state 0,
* safe to break. */
if (c->is_actionable (this, entry) ||
- !(entry->newState == StateTable<Types, EntryData>::STATE_START_OF_TEXT &&
- entry->flags == context_t::DontAdvance))
+ !(entry.newState == StateTable<Types, EntryData>::STATE_START_OF_TEXT &&
+ entry.flags == context_t::DontAdvance))
buffer->unsafe_to_break_from_outbuffer (buffer->backtrack_len () - 1, buffer->idx + 1);
}
/* Unsafe-to-break if end-of-text would kick in here. */
if (buffer->idx + 2 <= buffer->len)
{
- const Entry<EntryData> *end_entry = &machine.get_entry (state, StateTable<Types, EntryData>::CLASS_END_OF_TEXT);
+ const Entry<EntryData> &end_entry = machine.get_entry (state, StateTable<Types, EntryData>::CLASS_END_OF_TEXT);
if (c->is_actionable (this, end_entry))
buffer->unsafe_to_break (buffer->idx, buffer->idx + 2);
}
if (unlikely (!c->transition (this, entry)))
break;
- state = machine.new_state (entry->newState);
+ state = machine.new_state (entry.newState);
DEBUG_MSG (APPLY, nullptr, "s%d", state);
if (buffer->idx == buffer->len)
break;
- if (!(entry->flags & context_t::DontAdvance) || buffer->max_ops-- <= 0)
+ if (!(entry.flags & context_t::DontAdvance) || buffer->max_ops-- <= 0)
buffer->next_glyph ();
}
DEFINE_SIZE_STATIC (2);
};
- static bool performAction (const Entry<EntryData> *entry)
- { return entry->data.kernActionIndex != 0xFFFF; }
+ static bool performAction (const Entry<EntryData> &entry)
+ { return entry.data.kernActionIndex != 0xFFFF; }
- static unsigned int kernActionIndex (const Entry<EntryData> *entry)
- { return entry->data.kernActionIndex; }
+ static unsigned int kernActionIndex (const Entry<EntryData> &entry)
+ { return entry.data.kernActionIndex; }
};
template <>
struct Format1Entry<false>
typedef void EntryData;
- static bool performAction (const Entry<EntryData> *entry)
- { return entry->flags & Offset; }
+ static bool performAction (const Entry<EntryData> &entry)
+ { return entry.flags & Offset; }
- static unsigned int kernActionIndex (const Entry<EntryData> *entry)
- { return entry->flags & Offset; }
+ static unsigned int kernActionIndex (const Entry<EntryData> &entry)
+ { return entry.flags & Offset; }
};
template <typename KernSubTableHeader>
crossStream (table->header.coverage & table->header.CrossStream) {}
bool is_actionable (StateTableDriver<Types, EntryData> *driver HB_UNUSED,
- const Entry<EntryData> *entry)
+ const Entry<EntryData> &entry)
{
return Format1EntryT::performAction (entry);
}
bool transition (StateTableDriver<Types, EntryData> *driver,
- const Entry<EntryData> *entry)
+ const Entry<EntryData> &entry)
{
hb_buffer_t *buffer = driver->buffer;
- unsigned int flags = entry->flags;
+ unsigned int flags = entry.flags;
if (flags & Format1EntryT::Reset)
depth = 0;
mark (0) {}
bool is_actionable (StateTableDriver<Types, EntryData> *driver HB_UNUSED,
- const Entry<EntryData> *entry)
+ const Entry<EntryData> &entry)
{
- return entry->data.ankrActionIndex != 0xFFFF;
+ return entry.data.ankrActionIndex != 0xFFFF;
}
bool transition (StateTableDriver<Types, EntryData> *driver,
- const Entry<EntryData> *entry)
+ const Entry<EntryData> &entry)
{
hb_buffer_t *buffer = driver->buffer;
- if (mark_set && entry->data.ankrActionIndex != 0xFFFF && buffer->idx < buffer->len)
+ if (mark_set && entry.data.ankrActionIndex != 0xFFFF && buffer->idx < buffer->len)
{
hb_glyph_position_t &o = buffer->cur_pos();
switch (action_type)
case 0: /* Control Point Actions.*/
{
/* indexed into glyph outline. */
- const HBUINT16 *data = &ankrData[entry->data.ankrActionIndex];
+ const HBUINT16 *data = &ankrData[entry.data.ankrActionIndex];
if (!c->sanitizer.check_array (data, 2))
return false;
HB_UNUSED unsigned int markControlPoint = *data++;
case 1: /* Anchor Point Actions. */
{
/* Indexed into 'ankr' table. */
- const HBUINT16 *data = &ankrData[entry->data.ankrActionIndex];
+ const HBUINT16 *data = &ankrData[entry.data.ankrActionIndex];
if (!c->sanitizer.check_array (data, 2))
return false;
unsigned int markAnchorPoint = *data++;
case 2: /* Control Point Coordinate Actions. */
{
- const FWORD *data = (const FWORD *) &ankrData[entry->data.ankrActionIndex];
+ const FWORD *data = (const FWORD *) &ankrData[entry.data.ankrActionIndex];
if (!c->sanitizer.check_array (data, 4))
return false;
int markX = *data++;
buffer->scratch_flags |= HB_BUFFER_SCRATCH_FLAG_HAS_GPOS_ATTACHMENT;
}
- if (entry->flags & Mark)
+ if (entry.flags & Mark)
{
mark_set = true;
mark = buffer->idx;
start (0), end (0) {}
bool is_actionable (StateTableDriver<Types, EntryData> *driver HB_UNUSED,
- const Entry<EntryData> *entry)
+ const Entry<EntryData> &entry)
{
- return (entry->flags & Verb) && start < end;
+ return (entry.flags & Verb) && start < end;
}
bool transition (StateTableDriver<Types, EntryData> *driver,
- const Entry<EntryData> *entry)
+ const Entry<EntryData> &entry)
{
hb_buffer_t *buffer = driver->buffer;
- unsigned int flags = entry->flags;
+ unsigned int flags = entry.flags;
if (flags & MarkFirst)
start = buffer->idx;
subs (table+table->substitutionTables) {}
bool is_actionable (StateTableDriver<Types, EntryData> *driver,
- const Entry<EntryData> *entry)
+ const Entry<EntryData> &entry)
{
hb_buffer_t *buffer = driver->buffer;
if (buffer->idx == buffer->len && !mark_set)
return false;
- return entry->data.markIndex != 0xFFFF || entry->data.currentIndex != 0xFFFF;
+ return entry.data.markIndex != 0xFFFF || entry.data.currentIndex != 0xFFFF;
}
bool transition (StateTableDriver<Types, EntryData> *driver,
- const Entry<EntryData> *entry)
+ const Entry<EntryData> &entry)
{
hb_buffer_t *buffer = driver->buffer;
replacement = nullptr;
if (Types::extended)
{
- if (entry->data.markIndex != 0xFFFF)
+ if (entry.data.markIndex != 0xFFFF)
{
- const Lookup<GlyphID> &lookup = subs[entry->data.markIndex];
+ const Lookup<GlyphID> &lookup = subs[entry.data.markIndex];
replacement = lookup.get_value (buffer->info[mark].codepoint, driver->num_glyphs);
}
}
else
{
- unsigned int offset = entry->data.markIndex + buffer->info[mark].codepoint;
+ unsigned int offset = entry.data.markIndex + buffer->info[mark].codepoint;
const UnsizedArrayOf<GlyphID> &subs_old = (const UnsizedArrayOf<GlyphID> &) subs;
replacement = &subs_old[Types::wordOffsetToIndex (offset, table, subs_old.arrayZ)];
if (!replacement->sanitize (&c->sanitizer) || !*replacement)
unsigned int idx = MIN (buffer->idx, buffer->len - 1);
if (Types::extended)
{
- if (entry->data.currentIndex != 0xFFFF)
+ if (entry.data.currentIndex != 0xFFFF)
{
- const Lookup<GlyphID> &lookup = subs[entry->data.currentIndex];
+ const Lookup<GlyphID> &lookup = subs[entry.data.currentIndex];
replacement = lookup.get_value (buffer->info[idx].codepoint, driver->num_glyphs);
}
}
else
{
- unsigned int offset = entry->data.currentIndex + buffer->info[idx].codepoint;
+ unsigned int offset = entry.data.currentIndex + buffer->info[idx].codepoint;
const UnsizedArrayOf<GlyphID> &subs_old = (const UnsizedArrayOf<GlyphID> &) subs;
replacement = &subs_old[Types::wordOffsetToIndex (offset, table, subs_old.arrayZ)];
if (!replacement->sanitize (&c->sanitizer) || !*replacement)
ret = true;
}
- if (entry->flags & SetMark)
+ if (entry.flags & SetMark)
{
mark_set = true;
mark = buffer->idx;
DEFINE_SIZE_STATIC (2);
};
- static bool performAction (const Entry<EntryData> *entry)
- { return entry->flags & PerformAction; }
+ static bool performAction (const Entry<EntryData> &entry)
+ { return entry.flags & PerformAction; }
- static unsigned int ligActionIndex (const Entry<EntryData> *entry)
- { return entry->data.ligActionIndex; }
+ static unsigned int ligActionIndex (const Entry<EntryData> &entry)
+ { return entry.data.ligActionIndex; }
};
template <>
struct LigatureEntry<false>
typedef void EntryData;
- static bool performAction (const Entry<EntryData> *entry)
- { return entry->flags & Offset; }
+ static bool performAction (const Entry<EntryData> &entry)
+ { return entry.flags & Offset; }
- static unsigned int ligActionIndex (const Entry<EntryData> *entry)
- { return entry->flags & Offset; }
+ static unsigned int ligActionIndex (const Entry<EntryData> &entry)
+ { return entry.flags & Offset; }
};
match_length (0) {}
bool is_actionable (StateTableDriver<Types, EntryData> *driver HB_UNUSED,
- const Entry<EntryData> *entry)
+ const Entry<EntryData> &entry)
{
return LigatureEntryT::performAction (entry);
}
bool transition (StateTableDriver<Types, EntryData> *driver,
- const Entry<EntryData> *entry)
+ const Entry<EntryData> &entry)
{
hb_buffer_t *buffer = driver->buffer;
DEBUG_MSG (APPLY, nullptr, "Ligature transition at %u", buffer->idx);
- if (entry->flags & LigatureEntryT::SetComponent)
+ if (entry.flags & LigatureEntryT::SetComponent)
{
if (unlikely (match_length >= ARRAY_LENGTH (match_positions)))
return false;
insertionAction (table+table->insertionAction) {}
bool is_actionable (StateTableDriver<Types, EntryData> *driver HB_UNUSED,
- const Entry<EntryData> *entry)
+ const Entry<EntryData> &entry)
{
- return (entry->flags & (CurrentInsertCount | MarkedInsertCount)) &&
- (entry->data.currentInsertIndex != 0xFFFF ||entry->data.markedInsertIndex != 0xFFFF);
+ return (entry.flags & (CurrentInsertCount | MarkedInsertCount)) &&
+ (entry.data.currentInsertIndex != 0xFFFF ||entry.data.markedInsertIndex != 0xFFFF);
}
bool transition (StateTableDriver<Types, EntryData> *driver,
- const Entry<EntryData> *entry)
+ const Entry<EntryData> &entry)
{
hb_buffer_t *buffer = driver->buffer;
- unsigned int flags = entry->flags;
+ unsigned int flags = entry.flags;
unsigned mark_loc = buffer->out_len;
- if (entry->data.markedInsertIndex != 0xFFFF)
+ if (entry.data.markedInsertIndex != 0xFFFF)
{
unsigned int count = (flags & MarkedInsertCount);
- unsigned int start = entry->data.markedInsertIndex;
+ unsigned int start = entry.data.markedInsertIndex;
const GlyphID *glyphs = &insertionAction[start];
if (unlikely (!c->sanitizer.check_array (glyphs, count))) return false;
if (flags & SetMark)
mark = mark_loc;
- if (entry->data.currentInsertIndex != 0xFFFF)
+ if (entry.data.currentInsertIndex != 0xFFFF)
{
unsigned int count = (flags & CurrentInsertCount) >> 5;
- unsigned int start = entry->data.currentInsertIndex;
+ unsigned int start = entry.data.currentInsertIndex;
const GlyphID *glyphs = &insertionAction[start];
if (unlikely (!c->sanitizer.check_array (glyphs, count))) return false;