[truetype] Reduce heap allocation of `deltaSet` variation data.

`deltaSet` is an array of packed integers that can be 32 bits, 16 bits, or
8 bits.  Before this change, these values were unpacked to 32-bit integers.
However, this can cause big heap allocations, e.g., around 500 KByte for
'NotoSansCJK'.  To reduce this amount, store the packed integers and unpack
them just before passing to the calculation.  At calculation time, due to
the variable length of region indices, temporary heap allocations are
necessary.  This heap allocation is not negligible and visible in `ftbench`
results.  So, use stack-allocated arrays for short array calculations.

Fixes #1230.

* include/freetype/internal/ftmmtypes.h (GX_ItemVarDataRec): New fields
`wordDeltaCount` and `longWords`.

* src/truetype/ttgxvar.c (tt_var_load_item_variation_store): Load packed
(tt_var_get_item_delta): Unpack data before applying.
2 files changed