aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQunxin Liu <qxliu@google.com>2023-09-27 09:36:52 -0700
committerQunxin Liu <qxliu@google.com>2023-09-27 12:52:59 -0700
commitf9b04b2145a2021cc56868daca89c3514f6a8966 (patch)
treeb7f3b69db6b7a16dbbdc19b9f5fc3832e7e2ef42
parentf39e9bf1ed52140d2658b4d845f3bbacc215221b (diff)
downloadharfbuzz_ng-f9b04b2145a2021cc56868daca89c3514f6a8966.tar.gz
[instancer] match fonttools'r order when calculating chars
Also fix a bug, make sure map set is happening before std::move
-rw-r--r--src/hb-ot-layout-common.hh6
-rw-r--r--src/hb-ot-var-common.hh4
2 files changed, 6 insertions, 4 deletions
diff --git a/src/hb-ot-layout-common.hh b/src/hb-ot-layout-common.hh
index 7125e99e4..e869d8ece 100644
--- a/src/hb-ot-layout-common.hh
+++ b/src/hb-ot-layout-common.hh
@@ -2323,8 +2323,9 @@ struct delta_row_encoding_t
bool long_words = false;
/* 0/1/2 byte encoding */
- for (int v: row)
+ for (int i = row.length - 1; i >= 0; i--)
{
+ int v = row.arrayZ[i];
if (v == 0)
ret.push (0);
else if (v > 32767 || v < -32768)
@@ -2343,8 +2344,9 @@ struct delta_row_encoding_t
/* redo, 0/2/4 bytes encoding */
ret.reset ();
- for (int v: row)
+ for (int i = row.length - 1; i >= 0; i--)
{
+ int v = row.arrayZ[i];
if (v == 0)
ret.push (0);
else if (v > 32767 || v < -32768)
diff --git a/src/hb-ot-var-common.hh b/src/hb-ot-var-common.hh
index ee6e35862..7a5227f1a 100644
--- a/src/hb-ot-var-common.hh
+++ b/src/hb-ot-var-common.hh
@@ -2039,10 +2039,10 @@ struct item_variations_t
}
else
{
+ if (!chars_idx_map.set (chars, encoding_objs.length))
+ return false;
delta_row_encoding_t obj (std::move (chars), &row);
encoding_objs.push (std::move (obj));
- if (!chars_idx_map.set (chars, encoding_objs.length - 1))
- return false;
}
}