summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/harfbuzz-ng/src/hb-ot-post-table-v2subset.hh
diff options
context:
space:
mode:
authorIevgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>2021-10-04 19:36:46 +0200
committerIevgenii Meshcheriakov <ievgenii.meshcheriakov@qt.io>2021-10-05 21:53:10 +0200
commitcb651f81de658874fc35e590364ab2e0cba67244 (patch)
treedc010cb09f8eb63d96b41da5595199bea6b907fb /src/3rdparty/harfbuzz-ng/src/hb-ot-post-table-v2subset.hh
parentfab1debb749e3bbe286ea637e011e586d49be0f8 (diff)
Update Harfbuzz to version 3.0.0
[ChangeLog][Text] Updated bundled Harfbuzz to version 3.0.0. Change-Id: I8d9fb465586bc1dbe58ce91b7f49c8483982c75a Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
Diffstat (limited to 'src/3rdparty/harfbuzz-ng/src/hb-ot-post-table-v2subset.hh')
-rw-r--r--src/3rdparty/harfbuzz-ng/src/hb-ot-post-table-v2subset.hh24
1 files changed, 20 insertions, 4 deletions
diff --git a/src/3rdparty/harfbuzz-ng/src/hb-ot-post-table-v2subset.hh b/src/3rdparty/harfbuzz-ng/src/hb-ot-post-table-v2subset.hh
index c8ea011269..94450eb53a 100644
--- a/src/3rdparty/harfbuzz-ng/src/hb-ot-post-table-v2subset.hh
+++ b/src/3rdparty/harfbuzz-ng/src/hb-ot-post-table-v2subset.hh
@@ -76,6 +76,9 @@ HB_INTERNAL bool postV2Tail::subset (hb_subset_context_t *c) const
hb_map_t old_new_index_map, old_gid_new_index_map;
unsigned i = 0;
+ post::accelerator_t _post;
+ _post.init (c->plan->source);
+
for (hb_codepoint_t new_gid = 0; new_gid < num_glyphs; new_gid++)
{
hb_codepoint_t old_gid = reverse_glyph_map.get (new_gid);
@@ -86,9 +89,24 @@ HB_INTERNAL bool postV2Tail::subset (hb_subset_context_t *c) const
else if (old_new_index_map.has (old_index)) new_index = old_new_index_map.get (old_index);
else
{
- new_index = 258 + i;
+ hb_bytes_t s = _post.find_glyph_name (old_gid);
+ int standard_glyph_index = -1;
+ for (unsigned i = 0; i < format1_names_length; i++)
+ {
+ if (s == format1_names (i))
+ {
+ standard_glyph_index = i;
+ break;
+ }
+ }
+ if (standard_glyph_index == -1)
+ {
+ new_index = 258 + i;
+ i++;
+ }
+ else
+ { new_index = standard_glyph_index; }
old_new_index_map.set (old_index, new_index);
- i++;
}
old_gid_new_index_map.set (old_gid, new_index);
}
@@ -103,8 +121,6 @@ HB_INTERNAL bool postV2Tail::subset (hb_subset_context_t *c) const
})
;
- post::accelerator_t _post;
- _post.init (c->plan->source);
bool ret = serialize (c->serializer, index_iter, &_post);
_post.fini ();
return_trace (ret);