mirror of
https://github.com/storytold/harfbuzz.git
synced 2026-11-25 17:01:17 +01:00
[instancer/varstore] Add a chars_t type
This commit is contained in:
1 parent
1a6c6d7865
commit
9d9711698b
2 files changed
+10
-6
No files matched your search
@@ -2331,14 +2331,18 @@ struct delta_row_encoding_t
|
||||
{
|
||||
/* each byte represents a region, value is one of 0/1/2/4, which means bytes
|
||||
* needed for this region */
|
||||
hb_vector_t<uint8_t> chars;
|
||||
struct chars_t : hb_vector_t<uint8_t>
|
||||
{
|
||||
};
|
||||
|
||||
chars_t chars;
|
||||
unsigned width = 0;
|
||||
hb_bit_set_t columns;
|
||||
unsigned overhead = 0;
|
||||
hb_vector_t<const hb_vector_t<int>*> items;
|
||||
|
||||
delta_row_encoding_t () = default;
|
||||
delta_row_encoding_t (hb_vector_t<uint8_t>&& chars_,
|
||||
delta_row_encoding_t (chars_t&& chars_,
|
||||
const hb_vector_t<int>* row = nullptr) :
|
||||
delta_row_encoding_t ()
|
||||
|
||||
@@ -2353,9 +2357,9 @@ struct delta_row_encoding_t
|
||||
bool is_empty () const
|
||||
{ return !items; }
|
||||
|
||||
static hb_vector_t<uint8_t> get_row_chars (const hb_vector_t<int>& row)
|
||||
static chars_t get_row_chars (const hb_vector_t<int>& row)
|
||||
{
|
||||
hb_vector_t<uint8_t> ret;
|
||||
chars_t ret;
|
||||
if (!ret.alloc (row.length)) return ret;
|
||||
|
||||
bool long_words = false;
|
||||
|
||||
@@ -1857,7 +1857,7 @@ struct item_variations_t
|
||||
if (!front_mapping.set ((major<<16) + minor, &row))
|
||||
return false;
|
||||
|
||||
hb_vector_t<uint8_t> chars = delta_row_encoding_t::get_row_chars (row);
|
||||
auto chars = delta_row_encoding_t::get_row_chars (row);
|
||||
if (!chars) return false;
|
||||
|
||||
if (delta_rows_map.has (&row))
|
||||
@@ -1922,7 +1922,7 @@ struct item_variations_t
|
||||
removed_todo_idxes.add (i);
|
||||
removed_todo_idxes.add (j);
|
||||
|
||||
hb_vector_t<uint8_t> combined_chars;
|
||||
delta_row_encoding_t::chars_t combined_chars;
|
||||
if (!combined_chars.alloc (encoding.chars.length))
|
||||
return false;
|
||||
|
||||
|
||||
Reference in new issue
Block a user