[aat] Support ranges in NonContextual subtable as well

pull/4023/head
Behdad Esfahbod 2 years ago
parent c08308a83c
commit 2c9c49fd32
  1. 1
      src/hb-aat-layout-common.hh
  2. 17
      src/hb-aat-layout-morx-table.hh

@ -803,7 +803,6 @@ struct StateTableDriver
last_range = range;
}
if (!(range->flags & ac->subtable_flags))
{
if (buffer->idx == buffer->len || unlikely (!buffer->successful))

@ -618,8 +618,25 @@ struct NoncontextualSubtable
hb_glyph_info_t *info = c->buffer->info;
unsigned int count = c->buffer->len;
auto *last_range = c->range_flags && (*c->range_flags) ? &(*c->range_flags)[0] : nullptr;
for (unsigned int i = 0; i < count; i++)
{
if (last_range)
{
auto *range = last_range;
{
unsigned cluster = info[i].cluster;
while (cluster < range->cluster_first)
range--;
while (cluster > range->cluster_last)
range++;
last_range = range;
}
if (!(range->flags & c->subtable_flags))
continue;
}
const HBGlyphID16 *replacement = substitute.get_value (info[i].codepoint, num_glyphs);
if (replacement)
{

Loading…
Cancel
Save