summaryrefslogtreecommitdiff
path: root/thirdparty/harfbuzz/src/hb-ot-post-table-v2subset.hh
diff options
context:
space:
mode:
authorbruvzg <7645683+bruvzg@users.noreply.github.com>2021-11-30 12:14:06 +0200
committerbruvzg <7645683+bruvzg@users.noreply.github.com>2021-12-01 09:37:48 +0200
commit371010c5f95ff13132821d707468d457dbaea7a7 (patch)
tree04ba22faf925991d276370d7f7c83dc09fad7d7e /thirdparty/harfbuzz/src/hb-ot-post-table-v2subset.hh
parente223a9c12905b99bb1fe93a56ae634b34eadd359 (diff)
HarfBuzz: Update to version 3.1.2
Diffstat (limited to 'thirdparty/harfbuzz/src/hb-ot-post-table-v2subset.hh')
-rw-r--r--thirdparty/harfbuzz/src/hb-ot-post-table-v2subset.hh31
1 files changed, 19 insertions, 12 deletions
diff --git a/thirdparty/harfbuzz/src/hb-ot-post-table-v2subset.hh b/thirdparty/harfbuzz/src/hb-ot-post-table-v2subset.hh
index 94450eb53a..504de2de74 100644
--- a/thirdparty/harfbuzz/src/hb-ot-post-table-v2subset.hh
+++ b/thirdparty/harfbuzz/src/hb-ot-post-table-v2subset.hh
@@ -79,6 +79,7 @@ HB_INTERNAL bool postV2Tail::subset (hb_subset_context_t *c) const
post::accelerator_t _post;
_post.init (c->plan->source);
+ hb_hashmap_t<hb_bytes_t, unsigned, std::nullptr_t, unsigned, nullptr, (unsigned)-1> glyph_name_to_new_index;
for (hb_codepoint_t new_gid = 0; new_gid < num_glyphs; new_gid++)
{
hb_codepoint_t old_gid = reverse_glyph_map.get (new_gid);
@@ -90,22 +91,28 @@ HB_INTERNAL bool postV2Tail::subset (hb_subset_context_t *c) const
else
{
hb_bytes_t s = _post.find_glyph_name (old_gid);
- int standard_glyph_index = -1;
- for (unsigned i = 0; i < format1_names_length; i++)
+ new_index = glyph_name_to_new_index.get (s);
+ if (new_index == (unsigned)-1)
{
- if (s == format1_names (i))
+ int standard_glyph_index = -1;
+ for (unsigned i = 0; i < format1_names_length; i++)
{
- standard_glyph_index = i;
- break;
+ 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; }
+ glyph_name_to_new_index.set (s, new_index);
}
- 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);
}
old_gid_new_index_map.set (old_gid, new_index);