[font] When font changes, drop font shaper data

https://github.com/harfbuzz/harfbuzz/issues/3683#issuecomment-1168016509
This commit is contained in:
Behdad Esfahbod 2022-06-28 13:19:12 -06:00
parent 34c6c0193c
commit c1c78ade71
2 changed files with 3 additions and 1 deletions

View File

@ -639,6 +639,8 @@ struct hb_font_t
bool y_neg = y_scale < 0;
y_mult = (y_neg ? -((int64_t) -y_scale << 16) : ((int64_t) y_scale << 16)) / upem;
slant_xy = y_scale ? slant * x_scale / y_scale : 0.f;
data.fini ();
}
hb_position_t em_mult (int16_t v, int64_t mult)

View File

@ -176,7 +176,7 @@ struct hb_lazy_loader_t : hb_data_wrapper_t<Data, WheresData>
void init0 () {} /* Init, when memory is already set to 0. No-op for us. */
void init () { instance.set_relaxed (nullptr); }
void fini () { do_destroy (instance.get ()); }
void fini () { do_destroy (instance.get ()); init (); }
void free_instance ()
{