From 786f8381bd8e104af15e84688d5f1cbb88587eee Mon Sep 17 00:00:00 2001 From: Behdad Esfahbod Date: Fri, 25 Jul 2025 04:00:37 -0600 Subject: [PATCH] [GDEF] Use bit-set instead of set-digest for mark glyph classes Most fonts don't even have these. Some, like NotoSansDuployan have huge ones. This speeds it up by 25%. --- src/OT/Layout/GDEF/GDEF.hh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/OT/Layout/GDEF/GDEF.hh b/src/OT/Layout/GDEF/GDEF.hh index 79de21e59..d58748505 100644 --- a/src/OT/Layout/GDEF/GDEF.hh +++ b/src/OT/Layout/GDEF/GDEF.hh @@ -1006,14 +1006,16 @@ struct GDEF { return #ifndef HB_NO_GDEF_CACHE - mark_glyph_set_digests[set_index].may_have (glyph_id) && + mark_glyph_set_digests[set_index].may_have (glyph_id) +#else + table->mark_set_covers (set_index, glyph_id) #endif - table->mark_set_covers (set_index, glyph_id); + ; } hb_blob_ptr_t table; #ifndef HB_NO_GDEF_CACHE - hb_vector_t mark_glyph_set_digests; + hb_vector_t mark_glyph_set_digests; mutable hb_cache_t<21, 3> glyph_props_cache; static_assert (sizeof (glyph_props_cache) == 512, ""); #endif