[ot-layout] Narrow down random feature logic vs safe-to-break
This commit is contained in:
parent
33b579d0ad
commit
40884af17e
|
@ -559,7 +559,12 @@ struct AlternateSet
|
||||||
|
|
||||||
/* If alt_index is MAX_VALUE, randomize feature if it is the rand feature. */
|
/* If alt_index is MAX_VALUE, randomize feature if it is the rand feature. */
|
||||||
if (alt_index == HB_OT_MAP_MAX_VALUE && c->random)
|
if (alt_index == HB_OT_MAP_MAX_VALUE && c->random)
|
||||||
|
{
|
||||||
|
/* Maybe we can do better than unsafe-to-break all; but since we are
|
||||||
|
* changing random state, it would be hard to track that. Good 'nough. */
|
||||||
|
c->buffer->unsafe_to_break_all ();
|
||||||
alt_index = c->random_number () % count + 1;
|
alt_index = c->random_number () % count + 1;
|
||||||
|
}
|
||||||
|
|
||||||
if (unlikely (alt_index > count || alt_index == 0)) return_trace (false);
|
if (unlikely (alt_index > count || alt_index == 0)) return_trace (false);
|
||||||
|
|
||||||
|
|
|
@ -1933,8 +1933,6 @@ inline void hb_ot_map_t::apply (const Proxy &proxy,
|
||||||
c.set_auto_zwj (lookups[table_index][i].auto_zwj);
|
c.set_auto_zwj (lookups[table_index][i].auto_zwj);
|
||||||
c.set_auto_zwnj (lookups[table_index][i].auto_zwnj);
|
c.set_auto_zwnj (lookups[table_index][i].auto_zwnj);
|
||||||
c.set_random (lookups[table_index][i].random);
|
c.set_random (lookups[table_index][i].random);
|
||||||
if (c.random)
|
|
||||||
buffer->unsafe_to_break_all ();
|
|
||||||
|
|
||||||
apply_string<Proxy> (&c,
|
apply_string<Proxy> (&c,
|
||||||
proxy.table.get_lookup (lookup_index),
|
proxy.table.get_lookup (lookup_index),
|
||||||
|
|
Loading…
Reference in New Issue