Don't seed the RNG from the contents of the buffer
This commit is contained in:
parent
2de96e8468
commit
b545e27d88
|
@ -503,16 +503,13 @@ struct hb_ot_apply_context_t :
|
||||||
auto_zwnj (true),
|
auto_zwnj (true),
|
||||||
auto_zwj (true),
|
auto_zwj (true),
|
||||||
random (false),
|
random (false),
|
||||||
random_state (0),
|
random_state (1),
|
||||||
has_glyph_classes (gdef.has_glyph_classes ()) {}
|
has_glyph_classes (gdef.has_glyph_classes ()) {}
|
||||||
|
|
||||||
inline void set_lookup_mask (hb_mask_t mask) { lookup_mask = mask; }
|
inline void set_lookup_mask (hb_mask_t mask) { lookup_mask = mask; }
|
||||||
inline void set_auto_zwj (bool auto_zwj_) { auto_zwj = auto_zwj_; }
|
inline void set_auto_zwj (bool auto_zwj_) { auto_zwj = auto_zwj_; }
|
||||||
inline void set_auto_zwnj (bool auto_zwnj_) { auto_zwnj = auto_zwnj_; }
|
inline void set_auto_zwnj (bool auto_zwnj_) { auto_zwnj = auto_zwnj_; }
|
||||||
inline void set_random_state (uint64_t random_state_) {
|
inline void set_random (bool random_) { random = random_; }
|
||||||
random = true;
|
|
||||||
random_state = random_state_;
|
|
||||||
}
|
|
||||||
inline void set_recurse_func (recurse_func_t func) { recurse_func = func; }
|
inline void set_recurse_func (recurse_func_t func) { recurse_func = func; }
|
||||||
inline void set_lookup_index (unsigned int lookup_index_) { lookup_index = lookup_index_; }
|
inline void set_lookup_index (unsigned int lookup_index_) { lookup_index = lookup_index_; }
|
||||||
inline void set_lookup_props (unsigned int lookup_props_)
|
inline void set_lookup_props (unsigned int lookup_props_)
|
||||||
|
|
|
@ -1270,10 +1270,7 @@ inline void hb_ot_map_t::apply (const Proxy &proxy,
|
||||||
c.set_auto_zwnj (lookups[table_index][i].auto_zwnj);
|
c.set_auto_zwnj (lookups[table_index][i].auto_zwnj);
|
||||||
if (lookups[table_index][i].random)
|
if (lookups[table_index][i].random)
|
||||||
{
|
{
|
||||||
uint64_t random_state = 1;
|
c.set_random (true);
|
||||||
for (unsigned int j = 0; j < buffer->len; j++)
|
|
||||||
random_state = 31 * random_state + buffer->info[j].codepoint;
|
|
||||||
c.set_random_state (random_state);
|
|
||||||
buffer->unsafe_to_break_all ();
|
buffer->unsafe_to_break_all ();
|
||||||
}
|
}
|
||||||
apply_string<Proxy> (&c,
|
apply_string<Proxy> (&c,
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
../fonts/5bb74492f5e0ffa1fbb72e4c881be035120b6513.ttf:--no-glyph-names --features=-rand:U+0054,U+0055,U+0056:[1=0+560|2=1+602|3=2+602]
|
../fonts/5bb74492f5e0ffa1fbb72e4c881be035120b6513.ttf:--no-glyph-names --features=-rand:U+0054,U+0055,U+0056:[1=0+560|2=1+602|3=2+602]
|
||||||
../fonts/5bb74492f5e0ffa1fbb72e4c881be035120b6513.ttf:--no-glyph-names --features=rand=2:U+0054,U+0055,U+0056:[5=0+560|8=1+602|11=2+602]
|
../fonts/5bb74492f5e0ffa1fbb72e4c881be035120b6513.ttf:--no-glyph-names --features=rand=2:U+0054,U+0055,U+0056:[5=0+560|8=1+602|11=2+602]
|
||||||
../fonts/5bb74492f5e0ffa1fbb72e4c881be035120b6513.ttf:--no-glyph-names:U+0054,U+0055,U+0056,U+0054,U+0055,U+0056,U+0054,U+0055,U+0056,U+0054,U+0055,U+0056:[4=0+560|7=1+602|11=2+602|6=3+560|8=4+602|10=5+602|5=6+560|9=7+602|10=8+602|5=9+560|7=10+602|12=11+602]
|
../fonts/5bb74492f5e0ffa1fbb72e4c881be035120b6513.ttf:--no-glyph-names:U+0054,U+0055,U+0056,U+0054,U+0055,U+0056,U+0054,U+0055,U+0056,U+0054,U+0055,U+0056:[6=0+560|9=1+602|10=2+602|6=3+560|9=4+602|12=5+602|5=6+560|8=7+602|11=8+602|6=9+560|8=10+602|10=11+602]
|
||||||
|
|
Loading…
Reference in New Issue